Changeset 226 for trunk/Cocoa/F-Script Anywhere
- Timestamp:
- 05/17/06 05:25:05 (19 years ago)
- Location:
- trunk/Cocoa/F-Script Anywhere/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cocoa/F-Script Anywhere/Source/FSAController.h
r224 r226 40 40 } 41 41 42 - (id)initShowingInterpreter:(BOOL)showInterpreter; 43 42 44 - (IBAction)setFloating:(id)sender; 43 45 - (IBAction)FSA_associateWithInterface:(id)sender; -
trunk/Cocoa/F-Script Anywhere/Source/FSAController.m
r224 r226 104 104 item = [fsaMenu addItemWithTitle: NSLocalizedStringFromTableInBundle(@"New F-Script Workspace", @"FSA", bundle, @"Title of F-Script Workspace menu item") action:@selector(createInterpreterWindow:) keyEquivalent: @""]; 105 105 [item setTarget: self]; 106 item = [fsaMenu addItemWithTitle: NSLocalizedStringFromTableInBundle(@"Browser for Target...", @"FSA", bundle, @"Title of F-Script Workspace menu item") action:@selector(createBrowserForSelection:) keyEquivalent: @""]; 107 [item setTarget: self]; 106 108 [fsaMenu addItem: [NSMenuItem separatorItem]]; 107 item = [fsaMenu addItemWithTitle: NSLocalizedStringFromTableInBundle(@"About F-Script Anywhere ...", @"FSA", bundle, @"Title of Info Panel menu item") action:@selector(showInfo:) keyEquivalent: @""];109 item = [fsaMenu addItemWithTitle: NSLocalizedStringFromTableInBundle(@"About F-Script Anywhere", @"FSA", bundle, @"Title of Info Panel menu item") action:@selector(showInfo:) keyEquivalent: @""]; 108 110 [item setTarget: self]; 109 111 [[FSAWindowManager sharedManager] setWindowMenu: fsaMenu]; … … 118 120 NSAssert([menuItem target] == self, @"menu item does not target FSAController!"); 119 121 sel = [menuItem action]; 120 if (sel == @selector(showInfo:) || sel == @selector(createInterpreterWindow:) ) return YES;122 if (sel == @selector(showInfo:) || sel == @selector(createInterpreterWindow:) || sel == @selector(createBrowserForSelection:)) return YES; 121 123 FSALog(@"+[FSAController validateMenuItem:] unknown menu item for validation: %@", menuItem); 122 124 return NO; … … 125 127 + (void)createInterpreterWindow:(id)sender; 126 128 { 127 [[self alloc] init]; 129 [[self alloc] initShowingInterpreter:YES]; 130 } 131 132 + (void)createBrowserForSelection:(id)sender; 133 { 134 [[[self alloc] initShowingInterpreter:NO] FSA_associateAndOpenBrowser:sender]; 128 135 } 129 136 … … 136 143 } 137 144 138 - (id)init {145 - (id)initShowingInterpreter:(BOOL)showInterpreter { 139 146 self = [super initWithWindowNibName: @"FSAInterpreterPanel"]; 140 147 141 148 if (self != nil) { 142 149 NSWindow *window = [self window]; 143 150 NSString *label; 144 151 static unsigned numInterpWindows = 0; 145 146 NSAssert(window != nil, @"Can't get interpreter window!"); 147 if (interpreterNum == 0) interpreterNum = ++numInterpWindows; 148 if ( (label = [self interpreterLabel]) != nil) { 149 [window setTitle: [NSString stringWithFormat: @"%@: %@", [window title], label]]; 150 } 151 152 [window setLevel: NSNormalWindowLevel]; // XXX if set floating, it is globally floating! 153 [self showWindow: self]; 154 [window makeKeyAndOrderFront: self]; 152 153 if(showInterpreter){ 154 NSAssert(window != nil, @"Can't get interpreter window!"); 155 if (interpreterNum == 0) interpreterNum = ++numInterpWindows; 156 if ( (label = [self interpreterLabel]) != nil) { 157 [window setTitle: [NSString stringWithFormat: @"%@: %@", [window title], label]]; 158 } 159 160 [window setLevel: NSNormalWindowLevel]; // XXX if set floating, it is globally floating! 161 [self showWindow: self]; 162 [window makeKeyAndOrderFront: self]; 155 163 #warning this should go away when F-Script properly accepts firstResponder on the InterpreterView 156 [window makeFirstResponder: (NSView *)[[[self interpreterView] cliView] shellView]]; 157 [[FSAWindowManager sharedManager] registerWindow: window]; 158 system = [[[self interpreterView] interpreter] objectForIdentifier: @"sys" found: NULL]; 159 [system retain]; 160 NSAssert1([system isKindOfClass: [System class]], @"Initial value bound to identifier 'sys' is not a System object, but %@", system); 164 [window makeFirstResponder: (NSView *)[[[self interpreterView] cliView] shellView]]; 165 [[FSAWindowManager sharedManager] registerWindow: window]; 166 } 167 system = [[[self interpreterView] interpreter] objectForIdentifier: @"sys" found: NULL]; 168 [system retain]; 169 NSAssert1([system isKindOfClass: [System class]], @"Initial value bound to identifier 'sys' is not a System object, but %@", system); 161 170 } 162 171 … … 211 220 } 212 221 213 - (IBAction)FSA_associateWithInterface:(id)sender;214 {215 NS_DURING216 FSAWindowManager *wm = [FSAWindowManager sharedManager];217 if (viewAssociationController == nil) {218 viewAssociationController = [[FSAViewAssociationController alloc] initWithFSAController: self];219 }220 [viewAssociationController showWindow: self];221 if (![wm windowIsRegistered: [viewAssociationController window]]) {222 [wm registerSubordinateWindow: [viewAssociationController window]223 forWindow: [self window]];224 }225 NS_HANDLER226 FSALog(@"%@", localException);227 NS_ENDHANDLER228 }229 230 222 @end
Note:
See TracChangeset
for help on using the changeset viewer.