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
2f8e5da9
Commit
2f8e5da9
authored
Aug 31, 2009
by
Jan de Mooij
Committed by
Alexandre Julliard
Sep 01, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/propsheet: Update position of hidden buttons too.
parent
e94d30ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
20 deletions
+73
-20
propsheet.c
dlls/comctl32/propsheet.c
+11
-20
propsheet.c
dlls/comctl32/tests/propsheet.c
+62
-0
No files found.
dlls/comctl32/propsheet.c
View file @
2f8e5da9
...
...
@@ -904,7 +904,7 @@ static BOOL PROPSHEET_AdjustButtons(HWND hwndParent, const PropSheetInfo* psInfo
*/
hwndButton
=
GetDlgItem
(
hwndParent
,
IDCANCEL
);
x
=
rcSheet
.
right
-
((
padding
.
x
+
buttonWidth
)
*
(
num_buttons
-
1
))
;
x
+=
padding
.
x
+
buttonWidth
;
SetWindowPos
(
hwndButton
,
0
,
x
,
y
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOZORDER
|
SWP_NOACTIVATE
);
...
...
@@ -914,34 +914,25 @@ static BOOL PROPSHEET_AdjustButtons(HWND hwndParent, const PropSheetInfo* psInfo
*/
hwndButton
=
GetDlgItem
(
hwndParent
,
IDC_APPLY_BUTTON
);
if
(
psInfo
->
hasApply
)
{
if
(
psInfo
->
hasHelp
)
x
=
rcSheet
.
right
-
((
padding
.
x
+
buttonWidth
)
*
2
);
else
x
=
rcSheet
.
right
-
(
padding
.
x
+
buttonWidth
);
SetWindowPos
(
hwndButton
,
0
,
x
,
y
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOZORDER
|
SWP_NOACTIVATE
);
EnableWindow
(
hwndButton
,
FALSE
);
}
if
(
psInfo
->
hasApply
)
x
+=
padding
.
x
+
buttonWidth
;
else
ShowWindow
(
hwndButton
,
SW_HIDE
);
SetWindowPos
(
hwndButton
,
0
,
x
,
y
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOZORDER
|
SWP_NOACTIVATE
);
EnableWindow
(
hwndButton
,
FALSE
);
/*
* Position Help button.
*/
hwndButton
=
GetDlgItem
(
hwndParent
,
IDHELP
);
if
(
psInfo
->
hasHelp
)
{
x
=
rcSheet
.
right
-
(
padding
.
x
+
buttonWidth
);
x
+=
padding
.
x
+
buttonWidth
;
SetWindowPos
(
hwndButton
,
0
,
x
,
y
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOZORDER
|
SWP_NOACTIVATE
);
SetWindowPos
(
hwndButton
,
0
,
x
,
y
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOZORDER
|
SWP_NOACTIVATE
);
}
else
if
(
!
psInfo
->
hasHelp
)
ShowWindow
(
hwndButton
,
SW_HIDE
);
return
TRUE
;
...
...
dlls/comctl32/tests/propsheet.c
View file @
2f8e5da9
/* Unit test suite for property sheet control.
*
* Copyright 2006 Huw Davies
* Copyright 2009 Jan de Mooij
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -28,6 +29,8 @@ static HWND parent;
static
LONG
active_page
=
-
1
;
#define IDC_APPLY_BUTTON 12321
static
int
CALLBACK
sheet_callback
(
HWND
hwnd
,
UINT
msg
,
LPARAM
lparam
)
{
switch
(
msg
)
...
...
@@ -341,6 +344,64 @@ static void test_wiznavigation(void)
DestroyWindow
(
hdlg
);
}
static
void
test_buttons
(
void
)
{
HPROPSHEETPAGE
hpsp
[
1
];
PROPSHEETPAGEA
psp
;
PROPSHEETHEADERA
psh
;
HWND
hdlg
;
HWND
button
;
RECT
rc
;
int
prevRight
,
top
;
memset
(
&
psp
,
0
,
sizeof
(
psp
));
psp
.
dwSize
=
sizeof
(
psp
);
psp
.
dwFlags
=
0
;
psp
.
hInstance
=
GetModuleHandleW
(
NULL
);
U
(
psp
).
pszTemplate
=
"prop_page1"
;
U2
(
psp
).
pszIcon
=
NULL
;
psp
.
pfnDlgProc
=
page_dlg_proc
;
psp
.
lParam
=
0
;
hpsp
[
0
]
=
CreatePropertySheetPageA
(
&
psp
);
memset
(
&
psh
,
0
,
sizeof
(
psh
));
psh
.
dwSize
=
sizeof
(
psh
);
psh
.
dwFlags
=
PSH_MODELESS
|
PSH_USECALLBACK
;
psh
.
pszCaption
=
"test caption"
;
psh
.
nPages
=
1
;
psh
.
hwndParent
=
GetDesktopWindow
();
U3
(
psh
).
phpage
=
hpsp
;
psh
.
pfnCallback
=
sheet_callback
;
hdlg
=
(
HWND
)
PropertySheetA
(
&
psh
);
/* OK button */
button
=
GetDlgItem
(
hdlg
,
IDOK
);
GetWindowRect
(
button
,
&
rc
);
prevRight
=
rc
.
right
;
top
=
rc
.
top
;
/* Cancel button */
button
=
GetDlgItem
(
hdlg
,
IDCANCEL
);
GetWindowRect
(
button
,
&
rc
);
ok
(
rc
.
top
==
top
,
"Cancel button should have same top as OK button
\n
"
);
ok
(
rc
.
left
>
prevRight
,
"Cancel button should be to the right of OK button
\n
"
);
prevRight
=
rc
.
right
;
button
=
GetDlgItem
(
hdlg
,
IDC_APPLY_BUTTON
);
GetWindowRect
(
button
,
&
rc
);
ok
(
rc
.
top
==
top
,
"Apply button should have same top as OK button
\n
"
);
ok
(
rc
.
left
>
prevRight
,
"Apply button should be to the right of Cancel button
\n
"
);
prevRight
=
rc
.
right
;
button
=
GetDlgItem
(
hdlg
,
IDHELP
);
GetWindowRect
(
button
,
&
rc
);
ok
(
rc
.
top
==
top
,
"Help button should have same top as OK button
\n
"
);
ok
(
rc
.
left
>
prevRight
,
"Help button should be to the right of Apply button
\n
"
);
DestroyWindow
(
hdlg
);
}
START_TEST
(
propsheet
)
{
...
...
@@ -348,4 +409,5 @@ START_TEST(propsheet)
test_nopage
();
test_disableowner
();
test_wiznavigation
();
test_buttons
();
}
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