Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
eef9e1ab
Commit
eef9e1ab
authored
Jun 14, 2007
by
Lei Zhang
Committed by
Alexandre Julliard
Jun 14, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Move file dialog resizing code into its own function.
parent
7dd98bb9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
42 deletions
+57
-42
filedlg.c
dlls/comdlg32/filedlg.c
+57
-42
No files found.
dlls/comdlg32/filedlg.c
View file @
eef9e1ab
...
...
@@ -181,6 +181,7 @@ static const char LookInInfosStr[] = "LookInInfos"; /* LOOKIN combo box property
*/
/* Internal functions used by the dialog */
static
LRESULT
FILEDLG95_ResizeControls
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
);
static
LRESULT
FILEDLG95_FillControls
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
);
static
LRESULT
FILEDLG95_OnWMCommand
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
);
static
LRESULT
FILEDLG95_OnWMGetIShellBrowser
(
HWND
hwnd
);
...
...
@@ -1042,30 +1043,7 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
fodInfos
->
DlgInfos
.
hwndCustomDlg
=
CreateTemplateDialog
((
FileOpenDlgInfos
*
)
lParam
,
hwnd
);
if
(
fodInfos
->
DlgInfos
.
hwndCustomDlg
)
{
RECT
rc
;
UINT
flags
=
SWP_NOACTIVATE
;
ArrangeCtrlPositions
(
fodInfos
->
DlgInfos
.
hwndCustomDlg
,
hwnd
,
(
fodInfos
->
ofnInfos
->
Flags
&
(
OFN_HIDEREADONLY
|
OFN_SHOWHELP
))
==
OFN_HIDEREADONLY
);
/* resize the custom dialog to the parent size */
if
(
fodInfos
->
ofnInfos
->
Flags
&
(
OFN_ENABLETEMPLATE
|
OFN_ENABLETEMPLATEHANDLE
))
GetClientRect
(
hwnd
,
&
rc
);
else
{
/* our own fake template is zero sized and doesn't have
* children, so there is no need to resize it.
* Picasa depends on it.
*/
flags
|=
SWP_NOSIZE
;
SetRectEmpty
(
&
rc
);
}
SetWindowPos
(
fodInfos
->
DlgInfos
.
hwndCustomDlg
,
HWND_BOTTOM
,
0
,
0
,
rc
.
right
,
rc
.
bottom
,
flags
);
}
FILEDLG95_ResizeControls
(
hwnd
,
wParam
,
lParam
);
FILEDLG95_FillControls
(
hwnd
,
wParam
,
lParam
);
SendCustomDlgNotificationMessage
(
hwnd
,
CDN_INITDONE
);
...
...
@@ -1440,24 +1418,6 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
EnableWindow
(
GetDlgItem
(
hwnd
,
pshHelp
),
FALSE
);
}
/* Resize the height, if open as read only checkbox ad help button
are hidden and we are not using a custom template nor a customDialog
*/
if
(
(
fodInfos
->
ofnInfos
->
Flags
&
OFN_HIDEREADONLY
)
&&
(
!
(
fodInfos
->
ofnInfos
->
Flags
&
(
OFN_SHOWHELP
|
OFN_ENABLETEMPLATE
|
OFN_ENABLETEMPLATEHANDLE
)))
&&
(
!
fodInfos
->
DlgInfos
.
hwndCustomDlg
))
{
RECT
rectDlg
,
rectHelp
,
rectCancel
;
GetWindowRect
(
hwnd
,
&
rectDlg
);
GetWindowRect
(
GetDlgItem
(
hwnd
,
pshHelp
),
&
rectHelp
);
GetWindowRect
(
GetDlgItem
(
hwnd
,
IDCANCEL
),
&
rectCancel
);
/* subtract the height of the help button plus the space between
the help button and the cancel button to the height of the dialog */
SetWindowPos
(
hwnd
,
0
,
0
,
0
,
rectDlg
.
right
-
rectDlg
.
left
,
(
rectDlg
.
bottom
-
rectDlg
.
top
)
-
(
rectHelp
.
bottom
-
rectCancel
.
bottom
),
SWP_NOACTIVATE
|
SWP_NOMOVE
|
SWP_NOZORDER
);
}
/* change Open to Save */
if
(
fodInfos
->
DlgInfos
.
dwDlgProp
&
FODPROP_SAVEDLG
)
{
...
...
@@ -1471,6 +1431,61 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
}
/***********************************************************************
* FILEDLG95_ResizeControls
*
* WM_INITDIALOG message handler (after hook notification)
*/
static
LRESULT
FILEDLG95_ResizeControls
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
FileOpenDlgInfos
*
fodInfos
=
(
FileOpenDlgInfos
*
)
lParam
;
if
(
fodInfos
->
DlgInfos
.
hwndCustomDlg
)
{
RECT
rc
;
UINT
flags
=
SWP_NOACTIVATE
;
ArrangeCtrlPositions
(
fodInfos
->
DlgInfos
.
hwndCustomDlg
,
hwnd
,
(
fodInfos
->
ofnInfos
->
Flags
&
(
OFN_HIDEREADONLY
|
OFN_SHOWHELP
))
==
OFN_HIDEREADONLY
);
/* resize the custom dialog to the parent size */
if
(
fodInfos
->
ofnInfos
->
Flags
&
(
OFN_ENABLETEMPLATE
|
OFN_ENABLETEMPLATEHANDLE
))
GetClientRect
(
hwnd
,
&
rc
);
else
{
/* our own fake template is zero sized and doesn't have children, so
* there is no need to resize it. Picasa depends on it.
*/
flags
|=
SWP_NOSIZE
;
SetRectEmpty
(
&
rc
);
}
SetWindowPos
(
fodInfos
->
DlgInfos
.
hwndCustomDlg
,
HWND_BOTTOM
,
0
,
0
,
rc
.
right
,
rc
.
bottom
,
flags
);
}
else
{
/* Resize the height, if open as read only checkbox ad help button are
* hidden and we are not using a custom template nor a customDialog
*/
if
(
(
fodInfos
->
ofnInfos
->
Flags
&
OFN_HIDEREADONLY
)
&&
(
!
(
fodInfos
->
ofnInfos
->
Flags
&
(
OFN_SHOWHELP
|
OFN_ENABLETEMPLATE
|
OFN_ENABLETEMPLATEHANDLE
))))
{
RECT
rectDlg
,
rectHelp
,
rectCancel
;
GetWindowRect
(
hwnd
,
&
rectDlg
);
GetWindowRect
(
GetDlgItem
(
hwnd
,
pshHelp
),
&
rectHelp
);
GetWindowRect
(
GetDlgItem
(
hwnd
,
IDCANCEL
),
&
rectCancel
);
/* subtract the height of the help button plus the space between the help
* button and the cancel button to the height of the dialog
*/
SetWindowPos
(
hwnd
,
0
,
0
,
0
,
rectDlg
.
right
-
rectDlg
.
left
,
(
rectDlg
.
bottom
-
rectDlg
.
top
)
-
(
rectHelp
.
bottom
-
rectCancel
.
bottom
),
SWP_NOACTIVATE
|
SWP_NOMOVE
|
SWP_NOZORDER
);
}
}
return
TRUE
;
}
/***********************************************************************
* FILEDLG95_FillControls
*
* WM_INITDIALOG message handler (after hook notification)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment