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
1b41bafa
Commit
1b41bafa
authored
Jul 10, 2009
by
Rein Klazes
Committed by
Alexandre Julliard
Jul 10, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Memorize and restore the size of the file dialog between calls.
Includes some fine tuning to fix a couple of todo's in the tests.
parent
223c0773
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
17 deletions
+27
-17
filedlg.c
dlls/comdlg32/filedlg.c
+17
-8
filedlg.c
dlls/comdlg32/tests/filedlg.c
+10
-9
No files found.
dlls/comdlg32/filedlg.c
View file @
1b41bafa
...
...
@@ -172,6 +172,7 @@ typedef struct tagFD32_PRIVATE
const
char
FileOpenDlgInfosStr
[]
=
"FileOpenDlgInfos"
;
/* windows property description string */
static
const
char
LookInInfosStr
[]
=
"LookInInfos"
;
/* LOOKIN combo box property */
static
SIZE
MemDialogSize
=
{
0
,
0
};
/* keep size of the (resizable) dialog */
/***********************************************************************
* Prototypes
...
...
@@ -1197,13 +1198,14 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
if
(
fodInfos
->
DlgInfos
.
hwndCustomDlg
)
ShowWindow
(
fodInfos
->
DlgInfos
.
hwndCustomDlg
,
SW_SHOW
);
if
(
fodInfos
->
ofnInfos
->
Flags
&
OFN_EXPLORER
)
if
(
fodInfos
->
ofnInfos
->
Flags
&
OFN_EXPLORER
)
{
SendCustomDlgNotificationMessage
(
hwnd
,
CDN_INITDONE
);
SendCustomDlgNotificationMessage
(
hwnd
,
CDN_FOLDERCHANGE
);
}
if
(
fodInfos
->
ofnInfos
->
Flags
&
OFN_ENABLESIZING
)
{
GetWindowRect
(
hwnd
,
&
rc
);
/* FIXME: should remember sizes of last invocation */
fodInfos
->
sizedlg
.
cx
=
rc
.
right
-
rc
.
left
;
fodInfos
->
sizedlg
.
cy
=
rc
.
bottom
-
rc
.
top
;
fodInfos
->
initial_size
.
x
=
fodInfos
->
sizedlg
.
cx
;
...
...
@@ -1212,13 +1214,16 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
SetWindowPos
(
fodInfos
->
DlgInfos
.
hwndGrip
,
NULL
,
rc
.
right
-
gripx
,
rc
.
bottom
-
gripy
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOACTIVATE
|
SWP_NOZORDER
);
/* resize the dialog to the previous invocation */
if
(
MemDialogSize
.
cx
&&
MemDialogSize
.
cy
)
SetWindowPos
(
hwnd
,
NULL
,
0
,
0
,
MemDialogSize
.
cx
,
MemDialogSize
.
cy
,
SWP_NOMOVE
|
SWP_NOACTIVATE
|
SWP_NOZORDER
);
}
if
(
fodInfos
->
ofnInfos
->
Flags
&
OFN_EXPLORER
)
{
SendCustomDlgNotificationMessage
(
hwnd
,
CDN_FOLDERCHANGE
);
SendCustomDlgNotificationMessage
(
hwnd
,
CDN_SELCHANGE
);
}
return
0
;
}
case
WM_SIZE
:
...
...
@@ -1242,9 +1247,13 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
return
FILEDLG95_OnWMGetIShellBrowser
(
hwnd
);
case
WM_DESTROY
:
RemovePropA
(
hwnd
,
FileOpenDlgInfosStr
);
return
FALSE
;
{
FileOpenDlgInfos
*
fodInfos
=
GetPropA
(
hwnd
,
FileOpenDlgInfosStr
);
if
(
fodInfos
&&
fodInfos
->
ofnInfos
->
Flags
&
OFN_ENABLESIZING
)
MemDialogSize
=
fodInfos
->
sizedlg
;
RemovePropA
(
hwnd
,
FileOpenDlgInfosStr
);
return
FALSE
;
}
case
WM_NOTIFY
:
{
LPNMHDR
lpnmh
=
(
LPNMHDR
)
lParam
;
...
...
dlls/comdlg32/tests/filedlg.c
View file @
1b41bafa
...
...
@@ -273,8 +273,8 @@ static void test_create_view_template(void)
/* test cases for resizing of the file dialog */
struct
{
DWORD
flags
;
int
resize_
init
;
/* change in CDN_INITDON
E handler */
int
resize_
folderchg
;
/* change in CDN_FOLDER
CHANGE handler */
int
resize_
folderchange
;
/* change in CDN_FOLDERCHANG
E handler */
int
resize_
selchange
;
/* change in CDN_SEL
CHANGE handler */
int
resize_timer1
;
/* change in first WM_TIMER handler */
int
resize_check
;
/* expected change (in second WM_TIMER handler) */
BOOL
todo
;
/* mark that test todo_wine */
...
...
@@ -285,10 +285,11 @@ struct {
{
OFN_ENABLESIZING
,
0
,
0
,
0
,
0
,
FALSE
,
FALSE
},
{
OFN_ENABLESIZING
,
0
,
0
,
-
10
,
0
,
FALSE
,
FALSE
},
{
OFN_ENABLESIZING
,
0
,
0
,
10
,
10
,
FALSE
,
TRUE
},
{
OFN_ENABLESIZING
,
0
,
-
10
,
0
,
10
,
TRU
E
,
FALSE
},
/* 5 */
{
OFN_ENABLESIZING
,
0
,
-
10
,
0
,
0
,
FALS
E
,
FALSE
},
/* 5 */
{
OFN_ENABLESIZING
,
0
,
10
,
0
,
10
,
FALSE
,
FALSE
},
{
OFN_ENABLESIZING
,
-
10
,
0
,
0
,
10
,
TRU
E
,
FALSE
},
{
OFN_ENABLESIZING
,
-
10
,
0
,
0
,
10
,
FALS
E
,
FALSE
},
{
OFN_ENABLESIZING
,
10
,
0
,
0
,
10
,
FALSE
,
FALSE
},
{
OFN_ENABLESIZING
,
0
,
0
,
10
,
20
,
FALSE
,
FALSE
},
/* mark the end */
{
0xffffffff
}
};
...
...
@@ -331,14 +332,14 @@ static LONG_PTR WINAPI resize_template_hook(HWND dlg, UINT msg, WPARAM wParam, L
}
case
WM_NOTIFY
:
{
if
((
(
LPNMHDR
)
lParam
)
->
code
==
CDN_
INITDON
E
){
if
((
(
LPNMHDR
)
lParam
)
->
code
==
CDN_
FOLDERCHANG
E
){
GetWindowRect
(
parent
,
&
initrc
);
if
(
(
resize
=
resize_testcases
[
index
].
resize_
init
)){
if
(
(
resize
=
resize_testcases
[
index
].
resize_
folderchange
)){
MoveWindow
(
parent
,
initrc
.
left
,
initrc
.
top
,
initrc
.
right
-
initrc
.
left
+
resize
,
initrc
.
bottom
-
initrc
.
top
+
resize
,
TRUE
);
}
}
else
if
((
(
LPNMHDR
)
lParam
)
->
code
==
CDN_
FOLDER
CHANGE
){
if
(
(
resize
=
resize_testcases
[
index
].
resize_
folderchg
)){
}
else
if
((
(
LPNMHDR
)
lParam
)
->
code
==
CDN_
SEL
CHANGE
){
if
(
(
resize
=
resize_testcases
[
index
].
resize_
selchange
)){
GetWindowRect
(
parent
,
&
rc
);
MoveWindow
(
parent
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
+
resize
,
rc
.
bottom
-
rc
.
top
+
resize
,
TRUE
);
...
...
@@ -619,7 +620,7 @@ static void test_ok(void)
int
i
;
DWORD
ret
;
if
(
!
GetTempFileNameA
(
"."
,
"t
mp
"
,
0
,
tmpfilename
))
{
if
(
!
GetTempFileNameA
(
"."
,
"t
xt
"
,
0
,
tmpfilename
))
{
skip
(
"Failed to create a temporary file name
\n
"
);
return
;
}
...
...
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