Fix for bottom style toolbars

Rein Klazes rklazes at xs4all.nl
Tue Nov 4 06:13:38 CST 2003


Hi,

Fixes bug #1808.

Changelog:
	dlls/comctl32	: toolbar.c
	Correctly place a toolbar with CCS_BOTTOM style at the bottom,
	not the top.

Rein.
-- 
Rein Klazes
rklazes at xs4all.nl
-------------- next part --------------
--- wine/dlls/comctl32/toolbar.c	2003-11-04 08:04:21.000000000 +0100
+++ mywine/dlls/comctl32/toolbar.c	2003-11-04 13:04:11.000000000 +0100
@@ -2732,11 +2732,15 @@
 	cy = infoPtr->nHeight;
 	cx = infoPtr->nWidth;
 
-	if (dwStyle & CCS_NOMOVEY) {
+	if ((dwStyle & CCS_BOTTOM) == CCS_NOMOVEY) {
 		GetWindowRect(hwnd, &window_rect);
 		ScreenToClient(parent, (LPPOINT)&window_rect.left);
 		y = window_rect.top;
 	}
+	if ((dwStyle & CCS_BOTTOM) == CCS_BOTTOM) {
+            GetWindowRect(hwnd, &window_rect);
+            y = parent_rect.bottom - ( window_rect.bottom - window_rect.top);
+        }
     }
 
     if (dwStyle & CCS_NOPARENTALIGN)
@@ -2753,10 +2757,9 @@
     }
 
     infoPtr->bAutoSize = TRUE;
-    SetWindowPos (hwnd, HWND_TOP, parent_rect.left - x, parent_rect.top - y,
-                        cx, cy, uPosFlags);
-    /* The following line makes sure that the infoPtr->bAutoSize is turned off after
-     * the setwindowpos calls */
+    SetWindowPos (hwnd, HWND_TOP,  x, y, cx, cy, uPosFlags);
+    /* The following line makes sure that the infoPtr->bAutoSize is turned off
+     * after the setwindowpos calls */
     infoPtr->bAutoSize = FALSE;
 
     return 0;
@@ -5573,11 +5576,16 @@
 	    cy = infoPtr->nHeight;
 	    cx = infoPtr->nWidth;
 
-	    if (dwStyle & CCS_NOMOVEY) {
+	    if ((dwStyle & CCS_BOTTOM) == CCS_NOMOVEY) {
 		GetWindowRect(hwnd, &window_rect);
 		ScreenToClient(parent, (LPPOINT)&window_rect.left);
-		y = window_rect.top;
+                y = window_rect.top;
 	    }
+            if ((dwStyle & CCS_BOTTOM) == CCS_BOTTOM) {
+                GetWindowRect(hwnd, &window_rect);
+                y = parent_rect.bottom -
+                    ( window_rect.bottom - window_rect.top);
+            }
 	}
 
 	if (dwStyle & CCS_NOPARENTALIGN) {
@@ -5596,8 +5604,7 @@
 	    cx += GetSystemMetrics(SM_CYEDGE);
 	}
 
-	SetWindowPos (hwnd, 0, parent_rect.left - x, parent_rect.top - y,
-			cx, cy, uPosFlags | SWP_NOZORDER);
+	SetWindowPos (hwnd, 0,  x,  y, cx, cy, uPosFlags | SWP_NOZORDER);
     }
     return 0;
 }


More information about the wine-patches mailing list