Changeset 1413

Show
Ignore:
Timestamp:
08/03/04 21:28:27 (4 years ago)
Author:
morris
Message:

add configurable methods for delete and escape, like setEscapeAction, escapeAction

rename awkward protocols

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • WiredClient/trunk/WCChat.h

    r1411 r1413  
    1 /* $Id: WCChat.h,v 1.19 2004/08/02 20:36:40 morris Exp $ */ 
     1/* $Id: WCChat.h,v 1.20 2004/08/03 19:28:27 morris Exp $ */ 
    22 
    33/* 
     
    3939 
    4040@class WCConnection, WCSplitView, WCTextView, WCTableView; 
    41  
    42 @protocol WCTableViewMenuValidation; 
    4341 
    4442@interface WCChat : WCWindowController <WCGetInfoValidation> { 
  • WiredClient/trunk/WCFiles.h

    r1383 r1413  
    1 /* $Id: WCFiles.h,v 1.10 2004/07/28 08:00:26 morris Exp $ */ 
     1/* $Id: WCFiles.h,v 1.11 2004/08/03 19:28:27 morris Exp $ */ 
    22 
    33/* 
     
    2828 
    2929#import "WCWindowController.h" 
     30#import "WCTableView.h" 
    3031 
    3132@class WCConnection, WCFile, WCTableView; 
    3233 
    33 @protocol WCGetInfoValidation, WCTableViewOptionsSelection
     34@protocol WCGetInfoValidation
    3435 
    35 @interface WCFiles : WCWindowController <WCGetInfoValidation, WCTableViewOptionsSelection> { 
     36@interface WCFiles : WCWindowController <WCGetInfoValidation, WCTableViewSelectOptions> { 
    3637        IBOutlet WCTableView                    *_filesTableView; 
    3738        IBOutlet NSScrollView                   *_filesScrollView; 
  • WiredClient/trunk/WCMain.m

    r1382 r1413  
    1 /* $Id: WCMain.m,v 1.36 2004/07/27 19:07:00 morris Exp $ */ 
     1/* $Id: WCMain.m,v 1.37 2004/08/03 19:28:27 morris Exp $ */ 
    22 
    33/* 
     
    434434        // --- view menu 
    435435        else if(item == _viewOptionsMenuItem) 
    436                 return [controller conformsToProtocol:@protocol(WCTableViewOptionsSelection)]; 
     436                return [controller conformsToProtocol:@protocol(WCTableViewSelectOptions)]; 
    437437 
    438438        // --- files menu 
     
    914914        controller = [[NSApp keyWindow] windowController]; 
    915915         
    916         if([controller conformsToProtocol:@protocol(WCTableViewOptionsSelection)]) 
     916        if([controller conformsToProtocol:@protocol(WCTableViewSelectOptions)]) 
    917917                [(WCTableView *) [controller tableView] showViewOptions]; 
    918918} 
  • WiredClient/trunk/WCOutlineView.h

    r1346 r1413  
    1 /* $Id: WCOutlineView.h,v 1.3 2004/05/26 16:49:08 morris Exp $ */ 
     1/* $Id: WCOutlineView.h,v 1.4 2004/08/03 19:28:27 morris Exp $ */ 
    22 
    33/* 
     
    2727 */ 
    2828 
    29 @protocol WCOutlineViewInfoCopying 
     29@protocol WCOutlineViewCopyInfo 
    3030 
    3131- (void)                                        outlineViewShouldCopyInfo:(NSOutlineView *)sender; 
  • WiredClient/trunk/WCOutlineView.m

    r1346 r1413  
    1 /* $Id: WCOutlineView.m,v 1.3 2004/05/26 16:49:08 morris Exp $ */ 
     1/* $Id: WCOutlineView.m,v 1.4 2004/08/03 19:28:27 morris Exp $ */ 
    22 
    33/* 
     
    109109        NSTableColumn   *tableColumn; 
    110110         
    111         if([[self delegate] conformsToProtocol:@protocol(WCTableViewOptionsSelection)]) { 
     111        if([[self delegate] conformsToProtocol:@protocol(WCTableViewSelectOptions)]) { 
    112112                key = [NSString stringWithFormat:@"WCTableViewOptions %@ Columns", [self autosaveName]]; 
    113113                columns = [[NSUserDefaults standardUserDefaults] arrayForKey:key]; 
     
    131131        id                              view; 
    132132         
    133         if([[self delegate] conformsToProtocol:@protocol(WCTableViewOptionsSelection)]) { 
     133        if([[self delegate] conformsToProtocol:@protocol(WCTableViewSelectOptions)]) { 
    134134                enumerator = [[[[[self delegate] viewOptionsPanel] contentView] subviews] objectEnumerator]; 
    135135                 
  • WiredClient/trunk/WCSearch.h

    r1383 r1413  
    1 /* $Id: WCSearch.h,v 1.7 2004/07/28 08:00:26 morris Exp $ */ 
     1/* $Id: WCSearch.h,v 1.8 2004/08/03 19:28:27 morris Exp $ */ 
    22 
    33/* 
     
    2828 
    2929#import "WCWindowController.h" 
     30#import "WCTableView.h" 
    3031 
    3132@class WCTableView, WCConnection; 
    3233 
    33 @protocol WCGetInfoValidation, WCTableViewOptionsSelection
     34@protocol WCGetInfoValidatio
    3435 
    35 @interface WCSearch : WCWindowController <WCGetInfoValidation, WCTableViewOptionsSelection> { 
     36@interface WCSearch : WCWindowController <WCGetInfoValidation, WCTableViewSelectOptions> { 
    3637        IBOutlet WCTableView                            *_searchTableView; 
    3738         
  • WiredClient/trunk/WCTableView.h

    r1356 r1413  
    1 /* $Id: WCTableView.h,v 1.11 2004/06/01 20:52:11 morris Exp $ */ 
     1/* $Id: WCTableView.h,v 1.12 2004/08/03 19:28:27 morris Exp $ */ 
    22 
    33/* 
     
    3030 
    3131 
    32 @protocol WCTableViewInfoCopying 
     32@protocol WCTableViewCopyInfo 
    3333 
    3434- (void)                                        tableViewShouldCopyInfo:(NSTableView *)sender; 
     
    3737 
    3838 
    39 @protocol WCTableViewTypingAhead 
     39@protocol WCTableViewTypeAhead 
    4040 
    4141- (NSString *)                          tableView:(NSTableView *)tableView stringValueForRow:(int)row; 
     
    4444 
    4545 
    46 @protocol WCTableViewToolTipDisplaying 
     46@protocol WCTableViewDisplayToolTip 
    4747 
    4848- (NSString *)                          tableView:(NSTableView *)tableView toolTipForRow:(int)row; 
     
    5151 
    5252 
    53 @protocol WCTableViewOptionsSelection 
     53@protocol WCTableViewSelectOptions 
    5454 
    5555- (NSPanel *)                           viewOptionsPanel; 
     
    6363        NSMutableString                 *_typeAheadString; 
    6464        NSCharacterSet                  *_typeAheadCharacterSet; 
    65         BOOL                                    _typeAhead; 
    6665 
    6766        NSMutableArray                  *_allTableColumns; 
    6867 
    6968        NSMutableDictionary             *_regions; 
     69         
     70        SEL                                             _escapeAction; 
     71        SEL                                             _deleteAction; 
    7072} 
    7173 
     
    7375- (void)                                        showViewOptions; 
    7476 
     77- (void)                                        setEscapeAction:(SEL)action; 
     78- (SEL)                                         escapeAction; 
     79 
     80- (void)                                        setDeleteAction:(SEL)action; 
     81- (SEL)                                         deleteAction; 
     82 
    7583@end 
  • WiredClient/trunk/WCTableView.m

    r1356 r1413  
    1 /* $Id: WCTableView.m,v 1.12 2004/06/01 20:52:11 morris Exp $ */ 
     1/* $Id: WCTableView.m,v 1.13 2004/08/03 19:28:27 morris Exp $ */ 
    22 
    33/* 
     
    9999 
    100100- (void)keyDown:(NSEvent *)event { 
    101         unichar         key; 
     101        unichar                 key; 
     102        unsigned int    flags; 
    102103         
    103104        // --- get key 
    104         key = [[event characters] characterAtIndex:0]; 
     105        key = [[event charactersIgnoringModifiers] characterAtIndex:0]; 
     106        flags = [event modifierFlags]; 
    105107 
    106108        // --- double-click on enter/return 
    107         if(key == NSEnterCharacter || key == NSCarriageReturnCharacter) 
    108                 [super doCommandBySelector:[super doubleAction]]; 
     109        if(key == NSEnterCharacter || key == NSCarriageReturnCharacter) { 
     110                if([self doubleAction]) 
     111                        [self doCommandBySelector:[self doubleAction]]; 
     112        } 
     113        // --- delete 
     114        else if(key == NSDeleteFunctionKey) { 
     115                if([self deleteAction]) 
     116                        [self doCommandBySelector:[self deleteAction]]; 
     117        } 
     118        // --- enter type-ahead find 
    109119        else if([[self dataSource] respondsToSelector:@selector(tableView:stringValueForRow:)] && 
    110                         [_typeAheadCharacterSet characterIsMember:key]) 
     120                        [_typeAheadCharacterSet characterIsMember:key]) { 
    111121                [self interpretKeyEvents:[NSArray arrayWithObject:event]]; 
    112         else 
     122        } 
     123        // --- pass down 
     124        else { 
    113125                [super keyDown:event]; 
     126        } 
    114127} 
    115128 
     
    172185 
    173186 
     187- (void)cancelOperation:(id)sender { 
     188        if([self escapeAction]) 
     189                [self doCommandBySelector:[self escapeAction]]; 
     190} 
     191 
     192 
     193 
    174194#pragma mark - 
    175195 
     
    180200        NSTableColumn   *tableColumn; 
    181201         
    182         if([[self delegate] conformsToProtocol:@protocol(WCTableViewOptionsSelection)]) { 
     202        if([[self delegate] conformsToProtocol:@protocol(WCTableViewSelectOptions)]) { 
    183203                key = [NSString stringWithFormat:@"WCTableViewOptions %@ Columns", [self autosaveName]]; 
    184204                columns = [[NSUserDefaults standardUserDefaults] arrayForKey:key]; 
     
    205225        id                              view; 
    206226         
    207         if([[self delegate] conformsToProtocol:@protocol(WCTableViewOptionsSelection)]) { 
     227        if([[self delegate] conformsToProtocol:@protocol(WCTableViewSelectOptions)]) { 
    208228                enumerator = [[[[[self delegate] viewOptionsPanel] contentView] subviews] objectEnumerator]; 
    209229                 
     
    277297} 
    278298 
     299#pragma mark - 
     300 
     301- (void)setEscapeAction:(SEL)action { 
     302        _escapeAction = action; 
     303} 
     304 
     305 
     306 
     307- (SEL)escapeAction { 
     308        return _escapeAction; 
     309} 
     310 
     311 
     312 
     313#pragma mark - 
     314 
     315- (void)setDeleteAction:(SEL)action { 
     316        _deleteAction = action; 
     317} 
     318 
     319 
     320 
     321- (SEL)deleteAction { 
     322        return _deleteAction; 
     323} 
     324 
    279325 
    280326 
  • WiredClient/trunk/WCTrackers.h

    r1383 r1413  
    1 /* $Id: WCTrackers.h,v 1.10 2004/07/28 08:00:26 morris Exp $ */ 
     1/* $Id: WCTrackers.h,v 1.11 2004/08/03 19:28:27 morris Exp $ */ 
    22 
    33/* 
     
    2828 
    2929#import "WCWindowController.h" 
     30#import "WCTableView.h" 
    3031 
    3132@class WCOutlineView, WCTracker; 
    3233 
    33 @protocol WCTableViewOptionsSelection; 
    34  
    35 @interface WCTrackers : WCWindowController <WCTableViewOptionsSelection> { 
     34@interface WCTrackers : WCWindowController <WCTableViewSelectOptions> { 
    3635        IBOutlet NSTextField                                    *_statusTextField; 
    3736