|
| 1 | +#import "SSYDocTabViewController.h" |
| 2 | + |
| 3 | +/* |
| 4 | + I was going to factor much of BkmxDocTabViewController into this, |
| 5 | + and also factor an SSYLazyView out of BkmxLazyView, but |
| 6 | + then decided not to, because it would just be for reuse vanity that |
| 7 | + no one would ever re-use. |
| 8 | + */ |
| 9 | +#if 0 |
| 10 | + |
| 11 | +@interface SSYDocTabViewController () |
| 12 | + |
| 13 | +@end |
| 14 | + |
| 15 | +@implementation SSYDocTabViewController |
| 16 | + |
| 17 | +@synthesize windowController = m_windowController ; |
| 18 | +@synthesize awakened = m_awakened ; |
| 19 | + |
| 20 | +- (void)logIfBadInit { |
| 21 | + if (self) { |
| 22 | + if (![self conformsToProtocol:@protocol(BkmxDocTabViewControls)]) { |
| 23 | + NSLog(@"Internal Error 194-2390 %@ no conform", [self className]) ; |
| 24 | + } |
| 25 | + } |
| 26 | +} |
| 27 | + |
| 28 | +- (id)initWithNibName:(NSString*)nibNameOrNil |
| 29 | + windowController:(BkmxDocWinCon*)windowController |
| 30 | + bundle:(NSBundle*)nibBundleOrNil { |
| 31 | + [self setWindowController:windowController] ; |
| 32 | + self = [super initWithNibName:nibNameOrNil |
| 33 | + bundle:nibBundleOrNil] ; |
| 34 | + [self logIfBadInit] ; |
| 35 | + return self ; |
| 36 | +} |
| 37 | + |
| 38 | +- (id)initWithCoder:(NSCoder*)aDecoder { |
| 39 | + self = [super initWithCoder:aDecoder] ; |
| 40 | + [self logIfBadInit] ; |
| 41 | + return self ; |
| 42 | +} |
| 43 | + |
| 44 | +- (void)endEditing:(NSNotification*)note { |
| 45 | + [[self windowController] endEditing] ; |
| 46 | +} |
| 47 | + |
| 48 | +- (void)awakeFromNib { |
| 49 | + // Safely invoke super |
| 50 | + [self safelySendSuperSelector:_cmd |
| 51 | + prettyFunction:__PRETTY_FUNCTION__ |
| 52 | + arguments:nil] ; |
| 53 | + |
| 54 | + [self setNextResponder:[[self windowController] nextResponder]] ; |
| 55 | + [[self windowController] setNextResponder:self] ; |
| 56 | +} |
| 57 | + |
| 58 | +- (BOOL) tabView:(NSTabView*)tabView |
| 59 | + shouldSelectTabViewItem:(NSTabViewItem*)tabViewItem { |
| 60 | + return [[self windowController] tabView:tabView |
| 61 | + shouldSelectTabViewItem:tabViewItem] ; |
| 62 | +} |
| 63 | + |
| 64 | +- (void) tabView:(NSTabView*)tabView |
| 65 | + willSelectTabViewItem:(NSTabViewItem*)tabViewItem { |
| 66 | + [[self windowController] tabView:tabView |
| 67 | + willSelectTabViewItem:tabViewItem] ; |
| 68 | +} |
| 69 | + |
| 70 | +- (void) tabView:(NSTabView*)tabView |
| 71 | + didSelectTabViewItem:(NSTabViewItem*)tabViewItem { |
| 72 | + [[self windowController] tabView:tabView |
| 73 | + didSelectTabViewItem:tabViewItem] ; |
| 74 | +} |
| 75 | + |
| 76 | +- (void)tearDown { |
| 77 | + [self setWindowController:nil] ; |
| 78 | +} |
| 79 | + |
| 80 | +- (BkmxDoc*)document { |
| 81 | + return [[self windowController] document] ; |
| 82 | +} |
| 83 | + |
| 84 | +@end |
| 85 | + |
| 86 | +#endif |
0 commit comments