Changeset 224 for trunk/Cocoa


Ignore:
Timestamp:
05/17/06 04:58:34 (19 years ago)
Author:
rchin
Message:

Object For Target... button now works as it should.

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  
    1010                25EADA9609CD2D7100BCD8E1 /* bytesex.c in Sources */ = {isa = PBXBuildFile; fileRef = 25EADA9509CD2D7100BCD8E1 /* bytesex.c */; };
    1111                E14C18BD05A4DE25000D4AF3 /* FSAInterpreterPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = F5680F7A020D0D0401AEEC37 /* FSAInterpreterPanel.nib */; };
    12                 E14C18BE05A4DE29000D4AF3 /* FSAViewAssociationPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = F5FF50C002E53EE101AEEDB1 /* FSAViewAssociationPanel.nib */; };
    1312                E14C18BF05A4F013000D4AF3 /* Bullseye menu cursor.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F5694E2702E96FFE01AEEDB1 /* Bullseye menu cursor.tiff */; };
    1413                E14C1ECF05A8DB19000D4AF3 /* Ellipsis.tiff in Resources */ = {isa = PBXBuildFile; fileRef = E14C1ECE05A8DB19000D4AF3 /* Ellipsis.tiff */; };
     
    214213                F5FF50BC02E53B9E01AEEDB1 /* FSAViewAssociationController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FSAViewAssociationController.h; sourceTree = "<group>"; };
    215214                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>"; };
    217215/* End PBXFileReference section */
    218216
     
    294292                                29B97318FDCFA39411CA2CEA /* MainMenu.nib */,
    295293                                F5680F7A020D0D0401AEEC37 /* FSAInterpreterPanel.nib */,
    296                                 F5FF50C002E53EE101AEEDB1 /* FSAViewAssociationPanel.nib */,
    297294                                E1EE9A2F0575769600F2D92C /* Info-Application.plist */,
    298295                                089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
     
    694691                                E1F3DF920579172A00E952A5 /* FSA.strings in Resources */,
    695692                                E14C18BD05A4DE25000D4AF3 /* FSAInterpreterPanel.nib in Resources */,
    696                                 E14C18BE05A4DE29000D4AF3 /* FSAViewAssociationPanel.nib in Resources */,
    697693                                E14C18BF05A4F013000D4AF3 /* Bullseye menu cursor.tiff in Resources */,
    698694                        );
     
    832828                        );
    833829                        name = FSAInterpreterPanel.nib;
    834                         sourceTree = "<group>";
    835                 };
    836                 F5FF50C002E53EE101AEEDB1 /* FSAViewAssociationPanel.nib */ = {
    837                         isa = PBXVariantGroup;
    838                         children = (
    839                                 F5FF50C102E53EE101AEEDB1 /* English */,
    840                         );
    841                         name = FSAViewAssociationPanel.nib;
    842830                        sourceTree = "<group>";
    843831                };
  • trunk/Cocoa/F-Script Anywhere/Source/FSAController.h

    r223 r224  
    3636    FSAViewAssociationController *viewAssociationController;
    3737    unsigned interpreterNum;
     38   
     39    NSCursor *bullseyeCursor;
    3840}
    3941
  • trunk/Cocoa/F-Script Anywhere/Source/FSAController.m

    r223 r224  
    205205- (IBAction)FSA_associateAndOpenBrowser:(id)sender
    206206{
     207    if (viewAssociationController == nil) {
     208        viewAssociationController = [[FSAViewAssociationController alloc] initWithFSAController: self];
     209    }
     210    [viewAssociationController captureOneView];
    207211}
    208212
  • trunk/Cocoa/F-Script Anywhere/Source/FSAViewAssociationController.h

    r19 r224  
    3232@interface FSAViewAssociationController : NSWindowController
    3333{
    34     IBOutlet NSButton *captureButton;
    35     IBOutlet NSButton *browseButton;
    36     IBOutlet NSButton *associateButton;
    37     IBOutlet NSTextField *descriptionField;
    38     IBOutlet NSTextField *variableNameField;
    39     IBOutlet NSTextField *statusField;
    4034    NSCursor *bullseyeCursor;
    4135    id selectedElement;
     
    4741- (id)initWithFSAController:(FSAController *)fsa;
    4842
    49 - (IBAction)update:(id)sender;
     43- (void)captureOneView;
    5044- (IBAction)captureView:(id)sender;
    51 - (IBAction)defineVariable:(id)sender;
    5245- (IBAction)viewInObjectBrowser:(id)sender;
     46- (void)alertWithString:(NSString *)alertString;
    5347
    5448@end
  • trunk/Cocoa/F-Script Anywhere/Source/FSAViewAssociationController.m

    r153 r224  
    3636- (id)initWithFSAController:(FSAController *)fsa;
    3737{
    38     self = [super initWithWindowNibName: @"FSAViewAssociationPanel"];
     38    self = [super init];
    3939
    4040    if (self != nil) {
     
    4747        if (label != nil) [[self window] setTitle: [NSString stringWithFormat: @"%@: %@", [[self window] title], label]];
    4848        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];
    5349    }
    5450    return self;
     
    6561}
    6662
    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 
    8563- (void)stopCapturingVoluntarily:(BOOL)voluntary;
    8664{
    8765    FSALog(@"stopping capture");
    8866    [[NSNotificationCenter defaultCenter] removeObserver: self name: NSMenuWillSendActionNotification object: nil];
    89     [captureButton setState: NSOffState];
    90     [self update: nil];
    9167    if (voluntary) {
    9268        FSALog(@"voluntary!");
    9369        [[self window] makeKeyAndOrderFront: self];
    9470        [bullseyeCursor pop];
    95         [variableNameField becomeFirstResponder];       
    9671    }
    9772}
     
    158133   
    159134    FSALog(@"%4u>capturing one", capture);
    160     [captureButton setState: NSOnState];
    161135    [bullseyeCursor push];
    162 
    163136captureElement:
    164137    [bullseyeCursor set];
     
    192165        contentView = [eventWindow contentView];
    193166        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         }
    200167        if (view == nil) {
    201168            [self captureOneView];
     
    214181        [self _addElementToMenu: eventWindow];
    215182    NS_HANDLER
    216         [descriptionField setStringValue:
    217             [NSString stringWithFormat: @"Çan exception occurred: %@È", localException]];
     183        [self alertWithString:[NSString stringWithFormat: @"Çan exception occurred: %@È", localException]];
    218184    NS_ENDHANDLER
    219185    [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;
    221188    FSALog(@"%4u<stop capture [fell through to end]", capture);
    222189}
     
    224191- (IBAction)captureView:(id)sender
    225192{
    226     [statusField setStringValue: @"Click inside one of this applicationÕs windows to select."];
    227193    [selectedElement release]; selectedElement = nil;
    228     [self update: nil];
    229194    [self captureOneView];
    230195}
     
    234199    FSALog(@"element selected: %@", element);
    235200    NS_DURING
    236         [descriptionField setStringValue: [element description]];
    237201        [selectedElement release];
    238202        selectedElement = [element retain];
    239203        [[self window] orderFront: self];
    240204    NS_HANDLER
    241         [descriptionField setStringValue:
    242             [NSString stringWithFormat: @"Çan exception occurred: %@È", localException]];
     205        [self alertWithString:[NSString stringWithFormat: @"Çan exception occurred: %@È", localException]];
    243206    NS_ENDHANDLER
    244207    [viewHierarchyMenu release]; viewHierarchyMenu = nil;
     
    248211{
    249212    [self setSelectedElement: [sender representedObject]];
    250     [self captureOneView];
     213    [system browse: selectedElement];
     214//    [self captureOneView];
    251215}
    252216
     
    259223}
    260224
    261 - (void)controlTextDidChange:(NSNotification *)notification;
    262 {
    263     [self update: nil];
    264 }
    265 
    266 - (IBAction)defineVariable:(id)sender;
    267 {
    268     NS_DURING
    269         NSString *variableName = [variableNameField stringValue];
    270         [statusField setStringValue: @"AssociatingÉ"];
    271         [interpreter setObject: selectedElement forIdentifier: variableName];
    272         [statusField setStringValue: [NSString stringWithFormat: @"Assigned variable Ò%@Ó", variableName]];
    273     NS_HANDLER
    274         [statusField setStringValue: [NSString stringWithFormat: @"Assocation failed: %@", localException]];
    275     NS_ENDHANDLER
    276 }
    277 
    278225- (IBAction)viewInObjectBrowser:(id)sender;
    279226{
    280227    FSALog(@"system: %@", system);
    281228    [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];
    283238}
    284239
  • trunk/Cocoa/F-Script Anywhere/Source/FSAnywhere.h

    r217 r224  
    88 */
    99
    10 #define FSA_VERSION "1.2b1"
    11 #define FSA_FSCRIPT_MIN_VERSION 0x1252001 /* 1.2.5d1 */
     10#define FSA_VERSION "1.3"
     11#define FSA_FSCRIPT_MIN_VERSION 0x1318000 /* 1.3.1 */
    1212#undef FSA_DEBUG
    1313
  • trunk/Cocoa/F-Script Anywhere/Source/FSAnywhere.m

    r217 r224  
    1111
    1212NSString * FSA_FScriptURL = @"http://www.fscript.org/";
    13 NSString * FSA_FScriptMinimumVersion = @"1.3.0";
     13NSString * FSA_FScriptMinimumVersion = @"1.3.1";
Note: See TracChangeset for help on using the changeset viewer.