Revision: 7493
http://skim-app.svn.sourceforge.net/skim-app/?rev=7493&view=rev
Author: hofman
Date: 2011-09-16 12:25:11 +0000 (Fri, 16 Sep 2011)
Log Message:
-----------
avoid code duplication
Modified Paths:
--------------
trunk/SKColorSwatch.m
Modified: trunk/SKColorSwatch.m
===================================================================
--- trunk/SKColorSwatch.m 2011-09-16 12:16:48 UTC (rev 7492)
+++ trunk/SKColorSwatch.m 2011-09-16 12:25:11 UTC (rev 7493)
@@ -253,18 +253,22 @@
[self setNeedsDisplay:YES];
}
-- (void)performClick:(id)sender {
- if ([self isEnabled] && focusedIndex != -1) {
- clickedIndex = focusedIndex;
+- (void)performClickAtIndex:(NSInteger)i {
+ if ([self isEnabled] && i != -1) {
+ clickedIndex = i;
[self sendAction:[self action] to:[self target]];
clickedIndex = -1;
- highlightedIndex = focusedIndex;
+ highlightedIndex = i;
[self setKeyboardFocusRingNeedsDisplayInRect:[self bounds]];
[self setNeedsDisplay:YES];
[self performSelector:@selector(unhighlight) withObject:nil
afterDelay:0.2];
}
}
+- (void)performClick:(id)sender {
+ [self performClickAtIndex:focusedIndex];
+}
+
- (void)moveRight:(NSEvent *)theEvent {
if (++focusedIndex >= (NSInteger)[colors count])
focusedIndex = [colors count] - 1;
@@ -517,16 +521,7 @@
}
- (void)pressFauxUIElement:(SKAccessibilityFauxUIElement *)element {
- NSInteger i = [element index];
- if ([self isEnabled] && i != -1) {
- clickedIndex = i;
- [self sendAction:[self action] to:[self target]];
- clickedIndex = -1;
- highlightedIndex = focusedIndex;
- [self setKeyboardFocusRingNeedsDisplayInRect:[self bounds]];
- [self setNeedsDisplay:YES];
- [self performSelector:@selector(unhighlight) withObject:nil
afterDelay:0.2];
- }
+ [self performClickAtIndex:[element index]];
}
@end
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit