[commdlg] fix for lookin combo box overlapping the toolbar

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

 



This patch fixes the problem where the lookin combo box overlaps the
toolbar in the open/save file dialog box.
Actually, we can't base the placement of the toolbar according to the
resources because some apps resize the dialog during the hook procedure.
Instead, with this patch, the toolbar is placed according to the lookin
combobox placement.

This patch does not need my previous patch ([commdlg] fix for resizing a
window with hook) to work, but the result will be better.

a+

Max

Changelog:
     * Fix the lookin combobox overlapping the toolbar in open/save file
dialog.

-- 
Maxime Bellengà <maxime.bellenge@laposte.net>
--- dlls/commdlg/filedlg95patch1.c	2003-03-23 21:31:36.000000000 +0100
+++ dlls/commdlg/filedlg95.c	2003-03-24 19:13:28.000000000 +0100
@@ -1029,7 +1029,7 @@
    {VIEW_DETAILS,      FCIDM_TB_REPORTVIEW, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 },
   };
   TBADDBITMAP tba[2];
-  RECT rectTB;
+  RECT rectTB;RECT rectlook;
   FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr);
 
   tba[0].hInst = HINST_COMMCTRL;
@@ -1055,10 +1055,18 @@
   fodInfos->DlgInfos.hwndFileTypeCB = GetDlgItem(hwnd,IDC_FILETYPE);
   fodInfos->DlgInfos.hwndLookInCB = GetDlgItem(hwnd,IDC_LOOKIN);
 
+  GetWindowRect( fodInfos->DlgInfos.hwndLookInCB,&rectlook);
+  MapWindowPoints( 0, hwnd,(LPPOINT)&rectlook,2);
+
   /* construct the toolbar */
   GetWindowRect(GetDlgItem(hwnd,IDC_TOOLBARSTATIC),&rectTB);
   MapWindowPoints( 0, hwnd,(LPPOINT)&rectTB,2);
 
+  rectTB.right = rectlook.right + rectTB.right - rectTB.left;
+  rectTB.bottom = rectlook.top - 1 + rectTB.bottom - rectTB.top;
+  rectTB.left = rectlook.right;
+  rectTB.top = rectlook.top-1;
+
   fodInfos->DlgInfos.hwndTB = CreateWindowExA(0, TOOLBARCLASSNAMEA, NULL,
         WS_CHILD | WS_GROUP | TBSTYLE_TOOLTIPS | CCS_NODIVIDER | CCS_NORESIZE,
         0, 0, 150, 26, hwnd, (HMENU) IDC_TOOLBAR, COMMDLG_hInstance32, NULL);

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

  Powered by Linux