|
50 | 50 |
|
51 | 51 | static HWND s_hDlg = NULL; // The HWND to the dialog
|
52 | 52 | static HWND s_hList = NULL; // The HWND to the listbox
|
| 53 | +static HWND s_hFilter = NULL; // The HWND to the filter editbox |
53 | 54 | static HWND s_hCombo = NULL; // The HWND to the combo
|
54 | 55 | static WNDPROC s_hListboxProcOld = NULL; // The HWND to the original procedure of the listbox
|
55 | 56 | static HICON s_hTabIcon = NULL; // The icon on the docking tab
|
56 | 57 | static HBRUSH s_hbrBkgnd = NULL; // The brush to paint the theme on the background of the listbox
|
57 | 58 | static int s_iHeightCombo = 20; // This info should come from Windows
|
| 59 | +static int s_iHeightFilter = 20; // This info should come from Windows |
58 | 60 | static bool s_bConsoleInitialized = false; // Is the console initialized?
|
59 | 61 | static bool s_bConsoleVisible = false; // Is the console visible?
|
60 | 62 | static Library* s_curLibrary = NULL; // The currently selected lib
|
@@ -462,8 +464,17 @@ static void IndentSnippet(int firstLine, int lastLine)
|
462 | 464 | static void OnSize(HWND hWnd, int iWidth, int iHeight)
|
463 | 465 | {
|
464 | 466 | UNREFERENCED_PARAMETER(hWnd);
|
465 |
| - SetWindowPos(s_hList, 0, 0, s_iHeightCombo + SPACER, iWidth, iHeight - s_iHeightCombo - SPACER, SWP_NOACTIVATE | SWP_NOZORDER); |
| 467 | + |
| 468 | + // Position the languages combobox |
466 | 469 | SetWindowPos(s_hCombo, 0, 0, 0, iWidth, s_iHeightCombo, SWP_NOACTIVATE | SWP_NOZORDER);
|
| 470 | + |
| 471 | + // Position the filter editbox |
| 472 | + const int iFilterX = s_iHeightCombo + SPACER; |
| 473 | + SetWindowPos(s_hFilter, 0, 0, iFilterX, iWidth, s_iHeightFilter, SWP_NOACTIVATE | SWP_NOZORDER); |
| 474 | + |
| 475 | + // Position the list of snippets |
| 476 | + const int iListX = iFilterX + s_iHeightFilter + SPACER; |
| 477 | + SetWindowPos(s_hList, 0, 0, iListX, iWidth, iHeight - iListX, SWP_NOACTIVATE | SWP_NOZORDER); |
467 | 478 | }
|
468 | 479 |
|
469 | 480 | /////////////////////////////////////////////////////////////////////////////
|
@@ -1160,12 +1171,17 @@ static BOOL OnInitDialog(HWND hWnd)
|
1160 | 1171 | // Store the DlgItems
|
1161 | 1172 | s_hList = GetDlgItem(hWnd, IDC_LIST);
|
1162 | 1173 | s_hCombo = GetDlgItem(hWnd, IDC_NAME);
|
| 1174 | + s_hFilter = GetDlgItem(hWnd, IDC_FILTER); |
1163 | 1175 |
|
1164 |
| - // Get the height of the combobox |
| 1176 | + // Get the height of the languages combobox |
1165 | 1177 | RECT rc;
|
1166 | 1178 | GetWindowRect(s_hCombo, &rc);
|
1167 | 1179 | s_iHeightCombo = rc.bottom - rc.top;
|
1168 | 1180 |
|
| 1181 | + // Get the height of the filter editbox |
| 1182 | + GetWindowRect(s_hFilter, &rc); |
| 1183 | + s_iHeightFilter = rc.bottom - rc.top; |
| 1184 | + |
1169 | 1185 | // Use our own ListboxProc to intercept the ENTER-key
|
1170 | 1186 | s_hListboxProcOld = (WNDPROC)SetWindowLongPtr(s_hList, GWLP_WNDPROC, (LONG_PTR)ListboxProc);
|
1171 | 1187 |
|
|
0 commit comments