Skip to content

Commit

Permalink
Make metapath's "File Filter" dialog resizable.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Nov 4, 2018
1 parent 2b6d835 commit 2bc0126
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
21 changes: 21 additions & 0 deletions metapath/src/Dialogs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,7 @@ extern int nIdFocus;

extern WCHAR tchFilter[128];
extern BOOL bNegFilter;
extern int cxFileFilterDlg;

INT_PTR OptionsPropSheet(HWND hwnd, HINSTANCE hInstance) {
PROPSHEETHEADER psh;
Expand Down Expand Up @@ -1109,6 +1110,7 @@ INT_PTR CALLBACK GetFilterDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lP

switch (umsg) {
case WM_INITDIALOG: {
ResizeDlg_InitX(hwnd, cxFileFilterDlg, IDC_RESIZEGRIP3);
MakeBitmapButton(hwnd, IDC_BROWSEFILTER, NULL, OBM_COMBO);

SendDlgItemMessage(hwnd, IDC_FILTER, EM_LIMITTEXT, COUNTOF(tchFilter) - 1, 0);
Expand All @@ -1121,9 +1123,28 @@ INT_PTR CALLBACK GetFilterDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lP
return TRUE;

case WM_DESTROY:
ResizeDlg_Destroy(hwnd, &cxFileFilterDlg, NULL);
DeleteBitmapButton(hwnd, IDC_BROWSEFILTER);
return FALSE;

case WM_SIZE: {
int dx;

ResizeDlg_Size(hwnd, lParam, &dx, NULL);
HDWP hdwp = BeginDeferWindowPos(5);
hdwp = DeferCtlPos(hdwp, hwnd, IDC_RESIZEGRIP3, dx, 0, SWP_NOSIZE);
hdwp = DeferCtlPos(hdwp, hwnd, IDOK, dx, 0, SWP_NOSIZE);
hdwp = DeferCtlPos(hdwp, hwnd, IDCANCEL, dx, 0, SWP_NOSIZE);
hdwp = DeferCtlPos(hdwp, hwnd, IDC_BROWSEFILTER, dx, 0, SWP_NOSIZE);
hdwp = DeferCtlPos(hdwp, hwnd, IDC_FILTER, dx, 0, SWP_NOMOVE);
EndDeferWindowPos(hdwp);
}
return TRUE;

case WM_GETMINMAXINFO:
ResizeDlg_GetMinMaxInfo(hwnd, lParam);
return TRUE;

case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_BROWSEFILTER: {
Expand Down
3 changes: 3 additions & 0 deletions metapath/src/metapath.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ static BOOL bShowStatusbar;
static BOOL bShowDriveBox;
int cxRunDlg;
int cxGotoDlg;
int cxFileFilterDlg;
int cxOpenWithDlg;
int cyOpenWithDlg;
int cxCopyMoveDlg;
Expand Down Expand Up @@ -2468,6 +2469,7 @@ void LoadSettings(void) {

cxRunDlg = IniSectionGetInt(pIniSection, L"RunDlgSizeX", 0);
cxGotoDlg = IniSectionGetInt(pIniSection, L"GotoDlgSizeX", 0);
cxFileFilterDlg = IniSectionGetInt(pIniSection, L"FileFilterDlgX", 0);
cxOpenWithDlg = IniSectionGetInt(pIniSection, L"OpenWithDlgSizeX", 0);
cyOpenWithDlg = IniSectionGetInt(pIniSection, L"OpenWithDlgSizeY", 0);
cxCopyMoveDlg = IniSectionGetInt(pIniSection, L"CopyMoveDlgSizeX", 0);
Expand Down Expand Up @@ -2596,6 +2598,7 @@ void SaveSettings(BOOL bSaveSettingsNow) {
IniSectionSetBoolEx(pIniSection, L"ShowDriveBox", bShowDriveBox, 1);
IniSectionSetInt(pIniSection, L"RunDlgSizeX", cxRunDlg);
IniSectionSetInt(pIniSection, L"GotoDlgSizeX", cxGotoDlg);
IniSectionSetInt(pIniSection, L"FileFilterDlgX", cxFileFilterDlg);
IniSectionSetInt(pIniSection, L"OpenWithDlgSizeX", cxOpenWithDlg);
IniSectionSetInt(pIniSection, L"OpenWithDlgSizeY", cyOpenWithDlg);
IniSectionSetInt(pIniSection, L"CopyMoveDlgSizeX", cxCopyMoveDlg);
Expand Down
13 changes: 7 additions & 6 deletions metapath/src/metapath.rc
Original file line number Diff line number Diff line change
Expand Up @@ -290,20 +290,21 @@ BEGIN
SCROLLBAR IDC_RESIZEGRIP,7,70,10,10
END

IDD_FILTER DIALOGEX 0, 0, 184, 79
IDD_FILTER DIALOGEX 0, 0, 204, 79
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
WS_SYSMENU
CAPTION "File Filter"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LTEXT "Specify a new file &filter. Separate multiple filters by ;",
IDC_STATIC,7,7,170,8
EDITTEXT IDC_FILTER,7,22,151,14,ES_AUTOHSCROLL
PUSHBUTTON "",IDC_BROWSEFILTER,163,22,14,14
IDC_STATIC,7,7,190,8
EDITTEXT IDC_FILTER,7,22,171,14,ES_AUTOHSCROLL
PUSHBUTTON "",IDC_BROWSEFILTER,183,22,14,14
CONTROL "&Exclude files matching the filter.",IDC_NEGFILTER,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,40,170,10
DEFPUSHBUTTON "OK",IDOK,71,58,50,14
PUSHBUTTON "Cancel",IDCANCEL,127,58,50,14
DEFPUSHBUTTON "OK",IDOK,91,58,50,14
PUSHBUTTON "Cancel",IDCANCEL,147,58,50,14
SCROLLBAR IDC_RESIZEGRIP3,7,58,10,10
END

IDD_RENAME DIALOGEX 0, 0, 172, 74
Expand Down

0 comments on commit 2bc0126

Please sign in to comment.