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
21898b2f
Commit
21898b2f
authored
Aug 29, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 29, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Remove property sheet page that can't be initialized.
parent
a64b7918
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
3 deletions
+50
-3
propsheet.c
dlls/comctl32/propsheet.c
+14
-2
propsheet.c
dlls/comctl32/tests/propsheet.c
+28
-1
resources.h
dlls/comctl32/tests/resources.h
+1
-0
rsrc.rc
dlls/comctl32/tests/rsrc.rc
+7
-0
No files found.
dlls/comctl32/propsheet.c
View file @
21898b2f
...
@@ -171,6 +171,7 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg,
...
@@ -171,6 +171,7 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg,
static
int
PROPSHEET_GetPageIndex
(
HPROPSHEETPAGE
hpage
,
const
PropSheetInfo
*
psInfo
);
static
int
PROPSHEET_GetPageIndex
(
HPROPSHEETPAGE
hpage
,
const
PropSheetInfo
*
psInfo
);
static
PADDING_INFO
PROPSHEET_GetPaddingInfoWizard
(
HWND
hwndDlg
,
const
PropSheetInfo
*
psInfo
);
static
PADDING_INFO
PROPSHEET_GetPaddingInfoWizard
(
HWND
hwndDlg
,
const
PropSheetInfo
*
psInfo
);
static
BOOL
PROPSHEET_DoCommand
(
HWND
hwnd
,
WORD
wID
);
static
BOOL
PROPSHEET_DoCommand
(
HWND
hwnd
,
WORD
wID
);
static
BOOL
PROPSHEET_RemovePage
(
HWND
hwndDlg
,
int
index
,
HPROPSHEETPAGE
hpage
);
static
INT_PTR
CALLBACK
static
INT_PTR
CALLBACK
PROPSHEET_DialogProc
(
HWND
hwnd
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
);
PROPSHEET_DialogProc
(
HWND
hwnd
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
);
...
@@ -1474,6 +1475,9 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
...
@@ -1474,6 +1475,9 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
/* Free a no more needed copy */
/* Free a no more needed copy */
Free
(
pTemplateCopy
);
Free
(
pTemplateCopy
);
if
(
!
hwndPage
)
return
FALSE
;
psInfo
->
proppage
[
index
].
hwndPage
=
hwndPage
;
psInfo
->
proppage
[
index
].
hwndPage
=
hwndPage
;
/* Subclass exterior wizard pages */
/* Subclass exterior wizard pages */
...
@@ -2025,7 +2029,14 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg,
...
@@ -2025,7 +2029,14 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg,
psn
.
lParam
=
0
;
psn
.
lParam
=
0
;
if
(
!
psInfo
->
proppage
[
index
].
hwndPage
)
{
if
(
!
psInfo
->
proppage
[
index
].
hwndPage
)
{
PROPSHEET_CreatePage
(
hwndDlg
,
index
,
psInfo
,
ppshpage
);
if
(
!
PROPSHEET_CreatePage
(
hwndDlg
,
index
,
psInfo
,
ppshpage
))
{
PROPSHEET_RemovePage
(
hwndDlg
,
index
,
NULL
);
if
(
index
>=
psInfo
->
nPages
)
index
--
;
if
(
index
<
0
)
return
FALSE
;
continue
;
}
}
}
/* Resize the property sheet page to the fit in the Tab control
/* Resize the property sheet page to the fit in the Tab control
...
@@ -2273,7 +2284,8 @@ static BOOL PROPSHEET_AddPage(HWND hwndDlg,
...
@@ -2273,7 +2284,8 @@ static BOOL PROPSHEET_AddPage(HWND hwndDlg,
if
(
ppsp
->
dwFlags
&
PSP_PREMATURE
)
if
(
ppsp
->
dwFlags
&
PSP_PREMATURE
)
{
{
/* Create the page but don't show it */
/* Create the page but don't show it */
PROPSHEET_CreatePage
(
hwndDlg
,
psInfo
->
nPages
,
psInfo
,
ppsp
);
if
(
!
PROPSHEET_CreatePage
(
hwndDlg
,
psInfo
->
nPages
,
psInfo
,
ppsp
))
return
FALSE
;
}
}
/*
/*
...
...
dlls/comctl32/tests/propsheet.c
View file @
21898b2f
...
@@ -750,7 +750,7 @@ static void test_messages(void)
...
@@ -750,7 +750,7 @@ static void test_messages(void)
static
void
test_PSM_ADDPAGE
(
void
)
static
void
test_PSM_ADDPAGE
(
void
)
{
{
HPROPSHEETPAGE
hpsp
[
3
];
HPROPSHEETPAGE
hpsp
[
5
];
PROPSHEETPAGEA
psp
;
PROPSHEETPAGEA
psp
;
PROPSHEETHEADERA
psh
;
PROPSHEETHEADERA
psh
;
HWND
hdlg
,
tab
;
HWND
hdlg
,
tab
;
...
@@ -771,6 +771,12 @@ static void test_PSM_ADDPAGE(void)
...
@@ -771,6 +771,12 @@ static void test_PSM_ADDPAGE(void)
hpsp
[
1
]
=
CreatePropertySheetPageA
(
&
psp
);
hpsp
[
1
]
=
CreatePropertySheetPageA
(
&
psp
);
hpsp
[
2
]
=
CreatePropertySheetPageA
(
&
psp
);
hpsp
[
2
]
=
CreatePropertySheetPageA
(
&
psp
);
U
(
psp
).
pszTemplate
=
MAKEINTRESOURCE
(
IDD_PROP_PAGE_ERROR
);
hpsp
[
3
]
=
CreatePropertySheetPageA
(
&
psp
);
psp
.
dwFlags
=
PSP_PREMATURE
;
hpsp
[
4
]
=
CreatePropertySheetPageA
(
&
psp
);
memset
(
&
psh
,
0
,
sizeof
(
psh
));
memset
(
&
psh
,
0
,
sizeof
(
psh
));
psh
.
dwSize
=
PROPSHEETHEADERA_V1_SIZE
;
psh
.
dwSize
=
PROPSHEETHEADERA_V1_SIZE
;
psh
.
dwFlags
=
PSH_MODELESS
;
psh
.
dwFlags
=
PSH_MODELESS
;
...
@@ -807,6 +813,27 @@ if (0)
...
@@ -807,6 +813,27 @@ if (0)
r
=
SendMessageA
(
tab
,
TCM_GETITEMCOUNT
,
0
,
0
);
r
=
SendMessageA
(
tab
,
TCM_GETITEMCOUNT
,
0
,
0
);
ok
(
r
==
3
,
"got %d
\n
"
,
r
);
ok
(
r
==
3
,
"got %d
\n
"
,
r
);
/* add property sheet page that can't be created */
ret
=
SendMessageA
(
hdlg
,
PSM_ADDPAGE
,
0
,
(
LPARAM
)
hpsp
[
3
]);
ok
(
ret
==
TRUE
,
"got %d
\n
"
,
ret
);
r
=
SendMessageA
(
tab
,
TCM_GETITEMCOUNT
,
0
,
0
);
ok
(
r
==
4
,
"got %d
\n
"
,
r
);
/* select page that can't be created */
ret
=
SendMessageA
(
hdlg
,
PSM_SETCURSEL
,
3
,
0
);
ok
(
ret
==
TRUE
,
"got %d
\n
"
,
ret
);
r
=
SendMessageA
(
tab
,
TCM_GETITEMCOUNT
,
0
,
0
);
ok
(
r
==
3
,
"got %d
\n
"
,
r
);
/* test PSP_PREMATURE flag with incorrect property sheet page */
ret
=
SendMessageA
(
hdlg
,
PSM_ADDPAGE
,
0
,
(
LPARAM
)
hpsp
[
4
]);
ok
(
ret
==
FALSE
,
"got %d
\n
"
,
ret
);
r
=
SendMessageA
(
tab
,
TCM_GETITEMCOUNT
,
0
,
0
);
ok
(
r
==
3
,
"got %d
\n
"
,
r
);
DestroyWindow
(
hdlg
);
DestroyWindow
(
hdlg
);
}
}
...
...
dlls/comctl32/tests/resources.h
View file @
21898b2f
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
#define IDD_PROP_PAGE_WITH_CUSTOM_DEFAULT_BUTTON 34
#define IDD_PROP_PAGE_WITH_CUSTOM_DEFAULT_BUTTON 34
#define IDD_PROP_PAGE_MESSAGE_TEST 35
#define IDD_PROP_PAGE_MESSAGE_TEST 35
#define IDD_PROP_PAGE_ERROR 36
#define IDC_PS_EDIT1 1000
#define IDC_PS_EDIT1 1000
#define IDC_PS_EDIT2 1001
#define IDC_PS_EDIT2 1001
...
...
dlls/comctl32/tests/rsrc.rc
View file @
21898b2f
...
@@ -71,6 +71,13 @@ BEGIN
...
@@ -71,6 +71,13 @@ BEGIN
LTEXT "Some Text",-1,115,1,195,24
LTEXT "Some Text",-1,115,1,195,24
END
END
IDD_PROP_PAGE_ERROR DIALOG 0, 0, 100, 100
STYLE WS_POPUP | WS_CAPTION | WS_CLIPSIBLINGS | WS_VISIBLE
CLASS "Non-existing class"
FONT 8, "MS Shell Dlg"
{
}
STRINGTABLE
STRINGTABLE
{
{
IDS_TBADD1 "abc"
IDS_TBADD1 "abc"
...
...
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