Skip to content

Commit bad149e

Browse files
committed
0.8.0.32: Implemented escape to close custom file picker, altered window size and field positioning for better bottom margin
1 parent 286e79c commit bad149e

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

src/sqlite-ce-edit/filepicker.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,11 @@ static LRESULT CALLBACK PickerListProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
224224
OnItemActivate();
225225
return 0;
226226
}
227+
if (wParam == VK_ESCAPE) {
228+
g_pickerOK = 0;
229+
PostMessage(g_hwndPicker, WM_CLOSE, 0, 0);
230+
return 0;
231+
}
227232
if (wParam == VK_BACK) {
228233
/* Backspace goes up one directory */
229234
if (lstrcmpW(g_pickerDir, L"\\") != 0) {
@@ -317,6 +322,13 @@ static LRESULT CALLBACK PickerWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
317322
}
318323
break;
319324
}
325+
case WM_KEYDOWN:
326+
if (wParam == VK_ESCAPE) {
327+
g_pickerOK = 0;
328+
PostMessage(hwnd, WM_CLOSE, 0, 0);
329+
return 0;
330+
}
331+
break;
320332
case WM_CLOSE:
321333
DestroyWindow(hwnd);
322334
return 0;
@@ -397,15 +409,15 @@ int CustomFilePicker(HWND hwndOwner, wchar_t *filePath, int maxPath,
397409
/* Filename edit */
398410
g_hwndFilename = CreateWindowW(L"EDIT", g_pickerResult,
399411
WS_CHILD | WS_VISIBLE | WS_BORDER | ES_AUTOHSCROLL,
400-
10, 118, dlgW - 20, 22, g_hwndPicker, (HMENU)102, g_hInst, NULL);
412+
10, 110, dlgW - 20, 22, g_hwndPicker, (HMENU)102, g_hInst, NULL);
401413

402414
/* Buttons */
403415
CreateWindowW(L"BUTTON", saveMode ? L"Save" : L"Open",
404416
WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON,
405-
dlgW - 160, 144, 70, 24, g_hwndPicker, (HMENU)IDOK, g_hInst, NULL);
417+
dlgW - 160, 140, 70, 22, g_hwndPicker, (HMENU)IDOK, g_hInst, NULL);
406418
CreateWindowW(L"BUTTON", L"Cancel",
407419
WS_CHILD | WS_VISIBLE,
408-
dlgW - 80, 144, 70, 24, g_hwndPicker, (HMENU)IDCANCEL, g_hInst, NULL);
420+
dlgW - 80, 140, 70, 22, g_hwndPicker, (HMENU)IDCANCEL, g_hInst, NULL);
409421

410422
/* Populate list */
411423
PopulateFileList();

src/sqlite-ce-edit/globals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ BOOL WINAPI GetSaveFileNameW(CE_OPENFILENAME*);
8282
** Version
8383
**============================================================================*/
8484

85-
#define SQLITECEDIT_VERSION L"0.8.0.29"
85+
#define SQLITECEDIT_VERSION L"0.8.0.32"
8686

8787
/*============================================================================
8888
** Menu IDs

0 commit comments

Comments
 (0)