Re: Wine 0.8: VB compatibility !!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Roderick Colenbrander" <thunderbird2k@gmx.net> wrote:

> After this there are two very simple apps one containing only an empty form 
> and one containing a button on a form that run well. The only minor problem 
> is in the button app. When you click on the button it should show a 
> messagebox containing a text. On windows the text in the messagebox is 
> alligned to the left or perhaps to the center, but on wine the text is 
> alligned to the right. (looks ugly)

Attached patch should fix a MessageBox bug.

Changelog:
    Fix copy/paste bug. Make MessageBox without an icon look better.

-- 
Dmitry.
--- cvs/cw/crossover/office/wine/windows/msgbox.c	Sun Nov 10 15:04:30 2002
+++ wine/windows/msgbox.c	Sun Nov 10 16:31:02 2002
@@ -158,6 +158,11 @@
     /* Get the icon height */
     GetWindowRect(GetDlgItem(hwnd, MSGBOX_IDICON), &rect);
     MapWindowPoints(0, hwnd, (LPPOINT)&rect, 2);
+    if (!(lpmb->dwStyle & MB_ICONMASK))
+    {
+        rect.bottom = rect.top;
+        rect.right = rect.left;
+    }
     iheight = rect.bottom - rect.top;
     ileft = rect.left;
     iwidth = rect.right - ileft;
@@ -198,7 +203,8 @@
     DrawTextW( hdc, lpszText, -1, &rect,
 	       DT_LEFT | DT_EXPANDTABS | DT_WORDBREAK | DT_CALCRECT);
     /* Min text width corresponds to space for the buttons */
-    tleft = 2 * ileft + iwidth;
+    tleft = ileft + iwidth;
+    if (iwidth) tleft += ileft;
     twidth = max((bw + bspace) * buttons + bspace - tleft, rect.right);
     theight = rect.bottom;
 
@@ -407,7 +413,7 @@
     if (HIWORD(msgbox->lpszIcon))
         RtlCreateUnicodeStringFromAsciiz(&iconW, msgbox->lpszIcon);
     else
-        captionW.Buffer = (LPWSTR)msgbox->lpszIcon;
+        iconW.Buffer = (LPWSTR)msgbox->lpszIcon;
 
     msgboxW.cbSize = sizeof(msgboxW);
     msgboxW.hwndOwner = msgbox->hwndOwner;

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux