Changeset 1570

Show
Ignore:
Timestamp:
09/06/04 19:49:17 (4 years ago)
Author:
morris
Message:

rename stats handling method

Files:

Legend:

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

    r1383 r1570  
    1 /* $Id: WCApplication.h,v 1.2 2004/07/28 08:00:26 morris Exp $ */ 
     1/* $Id: WCApplication.h,v 1.3 2004/09/06 17:49:17 morris Exp $ */ 
    22 
    33/* 
     
    2929@interface WCApplication : NSApplication 
    3030 
    31 #define WCApplicationDidChangeStatus            @"WCApplicationDidChangeStatus" 
     31@end 
     32 
     33 
     34@interface NSObject(WCApplicationDelegate) 
     35 
     36- (void)                                                                applicationShouldDisplayStats:(id)sender; 
    3237 
    3338@end 
  • WiredClient/trunk/WCApplication.m

    r1535 r1570  
    1 /* $Id: WCApplication.m,v 1.2 2004/08/27 17:31:05 morris Exp $ */ 
     1/* $Id: WCApplication.m,v 1.3 2004/09/06 17:49:17 morris Exp $ */ 
    22 
    33/* 
     
    3333 
    3434- (void)sendEvent:(NSEvent *)event { 
    35         // --- check for ctrl-F12 
    36         if([event type] == NSKeyDown && [[event characters] length] > 0 && 
    37            [[event characters] characterAtIndex:0] == NSF12FunctionKey && 
    38            [event modifierFlags] & NSControlKeyMask) 
    39                 [WCSharedMain handleStatsKey]; 
    40         else 
     35        BOOL    handled = NO; 
     36         
     37        if([event type] == NSKeyDown && [[event characters] length] > 0) { 
     38                unichar         key; 
     39                 
     40                key = [[event characters] characterAtIndex:0]; 
     41                 
     42                if(key == NSF12FunctionKey && [event modifierFlags] & NSControlKeyMask) { 
     43                        if([[self delegate] respondsToSelector:@selector(applicationShouldDisplayStats:)]) { 
     44                                [[self delegate] applicationShouldDisplayStats:self]; 
     45                                 
     46                                handled = YES; 
     47                        } 
     48                } 
     49        } 
     50 
     51        if(!handled) 
    4152                [super sendEvent:event]; 
    4253}