Changeset 442
- Timestamp:
- 03/06/08 11:36:32 (17 years ago)
- Location:
- trunk/ICeCoffEE/ICeCoffEE
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ICeCoffEE/ICeCoffEE/ICeCoffEETrigger.h
r388 r442 19 19 + (BOOL)cancel; 20 20 21 + (NSRange)rangeForEvent:(NSEvent *)anEvent onTarget:(NSView <NSTextInput> *)aTarget; 22 21 23 - (void)timerFired:(NSTimer *)aTimer; // overridden by subclasses 22 24 -
trunk/ICeCoffEE/ICeCoffEE/ICeCoffEETrigger.m
r390 r442 15 15 @implementation ICeCoffEETrigger 16 16 17 + (NSRange)rangeForEvent:(NSEvent *)anEvent onTarget:(NSView<NSTextInput> *)aTarget; 18 { 19 unsigned characterIndex = [aTarget characterIndexForPoint: 20 [[aTarget window] convertBaseToScreen: [anEvent locationInWindow]]]; 21 NSRange range = [aTarget selectedRange]; 22 ICLog(@"ICeCoffEETrigger characterIndex %u selectedRange %@", characterIndex, NSStringFromRange(range)); 23 if (range.location == NSNotFound || range.length == 0 || 24 !NSLocationInRange(characterIndex, range)) { 25 range.location = characterIndex; 26 range.length = 0; 27 } 28 return range; 29 } 30 17 31 - (id)initForEvent:(NSEvent *)anEvent onTarget:(NSView<NSTextInput> *)aTarget; 18 32 { … … 20 34 target = [aTarget retain]; 21 35 event = [anEvent retain]; 22 unsigned characterIndex = [aTarget characterIndexForPoint: 23 [[aTarget window] convertBaseToScreen: [anEvent locationInWindow]]]; 24 range = [aTarget selectedRange]; 25 ICLog(@"ICeCoffEETrigger characterIndex %u selectedRange %@", characterIndex, NSStringFromRange(range)); 26 if (range.location == NSNotFound || range.length == 0 || 27 !NSLocationInRange(characterIndex, range)) { 28 range.location = characterIndex; 29 range.length = 0; 30 } 36 range = [[self class] rangeForEvent: anEvent onTarget: aTarget]; 31 37 // no typical definition of Command-Option-double-click, so we don't need to delay 32 38 NSTimeInterval interval = ([anEvent modifierFlags] & NSAlternateKeyMask) ? 0 :
Note:
See TracChangeset
for help on using the changeset viewer.