At 01:36 PM 7/27/00 +0200, you wrote:
>gerard patel wrote:
>> This is exactly this change that breaks it ?
>> 
>> @@ -343,7 +343,7 @@
>>      GetClientRect( wnd->hwndSelf, &rect );
>>      descr->width  = rect.right - rect.left;
>>      descr->height = rect.bottom - rect.top;
>> -    if (!(descr->style & LBS_NOINTEGRALHEIGHT) && !IS_OWNERDRAW(descr))
>> +    if (!(descr->style & LBS_NOINTEGRALHEIGHT) && !(descr->style & 
>LBS_OWNERDRAWVARIABLE))
>
>Yes.
>
>You can get a demo version at
>
>http://beast.webmap.com/stars%21/demo.htm
>
>The binary is identical to the full version; however, you can
>only play a limited number of years without the serial code.

Well I'll live with that I think.

I think that the patch from Macadamian is correct.

IMO the problem is that the app is trying to set the dimensions of
the listbox to fit the number of entries it wants. Unfortunately, there
is a little change somewhere and the list gets a bit smaller than
necessary to fit an integral number of items, Wine (the listbox code)
recalculate the best size to fit to the nearest lower number of items,
the app is not happy, etc...

>From the calls the app is doing, I think that Wine is shooting 4 pixels
over the aim. 2 pixels are easy to explain (in my case); I use Win95
look. After switching to Win31, 2 pixels are still unaccountable.

There is in the 'official' list of differences between 16 & 32 bits
applications under Win95 something about the listbox being created
with a bigger size than asked by the app when it's a 16 bits app, so the
border is not taken in account. This documented 'feature' is not
implemented by Wine :-). Unfortunately, fixing the size
at the listbox creation does not work :-(

If I *assume* that the offset is done in the WM_NCCALCSIZE
event, it works :

--- listbox.c.orig      Mon Jul 17 01:09:58 2000
+++ listbox.c   Fri Jul 28 00:52:06 2000
@@ -2402,6 +2402,15 @@
     HWND       hwnd = wnd->hwndSelf;
 
     if (!wnd) return 0;
+    if (msg == WM_NCCALCSIZE)
+    { /* win 3.x bug : adjust the size to ignore border ?? */
+        if(!(wnd->flags & WIN_ISWIN32) && (wnd->dwStyle & WS_BORDER))
+        {
+            NCCALCSIZE_PARAMS *params = (NCCALCSIZE_PARAMS *) lParam;
+            params->rgrc[0].right += (2 * GetSystemMetrics(SM_CXBORDER));
+            params->rgrc[0].bottom += (2 * GetSystemMetrics(SM_CYBORDER));
+       }
+    }
     if (!(descr = *(LB_DESCR **)wnd->wExtra))
     {
         switch (msg)       

(remember to use WIN31 look if you want to test this patch)

Alas, such a behavior is not documented at all :-/

I will need to bring to life again the late and not lamented Win 3.11...(but not today)

Gerard


Reply via email to