Skip to content

Commit a766406

Browse files
committed
improve TreeViewWndProcDx
1 parent 3c8b654 commit a766406

File tree

1 file changed

+8
-22
lines changed

1 file changed

+8
-22
lines changed

src/RisohEditor.cpp

+8-22
Original file line numberDiff line numberDiff line change
@@ -14067,9 +14067,11 @@ TreeViewWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
1406714067
LRESULT CALLBACK
1406814068
MMainWnd::TreeViewWndProcDx(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
1406914069
{
14070+
LRESULT ret;
1407014071
switch (uMsg)
1407114072
{
14072-
case WM_HSCROLL:
14073+
case WM_SIZE: case WM_HSCROLL: case WM_VSCROLL:
14074+
case WM_MOUSEWHEEL: case WM_KEYDOWN: case WM_CHAR:
1407314075
if (IsWindow(m_arrow))
1407414076
{
1407514077
// hide language arrow
@@ -14081,38 +14083,22 @@ MMainWnd::TreeViewWndProcDx(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
1408114083
TreeView_GetItemRect(hwnd, hItem, &rc, FALSE);
1408214084

1408314085
// default processing
14084-
CallWindowProc(s_fnTreeViewOldWndProc, hwnd, uMsg, wParam, lParam);
14086+
ret = CallWindowProc(s_fnTreeViewOldWndProc, hwnd, uMsg, wParam, lParam);
1408514087

1408614088
// redraw the rect
1408714089
InvalidateRect(hwnd, &rc, TRUE);
1408814090

1408914091
// restore language arrow
1409014092
PostUpdateLangArrow(m_hwnd);
14091-
return 0;
14092-
}
14093-
break;
14094-
case WM_SIZE: case WM_VSCROLL: case WM_MOUSEWHEEL:
14095-
if (IsWindow(m_arrow))
14096-
{
14097-
// hide language arrow
14098-
ShowLangArrow(FALSE);
1409914093

14100-
// default processing
14101-
CallWindowProc(s_fnTreeViewOldWndProc, hwnd, uMsg, wParam, lParam);
14102-
14103-
// restore language arrow
14104-
PostUpdateLangArrow(m_hwnd);
14105-
return 0;
14094+
return ret;
1410614095
}
1410714096
break;
1410814097
case WM_SYSKEYDOWN:
14109-
if (wParam == VK_DOWN)
14098+
if (wParam == VK_DOWN && IsWindow(m_arrow))
1411014099
{
14111-
if (IsWindow(m_arrow))
14112-
{
14113-
m_arrow.ShowDropDownList(m_arrow, TRUE);
14114-
return 0;
14115-
}
14100+
m_arrow.ShowDropDownList(m_arrow, TRUE);
14101+
return 0;
1411614102
}
1411714103
break;
1411814104
}

0 commit comments

Comments
 (0)