Mikołaj Zalewski : comctl32: toolbar: Add support for WM_SETFONT.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Nov 2 05:46:48 CST 2006


Module: wine
Branch: master
Commit: d57a61f831c964438090cbdbc3ee6bfc5fe01d1c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d57a61f831c964438090cbdbc3ee6bfc5fe01d1c

Author: Mikołaj Zalewski <mikolaj at zalewski.pl>
Date:   Wed Nov  1 22:41:50 2006 +0100

comctl32: toolbar: Add support for WM_SETFONT.

---

 dlls/comctl32/toolbar.c |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c
index 9b96f90..1a6f603 100644
--- a/dlls/comctl32/toolbar.c
+++ b/dlls/comctl32/toolbar.c
@@ -5425,8 +5425,7 @@ TOOLBAR_Destroy (HWND hwnd, WPARAM wPara
 	TOOLBAR_DeleteImageList(&infoPtr->himlHot, &infoPtr->cimlHot);
 
     /* delete default font */
-    if (infoPtr->hFont)
-	DeleteObject (infoPtr->hDefaultFont);
+    DeleteObject (infoPtr->hDefaultFont);
         
     CloseThemeData (GetWindowTheme (hwnd));
 
@@ -6466,6 +6465,24 @@ TOOLBAR_SetFocus (HWND hwnd, WPARAM wPar
     return 0;
 }
 
+static LRESULT
+TOOLBAR_SetFont(HWND hwnd, WPARAM wParam, LPARAM lParam)
+{
+    TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd);
+    
+    TRACE("font=%p redraw=%ld\n", (HFONT)wParam, lParam);
+    
+    if (wParam == 0)
+        infoPtr->hFont = infoPtr->hDefaultFont;
+    else
+        infoPtr->hFont = (HFONT)wParam;
+
+    TOOLBAR_CalcToolbar(hwnd);
+
+    if (lParam)
+        InvalidateRect(hwnd, NULL, TRUE);
+    return 1;
+}
 
 static LRESULT
 TOOLBAR_SetRedraw (HWND hwnd, WPARAM wParam, LPARAM lParam)
@@ -6976,6 +6993,9 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg,
 	case WM_SETFOCUS:
 	    return TOOLBAR_SetFocus (hwnd, wParam);
 
+	case WM_SETFONT:
+            return TOOLBAR_SetFont(hwnd, wParam, lParam);
+
 	case WM_SETREDRAW:
 	    return TOOLBAR_SetRedraw (hwnd, wParam, lParam);
 




More information about the wine-cvs mailing list