aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-01-05 21:43:19 +0000
committerBibiko <bibiko@eva.mpg.de>2010-01-05 21:43:19 +0000
commitfa2c56d4565a6278b188696e8572f9b0752ec455 (patch)
tree4336849595975eac5cd64199795a6f3dd09c6cbb /Source
parentb7d8b0664b71a17285ec2060e8a46dc4ff5eef77 (diff)
downloadsequelpro-fa2c56d4565a6278b188696e8572f9b0752ec455.tar.gz
sequelpro-fa2c56d4565a6278b188696e8572f9b0752ec455.tar.bz2
sequelpro-fa2c56d4565a6278b188696e8572f9b0752ec455.zip
• next step to improve the Query Favorites/History search field behaviour
- ↑ or ↓ selects now immediately the next/prev menu item [many thanks to Rowan!]
Diffstat (limited to 'Source')
-rw-r--r--Source/CustomQuery.m21
1 files changed, 20 insertions, 1 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index 2fec7d2f..c75172e0 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -3027,11 +3027,30 @@
if(commandSelector == @selector(moveDown:) || commandSelector == @selector(moveUp:)) {
[queryHistorySearchField abortEditing];
[queryFavoritesSearchField abortEditing];
+
+ // Send moveDown/Up to the popup menu
+ NSEvent *arrowEvent;
+ if(commandSelector == @selector(moveDown:))
+ arrowEvent = [NSEvent keyEventWithType:NSKeyDown location:NSMakePoint(0,0) modifierFlags:0 timestamp:0 windowNumber:[tableWindow windowNumber] context:[NSGraphicsContext currentContext] characters:nil charactersIgnoringModifiers:nil isARepeat:NO keyCode:0x7D];
+ else
+ arrowEvent = [NSEvent keyEventWithType:NSKeyDown location:NSMakePoint(0,0) modifierFlags:0 timestamp:0 windowNumber:[tableWindow windowNumber] context:[NSGraphicsContext currentContext] characters:nil charactersIgnoringModifiers:nil isARepeat:NO keyCode:0x7E];
+ [[NSApplication sharedApplication] postEvent:arrowEvent atStart:NO];
return YES;
+
}
}
return NO;
}
+// - (void)menu:(NSMenu *)menu willHighlightItem:(NSMenuItem *)item
+// {
+// // Set the focus at the search field
+// // TODO : but no way out; always selecting first/last menu item
+// // because after setting focus to search field NSMenu selectedItemIndex is -1
+// if(item == queryHistorySearchMenuItem) {
+// [queryHistorySearchField selectText:nil];
+// }
+//
+// }
/**
* Setup various interface controls.
@@ -3041,7 +3060,7 @@
// Set pre-defined menu tags
[queryFavoritesSaveAsMenuItem setTag:SP_SAVE_SELECTION_FAVORTITE_MENUITEM_TAG];
[queryFavoritesSaveAllMenuItem setTag:SP_SAVE_ALL_FAVORTITE_MENUITEM_TAG];
-
+
// Set the structure and index view's vertical gridlines if required
[customQueryView setGridStyleMask:([prefs boolForKey:SPDisplayTableViewVerticalGridlines]) ? NSTableViewSolidVerticalGridLineMask : NSTableViewGridNone];