Datetime picker updown support

Rob Shearman rob at codeweavers.com
Thu Apr 14 07:41:05 CDT 2005


Duane Clark wrote:

> This adds support for the updown control in the datetime picker 
> (previously it existed but did nothing).

...

>@@ -874,13 +1008,23 @@ DATETIME_Size (DATETIME_INFO *infoPtr, W
>     TRACE("Height=%ld, Width=%ld\n", infoPtr->rcClient.bottom, infoPtr->rcClient.right);
> 
>     infoPtr->rcDraw = infoPtr->rcClient;
>-
>-    /* set the size of the button that drops the calendar down */
>-    /* FIXME: account for style that allows button on left side */
>-    infoPtr->calbutton.top   = infoPtr->rcDraw.top;
>-    infoPtr->calbutton.bottom= infoPtr->rcDraw.bottom;
>-    infoPtr->calbutton.left  = infoPtr->rcDraw.right-15;
>-    infoPtr->calbutton.right = infoPtr->rcDraw.right;
>+    
>+    if (infoPtr->dwStyle & DTS_UPDOWN) {
>+        /* the updown control seems to ignore SetWindowPos messages */
>+	DestroyWindow(infoPtr->hUpdown);
>+	/* hmmm... the updown control seems to ignore the width parameter */
>+	infoPtr->hUpdown = CreateUpDownControl (WS_CHILD | WS_BORDER | WS_VISIBLE,
>+						infoPtr->rcClient.right-14, 0, 20, infoPtr->rcClient.bottom, 
>+						infoPtr->hwndSelf, 1, 0, 0, UD_MAXVAL, UD_MINVAL, 0);
>+    }
>+    else {
>+        /* set the size of the button that drops the calendar down */
>+        /* FIXME: account for style that allows button on left side */
>+        infoPtr->calbutton.top   = infoPtr->rcDraw.top;
>+        infoPtr->calbutton.bottom= infoPtr->rcDraw.bottom;
>+        infoPtr->calbutton.left  = infoPtr->rcDraw.right-15;
>+        infoPtr->calbutton.right = infoPtr->rcDraw.right;
>+    }
> 
>     /* set enable/disable button size for show none style being enabled */
>     /* FIXME: these dimensions are completely incorrect */
>  
>

This seems really wrong. You are destroying and creating the updown 
control on every size event?!?! That's really going to slow resizes 
down. Is there any evidence that the native version does it like this?

Rob



More information about the wine-devel mailing list