Skip to content

Commit d51ee31

Browse files
committed
0.10.0.31: Schema Explorer grid edit mode selector can now be triggered by enter/up/down when viewing a table
1 parent dadd787 commit d51ee31

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/sqlite-ce-edit/globals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ BOOL WINAPI GetSaveFileNameW(CE_OPENFILENAME*);
8787
** Version
8888
**============================================================================*/
8989

90-
#define SQLITECEDIT_VERSION L"0.10.0.27"
90+
#define SQLITECEDIT_VERSION L"0.10.0.31"
9191

9292
/*============================================================================
9393
** Menu IDs

src/sqlite-ce-edit/grid.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,14 @@ LRESULT CALLBACK GridProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
108108
return 0;
109109
if (msg == WM_KEYDOWN) {
110110
int ctrl = GetKeyState(VK_CONTROL) < 0;
111+
int sel = ListView_GetNextItem(g_hwndGrid, -1, LVNI_SELECTED);
112+
113+
/* Arrow/Enter with no selection - select first row and focus */
114+
if (sel < 0 && (wParam == VK_UP || wParam == VK_DOWN || wParam == VK_RETURN)) {
115+
ListView_SetItemState(g_hwndGrid, 0, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
116+
SetFocus(g_hwndGrid);
117+
return 0;
118+
}
111119

112120
/* Ctrl+C - Copy selected row */
113121
if (ctrl && wParam == 'C') {

0 commit comments

Comments
 (0)