Startmenu

Robert Shearman rob at codeweavers.com
Tue Oct 19 13:36:22 CDT 2004


Thorsten Kani wrote:

> ...now with screenshots included.
>
>> Hi,
>> I took a look at the Startmenu. It does its job except for the 
>> following minor problems:
>>
>> -Keyboard input is completely ignored
>> -Icon Backgrounds are white instead of grey
>> -All the Icons were drawn a few pixels below where they belong, wich 
>> makes them a bit overdrawn by the Icon below.
>> -The Strings above the seperator were drawn next to the* *_left_ 
>> border wich makes them partially overdrawn by the Buttons Icon.
>>

Thanks. Could you try the attached patch which should fix the white 
background issue?
Also, could you try setting both OFFSET_X and OFFSET_Y to 0 in 
wine/dlls/comctl32/toolbar.c
The strings being in the wrong position is a bigger issue. If you are 
interested, the problem is that we recalculate and redraw our toolbar 
control too much so that the code to create the Start Menu expects that 
it won't be refreshed until it has finished setting the various 
properties of the toolbar. I have some unfinished work in the toolbar 
control at the moment, but I plan to use controlspy to see which 
messages should cause a redraw and which shouldn't.

Rob
-------------- next part --------------
Index: wine/dlls/comctl32/toolbar.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/toolbar.c,v
retrieving revision 1.195
diff -u -p -r1.195 toolbar.c
--- wine/dlls/comctl32/toolbar.c	18 Oct 2004 19:39:22 -0000	1.195
+++ wine/dlls/comctl32/toolbar.c	19 Oct 2004 16:17:42 -0000
@@ -707,7 +707,7 @@ TOOLBAR_DrawImage(TOOLBAR_INFO *infoPtr,
     BOOL draw_masked = FALSE;
     INT index;
     INT offset = 0;
-    UINT draw_flags = ILD_NORMAL;
+    UINT draw_flags = ILD_TRANSPARENT;
 
     if (tbcd->nmcd.uItemState & (CDIS_DISABLED | CDIS_INDETERMINATE))
     {
@@ -5370,7 +5434,6 @@ TOOLBAR_Create (HWND hwnd, WPARAM wParam
     infoPtr->nOldHit = -1;
     infoPtr->nHotItem = -1;
     infoPtr->hwndNotify = ((LPCREATESTRUCTW)lParam)->hwndParent;
-    infoPtr->bUnicode = IsWindowUnicode (infoPtr->hwndNotify);
     infoPtr->bBtnTranspnt = (dwStyle & (TBSTYLE_FLAT | TBSTYLE_LIST));
     infoPtr->dwDTFlags = (dwStyle & TBSTYLE_LIST) ? DT_LEFT | DT_VCENTER | DT_SINGLELINE | DT_END_ELLIPSIS: DT_CENTER | DT_END_ELLIPSIS;
     infoPtr->bAnchor = FALSE; /* no anchor highlighting */
@@ -5388,7 +5451,8 @@ TOOLBAR_Create (HWND hwnd, WPARAM wParam
     infoPtr->dwStyle = dwStyle;
     infoPtr->tbim.iButton = -1;
     GetClientRect(hwnd, &infoPtr->client_rect);
-    TOOLBAR_NotifyFormat(infoPtr, (WPARAM)hwnd, (LPARAM)NF_REQUERY);
+    infoPtr->bUnicode = infoPtr->hwndNotify && 
+        (NFR_UNICODE == SendMessageW(hwnd, WM_NOTIFYFORMAT, (WPARAM)hwnd, (LPARAM)NF_REQUERY));
 
     SystemParametersInfoA (SPI_GETICONTITLELOGFONT, 0, &logFont, 0);
     infoPtr->hFont = infoPtr->hDefaultFont = CreateFontIndirectA (&logFont);
@@ -6385,25 +6434,24 @@ TOOLBAR_NotifyFormatFake(HWND hwnd, WPAR
 static LRESULT
 TOOLBAR_NotifyFormat(TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
 {
-    INT i;
+    LRESULT format;
 
     TRACE("wParam = 0x%x, lParam = 0x%08lx\n", wParam, lParam);
 
-    if ((lParam == NF_QUERY) && ((HWND)wParam == infoPtr->hwndToolTip))
+    if (lParam == NF_QUERY)
         return NFR_UNICODE;
 
     if (lParam == NF_REQUERY) {
-	i = SendMessageW(infoPtr->hwndNotify,
+	format = SendMessageW(infoPtr->hwndNotify,
 			 WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwndSelf, NF_QUERY);
-	if ((i < NFR_ANSI) || (i > NFR_UNICODE)) {
-	    ERR("wrong response to WM_NOTIFYFORMAT (%d), assuming ANSI\n",
-		i);
-	    i = NFR_ANSI;
+	if ((format != NFR_ANSI) && (format != NFR_UNICODE)) {
+	    ERR("wrong response to WM_NOTIFYFORMAT (%ld), assuming ANSI\n",
+		format);
+	    format = NFR_ANSI;
 	}
-	infoPtr->bNtfUnicode = (i == NFR_UNICODE) ? 1 : 0;
-	return (LRESULT)i;
+	return format;
     }
-    return (LRESULT)((infoPtr->bUnicode) ? NFR_UNICODE : NFR_ANSI);
+    return 0;
 }
 
 


More information about the wine-devel mailing list