user: Multi-column menus

Michael Kaufmann hallo at michael-kaufmann.ch
Wed Aug 9 12:30:17 CDT 2006


Changelog:
  - Fix the keyboard navigation and some graphical glitches for 
multi-column menus
-------------- next part --------------
Index: dlls/user/menu.c
===================================================================
RCS file: /home/wine/wine/dlls/user/menu.c,v
retrieving revision 1.66
diff -u -r1.66 menu.c
--- dlls/user/menu.c	9 Aug 2006 15:38:47 -0000	1.66
+++ dlls/user/menu.c	9 Aug 2006 17:09:11 -0000
@@ -524,7 +524,7 @@
 	return i;
 
     for( ; i < menu->nItems; ++i ) {
-	if (menu->items[i].fType & MF_MENUBARBREAK)
+	if (menu->items[i].fType & (MF_MENUBREAK | MF_MENUBARBREAK))
 	    return i;
     }
 
@@ -554,14 +554,14 @@
     /* Find the start of the column */
 
     for(i = menu->FocusedItem; i != 0 &&
-	 !(menu->items[i].fType & MF_MENUBARBREAK);
+	 !(menu->items[i].fType & (MF_MENUBREAK | MF_MENUBARBREAK));
 	--i); /* empty */
 
     if(i == 0)
 	return NO_SELECTED_ITEM;
 
     for(--i; i != 0; --i) {
-	if (menu->items[i].fType & MF_MENUBARBREAK)
+	if (menu->items[i].fType & (MF_MENUBREAK | MF_MENUBARBREAK))
 	    break;
     }
 
@@ -1131,7 +1131,7 @@
     {
 	lpitem = &lppop->items[start];
 	orgX = maxX;
-        if( lpitem->fType & MF_MENUBREAK)
+        if( lpitem->fType & (MF_MENUBREAK | MF_MENUBARBREAK))
             orgX += MENU_COL_SPACE; 
 	orgY = MENU_TOP_MARGIN;
 
@@ -1143,8 +1143,6 @@
 		(lpitem->fType & (MF_MENUBREAK | MF_MENUBARBREAK))) break;
 
 	    MENU_CalcItemSize( hdc, lpitem, hwndOwner, orgX, orgY, FALSE, lppop );
-
-	    if (lpitem->fType & MF_MENUBARBREAK) orgX++;
 	    maxX = max( maxX, lpitem->rect.right );
 	    orgY = lpitem->rect.bottom;
 	    if (IS_STRING_ITEM(lpitem->fType) && lpitem->xTab)
@@ -1457,6 +1455,7 @@
         HPEN oldPen;
         RECT rc = rect;
 
+        rc.left -= MENU_COL_SPACE / 2 + 1;
         rc.top = 3;
         rc.bottom = height - 3;
         if (flat_menu)


More information about the wine-patches mailing list