Add Escape keypress in functionlist searchbox clears its text
Fix #8667, close #8789
This commit is contained in:
parent
4ca25503bc
commit
5bcbd9e5ab
|
@ -680,6 +680,23 @@ static LRESULT CALLBACK funclstToolbarProc(HWND hwnd, UINT message, WPARAM wPara
|
|||
return oldFunclstToolbarProc(hwnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
static WNDPROC oldFunclstSearchEditProc = NULL;
|
||||
static LRESULT CALLBACK funclstSearchEditProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_KEYDOWN:
|
||||
{
|
||||
if (wParam == VK_ESCAPE)
|
||||
{
|
||||
::SendMessage(hwnd, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(TEXT("")));
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return oldFunclstSearchEditProc(hwnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
bool FunctionListPanel::shouldSort()
|
||||
{
|
||||
TBBUTTONINFO tbbuttonInfo;
|
||||
|
@ -787,6 +804,8 @@ INT_PTR CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPA
|
|||
2, 2, editWidth, editHeight,
|
||||
_hToolbarMenu, reinterpret_cast<HMENU>(IDC_SEARCHFIELD_FUNCLIST), _hInst, 0 );
|
||||
|
||||
oldFunclstSearchEditProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSearchEdit, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(funclstSearchEditProc)));
|
||||
|
||||
HFONT hf = (HFONT)::GetStockObject(DEFAULT_GUI_FONT);
|
||||
if (hf)
|
||||
::SendMessage(_hSearchEdit, WM_SETFONT, reinterpret_cast<WPARAM>(hf), MAKELPARAM(TRUE, 0));
|
||||
|
|
Loading…
Reference in New Issue