Fix for file dialog

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

 



This fixes a bug in how filedlg95 handles child components. At least,
winzip open dialog box looks much better and WinHex too.

ChangeLog:
- Fix how the size of the window is computed.
-- 
Maxime Bellengé <maxime.bellenge@laposte.net>
Index: dlls/commdlg/filedlg95.c
===================================================================
RCS file: /home/wine/wine/dlls/commdlg/filedlg95.c,v
retrieving revision 1.90
diff -u -r1.90 filedlg95.c
--- dlls/commdlg/filedlg95.c	7 Mar 2003 20:29:31 -0000	1.90
+++ dlls/commdlg/filedlg95.c	9 Mar 2003 23:48:26 -0000
@@ -515,7 +515,8 @@
     hwndStc32=GetDlgItem(hwndChildDlg,stc32);
     GetClientRect(hwndParentDlg,&rectParent);
     GetClientRect(hwndChildDlg,&rectChild);
-
+    TRACE("parent t:%d l:%d b:%d r:%d\n",rectParent.top,rectParent.left,rectParent.bottom,rectParent.right);
+    TRACE("child t:%d l:%d b:%d r:%d\n",rectChild.top,rectChild.left,rectChild.bottom,rectChild.right);
     if(hwndStc32)
     {
       GetWindowRect(hwndStc32,&rectStc32);
@@ -539,20 +540,19 @@
     }
     else
     {
-      if( (GetWindow(hwndChildDlg,GW_CHILD)) == NULL) return;
-
       SetRectEmpty(&rectTemp);
       ptParentClient.x = max((rectParent.right-rectParent.left),(rectChild.right-rectChild.left));
       ptParentClient.y = (rectParent.bottom-rectParent.top) + (rectChild.bottom-rectChild.top);
       ptMoveCtl.y = rectParent.bottom-rectParent.top;
-      ptMoveCtl.x=0;
+      ptMoveCtl.x = rectParent.right - rectParent.left;
+      SetRect(&rectTemp,0,0,ptParentClient.x,ptMoveCtl.y);
     }
     SetRect(&rectParent,rectParent.left,rectParent.top,rectParent.left+ptParentClient.x,rectParent.top+ptParentClient.y);
     AdjustWindowRectEx( &rectParent,GetWindowLongA(hwndParentDlg,GWL_STYLE),FALSE,GetWindowLongA(hwndParentDlg,GWL_EXSTYLE));
 
-    SetWindowPos(hwndChildDlg, 0, 0,0, ptParentClient.x + ptMoveCtl.x,ptParentClient.y + ptMoveCtl.y, SWP_NOZORDER );
-    SetWindowPos(hwndParentDlg, 0, rectParent.left,rectParent.top, (rectParent.right- rectParent.left) + ptMoveCtl.x,
-        (rectParent.bottom-rectParent.top) + ptMoveCtl.y,SWP_NOMOVE | SWP_NOZORDER);
+    SetWindowPos(hwndChildDlg, 0, 0,0, ptParentClient.x,ptParentClient.y, SWP_NOZORDER );
+    SetWindowPos(hwndParentDlg, 0, rectParent.left,rectParent.top, (rectParent.right- rectParent.left),
+		 (rectParent.bottom-rectParent.top),SWP_NOMOVE | SWP_NOZORDER);
 
     hwndChild = GetWindow(hwndChildDlg,GW_CHILD);
     if(hwndStc32)
@@ -684,7 +684,6 @@
         fodInfos->ofnInfos->Flags & OFN_ENABLETEMPLATEHANDLE)
     {
       HINSTANCE hinst;
-
       if (fodInfos->ofnInfos->Flags  & OFN_ENABLETEMPLATEHANDLE)
       {
         hinst = 0;

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

  Powered by Linux