Changeset 224 for trunk/Cocoa/F-Script Anywhere/Source
- Timestamp:
- 05/17/06 04:58:34 (19 years ago)
- Location:
- trunk/Cocoa/F-Script Anywhere/Source
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cocoa/F-Script Anywhere/Source/F-Script Anywhere.xcodeproj/project.pbxproj
r219 r224 10 10 25EADA9609CD2D7100BCD8E1 /* bytesex.c in Sources */ = {isa = PBXBuildFile; fileRef = 25EADA9509CD2D7100BCD8E1 /* bytesex.c */; }; 11 11 E14C18BD05A4DE25000D4AF3 /* FSAInterpreterPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = F5680F7A020D0D0401AEEC37 /* FSAInterpreterPanel.nib */; }; 12 E14C18BE05A4DE29000D4AF3 /* FSAViewAssociationPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = F5FF50C002E53EE101AEEDB1 /* FSAViewAssociationPanel.nib */; };13 12 E14C18BF05A4F013000D4AF3 /* Bullseye menu cursor.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F5694E2702E96FFE01AEEDB1 /* Bullseye menu cursor.tiff */; }; 14 13 E14C1ECF05A8DB19000D4AF3 /* Ellipsis.tiff in Resources */ = {isa = PBXBuildFile; fileRef = E14C1ECE05A8DB19000D4AF3 /* Ellipsis.tiff */; }; … … 214 213 F5FF50BC02E53B9E01AEEDB1 /* FSAViewAssociationController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FSAViewAssociationController.h; sourceTree = "<group>"; }; 215 214 F5FF50BD02E53B9E01AEEDB1 /* FSAViewAssociationController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = FSAViewAssociationController.m; sourceTree = "<group>"; }; 216 F5FF50C102E53EE101AEEDB1 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/FSAViewAssociationPanel.nib; sourceTree = "<group>"; };217 215 /* End PBXFileReference section */ 218 216 … … 294 292 29B97318FDCFA39411CA2CEA /* MainMenu.nib */, 295 293 F5680F7A020D0D0401AEEC37 /* FSAInterpreterPanel.nib */, 296 F5FF50C002E53EE101AEEDB1 /* FSAViewAssociationPanel.nib */,297 294 E1EE9A2F0575769600F2D92C /* Info-Application.plist */, 298 295 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, … … 694 691 E1F3DF920579172A00E952A5 /* FSA.strings in Resources */, 695 692 E14C18BD05A4DE25000D4AF3 /* FSAInterpreterPanel.nib in Resources */, 696 E14C18BE05A4DE29000D4AF3 /* FSAViewAssociationPanel.nib in Resources */,697 693 E14C18BF05A4F013000D4AF3 /* Bullseye menu cursor.tiff in Resources */, 698 694 ); … … 832 828 ); 833 829 name = FSAInterpreterPanel.nib; 834 sourceTree = "<group>";835 };836 F5FF50C002E53EE101AEEDB1 /* FSAViewAssociationPanel.nib */ = {837 isa = PBXVariantGroup;838 children = (839 F5FF50C102E53EE101AEEDB1 /* English */,840 );841 name = FSAViewAssociationPanel.nib;842 830 sourceTree = "<group>"; 843 831 }; -
trunk/Cocoa/F-Script Anywhere/Source/FSAController.h
r223 r224 36 36 FSAViewAssociationController *viewAssociationController; 37 37 unsigned interpreterNum; 38 39 NSCursor *bullseyeCursor; 38 40 } 39 41 -
trunk/Cocoa/F-Script Anywhere/Source/FSAController.m
r223 r224 205 205 - (IBAction)FSA_associateAndOpenBrowser:(id)sender 206 206 { 207 if (viewAssociationController == nil) { 208 viewAssociationController = [[FSAViewAssociationController alloc] initWithFSAController: self]; 209 } 210 [viewAssociationController captureOneView]; 207 211 } 208 212 -
trunk/Cocoa/F-Script Anywhere/Source/FSAViewAssociationController.h
r19 r224 32 32 @interface FSAViewAssociationController : NSWindowController 33 33 { 34 IBOutlet NSButton *captureButton;35 IBOutlet NSButton *browseButton;36 IBOutlet NSButton *associateButton;37 IBOutlet NSTextField *descriptionField;38 IBOutlet NSTextField *variableNameField;39 IBOutlet NSTextField *statusField;40 34 NSCursor *bullseyeCursor; 41 35 id selectedElement; … … 47 41 - (id)initWithFSAController:(FSAController *)fsa; 48 42 49 - ( IBAction)update:(id)sender;43 - (void)captureOneView; 50 44 - (IBAction)captureView:(id)sender; 51 - (IBAction)defineVariable:(id)sender;52 45 - (IBAction)viewInObjectBrowser:(id)sender; 46 - (void)alertWithString:(NSString *)alertString; 53 47 54 48 @end -
trunk/Cocoa/F-Script Anywhere/Source/FSAViewAssociationController.m
r153 r224 36 36 - (id)initWithFSAController:(FSAController *)fsa; 37 37 { 38 self = [super init WithWindowNibName: @"FSAViewAssociationPanel"];38 self = [super init]; 39 39 40 40 if (self != nil) { … … 47 47 if (label != nil) [[self window] setTitle: [NSString stringWithFormat: @"%@: %@", [[self window] title], label]]; 48 48 bullseyeCursor = [[NSCursor alloc] initWithImage: bullseyeImage hotSpot: NSMakePoint(6, 7)]; 49 [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(controlTextDidChange:) name: NSControlTextDidChangeNotification object: variableNameField];50 [[captureButton cell] setShowsStateBy: NSContentsCellMask | NSChangeGrayCellMask];51 [captureButton setState: NSOffState];52 [self update: nil];53 49 } 54 50 return self; … … 65 61 } 66 62 67 - (IBAction)update:(id)sender;68 {69 NSString *variableName = [variableNameField stringValue];70 BOOL canAssignToVariable = NO;71 [browseButton setEnabled: selectedElement != nil];72 [statusField setStringValue: @""];73 if ([variableName length] != 0) {74 if (![FSInterpreter validateSyntaxForIdentifier: variableName]) {75 [statusField setStringValue: @"Invalid name: contains spaces, punctuation or non-ASCII characters"];76 } else if (selectedElement != nil) {77 [statusField setStringValue: @"Click ÒAssociateÓ to assign to this variable"];78 canAssignToVariable = YES;79 }80 }81 [associateButton setEnabled: canAssignToVariable];82 [variableNameField setEnabled: [captureButton state] == NSOffState];83 }84 85 63 - (void)stopCapturingVoluntarily:(BOOL)voluntary; 86 64 { 87 65 FSALog(@"stopping capture"); 88 66 [[NSNotificationCenter defaultCenter] removeObserver: self name: NSMenuWillSendActionNotification object: nil]; 89 [captureButton setState: NSOffState];90 [self update: nil];91 67 if (voluntary) { 92 68 FSALog(@"voluntary!"); 93 69 [[self window] makeKeyAndOrderFront: self]; 94 70 [bullseyeCursor pop]; 95 [variableNameField becomeFirstResponder];96 71 } 97 72 } … … 158 133 159 134 FSALog(@"%4u>capturing one", capture); 160 [captureButton setState: NSOnState];161 135 [bullseyeCursor push]; 162 163 136 captureElement: 164 137 [bullseyeCursor set]; … … 192 165 contentView = [eventWindow contentView]; 193 166 view = [[contentView superview] hitTest: [event locationInWindow]]; 194 if (view == captureButton) {195 [NSApp discardEventsMatchingMask: NSAnyEventMask & ~NSKeyUpMask beforeEvent: event];196 FSALog(@"%4u<stop capture [capture button]", capture);197 [self stopCapturingVoluntarily: YES];198 NS_VOIDRETURN;199 }200 167 if (view == nil) { 201 168 [self captureOneView]; … … 214 181 [self _addElementToMenu: eventWindow]; 215 182 NS_HANDLER 216 [descriptionField setStringValue: 217 [NSString stringWithFormat: @"Çan exception occurred: %@È", localException]]; 183 [self alertWithString:[NSString stringWithFormat: @"Çan exception occurred: %@È", localException]]; 218 184 NS_ENDHANDLER 219 185 [NSMenu popUpContextMenu: viewHierarchyMenu withEvent: event forView: view]; 220 if ([captureButton state] == NSOnState) goto captureElement; 186 [self stopCapturingVoluntarily: YES]; 187 // if ([captureButton state] == NSOnState) goto captureElement; 221 188 FSALog(@"%4u<stop capture [fell through to end]", capture); 222 189 } … … 224 191 - (IBAction)captureView:(id)sender 225 192 { 226 [statusField setStringValue: @"Click inside one of this applicationÕs windows to select."];227 193 [selectedElement release]; selectedElement = nil; 228 [self update: nil];229 194 [self captureOneView]; 230 195 } … … 234 199 FSALog(@"element selected: %@", element); 235 200 NS_DURING 236 [descriptionField setStringValue: [element description]];237 201 [selectedElement release]; 238 202 selectedElement = [element retain]; 239 203 [[self window] orderFront: self]; 240 204 NS_HANDLER 241 [descriptionField setStringValue: 242 [NSString stringWithFormat: @"Çan exception occurred: %@È", localException]]; 205 [self alertWithString:[NSString stringWithFormat: @"Çan exception occurred: %@È", localException]]; 243 206 NS_ENDHANDLER 244 207 [viewHierarchyMenu release]; viewHierarchyMenu = nil; … … 248 211 { 249 212 [self setSelectedElement: [sender representedObject]]; 250 [self captureOneView]; 213 [system browse: selectedElement]; 214 // [self captureOneView]; 251 215 } 252 216 … … 259 223 } 260 224 261 - (void)controlTextDidChange:(NSNotification *)notification;262 {263 [self update: nil];264 }265 266 - (IBAction)defineVariable:(id)sender;267 {268 NS_DURING269 NSString *variableName = [variableNameField stringValue];270 [statusField setStringValue: @"AssociatingÉ"];271 [interpreter setObject: selectedElement forIdentifier: variableName];272 [statusField setStringValue: [NSString stringWithFormat: @"Assigned variable Ò%@Ó", variableName]];273 NS_HANDLER274 [statusField setStringValue: [NSString stringWithFormat: @"Assocation failed: %@", localException]];275 NS_ENDHANDLER276 }277 278 225 - (IBAction)viewInObjectBrowser:(id)sender; 279 226 { 280 227 FSALog(@"system: %@", system); 281 228 [system browse: selectedElement]; 282 [statusField setStringValue: @"Opened object browser"]; 229 } 230 231 - (void)alertWithString:(NSString *)alertString 232 { 233 [NSAlert alertWithMessageText:alertString 234 defaultButton:nil 235 alternateButton:nil 236 otherButton:nil 237 informativeTextWithFormat:nil]; 283 238 } 284 239 -
trunk/Cocoa/F-Script Anywhere/Source/FSAnywhere.h
r217 r224 8 8 */ 9 9 10 #define FSA_VERSION "1. 2b1"11 #define FSA_FSCRIPT_MIN_VERSION 0x1 252001 /* 1.2.5d1 */10 #define FSA_VERSION "1.3" 11 #define FSA_FSCRIPT_MIN_VERSION 0x1318000 /* 1.3.1 */ 12 12 #undef FSA_DEBUG 13 13 -
trunk/Cocoa/F-Script Anywhere/Source/FSAnywhere.m
r217 r224 11 11 12 12 NSString * FSA_FScriptURL = @"http://www.fscript.org/"; 13 NSString * FSA_FScriptMinimumVersion = @"1.3. 0";13 NSString * FSA_FScriptMinimumVersion = @"1.3.1";
Note:
See TracChangeset
for help on using the changeset viewer.