Commit 277c5139 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/treeview: Clean up winproc a bit, move parameter check to handlers.

parent 0506d3cd
...@@ -4879,11 +4879,14 @@ scroll: ...@@ -4879,11 +4879,14 @@ scroll:
} }
static LRESULT static LRESULT
TREEVIEW_MouseWheel(TREEVIEW_INFO *infoPtr, WPARAM wParam) TREEVIEW_MouseWheel(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{ {
short gcWheelDelta; short gcWheelDelta;
UINT pulScrollLines = 3; UINT pulScrollLines = 3;
if (wParam & (MK_SHIFT | MK_CONTROL))
return DefWindowProcW(infoPtr->hwnd, WM_MOUSEWHEEL, wParam, lParam);
if (infoPtr->firstVisible == NULL) if (infoPtr->firstVisible == NULL)
return TRUE; return TRUE;
...@@ -5275,6 +5278,8 @@ TREEVIEW_MouseMove (TREEVIEW_INFO * infoPtr, LPARAM lParam) ...@@ -5275,6 +5278,8 @@ TREEVIEW_MouseMove (TREEVIEW_INFO * infoPtr, LPARAM lParam)
TRACKMOUSEEVENT trackinfo; TRACKMOUSEEVENT trackinfo;
TREEVIEW_ITEM * item; TREEVIEW_ITEM * item;
if (!(infoPtr->dwStyle & TVS_TRACKSELECT)) return 0;
/* fill in the TRACKMOUSEEVENT struct */ /* fill in the TRACKMOUSEEVENT struct */
trackinfo.cbSize = sizeof(TRACKMOUSEEVENT); trackinfo.cbSize = sizeof(TRACKMOUSEEVENT);
trackinfo.dwFlags = TME_QUERY; trackinfo.dwFlags = TME_QUERY;
...@@ -5314,7 +5319,7 @@ TREEVIEW_MouseMove (TREEVIEW_INFO * infoPtr, LPARAM lParam) ...@@ -5314,7 +5319,7 @@ TREEVIEW_MouseMove (TREEVIEW_INFO * infoPtr, LPARAM lParam)
} }
/* Draw themed border */ /* Draw themed border */
static BOOL nc_paint (const TREEVIEW_INFO *infoPtr, HRGN region) static BOOL TREEVIEW_NCPaint (const TREEVIEW_INFO *infoPtr, HRGN region, LPARAM lParam)
{ {
HTHEME theme = GetWindowTheme (infoPtr->hwnd); HTHEME theme = GetWindowTheme (infoPtr->hwnd);
HDC dc; HDC dc;
...@@ -5323,7 +5328,8 @@ static BOOL nc_paint (const TREEVIEW_INFO *infoPtr, HRGN region) ...@@ -5323,7 +5328,8 @@ static BOOL nc_paint (const TREEVIEW_INFO *infoPtr, HRGN region)
int cxEdge = GetSystemMetrics (SM_CXEDGE), int cxEdge = GetSystemMetrics (SM_CXEDGE),
cyEdge = GetSystemMetrics (SM_CYEDGE); cyEdge = GetSystemMetrics (SM_CYEDGE);
if (!theme) return FALSE; if (!theme)
return DefWindowProcW (infoPtr->hwnd, WM_NCPAINT, (WPARAM)region, lParam);
GetWindowRect(infoPtr->hwnd, &r); GetWindowRect(infoPtr->hwnd, &r);
...@@ -5506,7 +5512,7 @@ TREEVIEW_KillFocus(const TREEVIEW_INFO *infoPtr) ...@@ -5506,7 +5512,7 @@ TREEVIEW_KillFocus(const TREEVIEW_INFO *infoPtr)
} }
/* update theme after a WM_THEMECHANGED message */ /* update theme after a WM_THEMECHANGED message */
static LRESULT theme_changed(const TREEVIEW_INFO *infoPtr) static LRESULT TREEVIEW_ThemeChanged(const TREEVIEW_INFO *infoPtr)
{ {
HTHEME theme = GetWindowTheme (infoPtr->hwnd); HTHEME theme = GetWindowTheme (infoPtr->hwnd);
CloseThemeData (theme); CloseThemeData (theme);
...@@ -5706,10 +5712,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -5706,10 +5712,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TREEVIEW_MouseLeave(infoPtr); return TREEVIEW_MouseLeave(infoPtr);
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
if (infoPtr->dwStyle & TVS_TRACKSELECT) return TREEVIEW_MouseMove(infoPtr, lParam);
return TREEVIEW_MouseMove(infoPtr, lParam);
else
return 0;
case WM_NCLBUTTONDOWN: case WM_NCLBUTTONDOWN:
if (infoPtr->hwndEdit) if (infoPtr->hwndEdit)
...@@ -5717,9 +5720,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -5717,9 +5720,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
goto def; goto def;
case WM_NCPAINT: case WM_NCPAINT:
if (nc_paint (infoPtr, (HRGN)wParam)) return TREEVIEW_NCPaint (infoPtr, (HRGN)wParam, lParam);
return 0;
goto def;
case WM_NOTIFY: case WM_NOTIFY:
return TREEVIEW_Notify(infoPtr, wParam, lParam); return TREEVIEW_Notify(infoPtr, wParam, lParam);
...@@ -5764,7 +5765,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -5764,7 +5765,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TREEVIEW_HandleTimer(infoPtr, wParam); return TREEVIEW_HandleTimer(infoPtr, wParam);
case WM_THEMECHANGED: case WM_THEMECHANGED:
return theme_changed (infoPtr); return TREEVIEW_ThemeChanged (infoPtr);
case WM_VSCROLL: case WM_VSCROLL:
return TREEVIEW_VScroll(infoPtr, wParam); return TREEVIEW_VScroll(infoPtr, wParam);
...@@ -5772,9 +5773,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -5772,9 +5773,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* WM_WININICHANGE */ /* WM_WININICHANGE */
case WM_MOUSEWHEEL: case WM_MOUSEWHEEL:
if (wParam & (MK_SHIFT | MK_CONTROL)) return TREEVIEW_MouseWheel(infoPtr, wParam, lParam);
goto def;
return TREEVIEW_MouseWheel(infoPtr, wParam);
case WM_DRAWITEM: case WM_DRAWITEM:
TRACE("drawItem\n"); TRACE("drawItem\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment