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
8d8e7584
Commit
8d8e7584
authored
Aug 18, 2015
by
Vincent Povirk
Committed by
Alexandre Julliard
Aug 19, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Implement SetControlItemState for combo boxes.
parent
068a6c7a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
12 deletions
+43
-12
itemdlg.c
dlls/comdlg32/itemdlg.c
+43
-10
itemdlg.c
dlls/comdlg32/tests/itemdlg.c
+0
-2
No files found.
dlls/comdlg32/itemdlg.c
View file @
8d8e7584
...
...
@@ -3675,9 +3675,11 @@ static HRESULT WINAPI IFileDialogCustomize_fnAddControlItem(IFileDialogCustomize
case
IDLG_CCTRL_COMBOBOX
:
{
UINT
index
;
cctrl_item
*
item
;
if
(
get_combobox_index_from_id
(
ctrl
->
hwnd
,
dwIDItem
)
!=
-
1
)
return
E_INVALIDARG
;
hr
=
add_item
(
ctrl
,
dwIDItem
,
pszLabel
,
&
item
);
if
(
FAILED
(
hr
))
return
hr
;
index
=
SendMessageW
(
ctrl
->
hwnd
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
pszLabel
);
SendMessageW
(
ctrl
->
hwnd
,
CB_SETITEMDATA
,
index
,
dwIDItem
);
...
...
@@ -3719,19 +3721,21 @@ static HRESULT WINAPI IFileDialogCustomize_fnRemoveControlItem(IFileDialogCustom
{
case
IDLG_CCTRL_COMBOBOX
:
{
UINT
i
,
count
=
SendMessageW
(
ctrl
->
hwnd
,
CB_GETCOUNT
,
0
,
0
);
if
(
!
count
||
(
count
==
CB_ERR
))
return
E_FAIL
;
cctrl_item
*
item
;
DWORD
position
;
for
(
i
=
0
;
i
<
count
;
i
++
)
if
(
SendMessageW
(
ctrl
->
hwnd
,
CB_GETITEMDATA
,
i
,
0
)
==
dwIDItem
)
item
=
get_item
(
ctrl
,
dwIDItem
,
CDCS_VISIBLE
|
CDCS_ENABLED
,
&
position
);
if
((
item
->
cdcstate
&
(
CDCS_VISIBLE
|
CDCS_ENABLED
))
==
(
CDCS_VISIBLE
|
CDCS_ENABLED
))
{
if
(
SendMessageW
(
ctrl
->
hwnd
,
CB_DELETESTRING
,
i
,
0
)
==
CB_ERR
)
if
(
SendMessageW
(
ctrl
->
hwnd
,
CB_DELETESTRING
,
position
,
0
)
==
CB_ERR
)
return
E_FAIL
;
return
S_OK
;
}
return
E_UNEXPECTED
;
list_remove
(
&
item
->
entry
);
item_free
(
item
);
return
S_OK
;
}
case
IDLG_CCTRL_MENU
:
{
...
...
@@ -3788,6 +3792,7 @@ static HRESULT WINAPI IFileDialogCustomize_fnGetControlItemState(IFileDialogCust
switch
(
ctrl
->
type
)
{
case
IDLG_CCTRL_COMBOBOX
:
case
IDLG_CCTRL_MENU
:
{
cctrl_item
*
item
;
...
...
@@ -3821,6 +3826,34 @@ static HRESULT WINAPI IFileDialogCustomize_fnSetControlItemState(IFileDialogCust
switch
(
ctrl
->
type
)
{
case
IDLG_CCTRL_COMBOBOX
:
{
cctrl_item
*
item
;
BOOL
visible
,
was_visible
;
DWORD
position
;
item
=
get_item
(
ctrl
,
dwIDItem
,
CDCS_VISIBLE
|
CDCS_ENABLED
,
&
position
);
if
(
!
item
)
return
E_UNEXPECTED
;
visible
=
((
dwState
&
(
CDCS_VISIBLE
|
CDCS_ENABLED
))
==
(
CDCS_VISIBLE
|
CDCS_ENABLED
));
was_visible
=
((
item
->
cdcstate
&
(
CDCS_VISIBLE
|
CDCS_ENABLED
))
==
(
CDCS_VISIBLE
|
CDCS_ENABLED
));
if
(
visible
&&
!
was_visible
)
{
SendMessageW
(
ctrl
->
hwnd
,
CB_INSERTSTRING
,
position
,
(
LPARAM
)
item
->
label
);
SendMessageW
(
ctrl
->
hwnd
,
CB_SETITEMDATA
,
position
,
dwIDItem
);
}
else
if
(
!
visible
&&
was_visible
)
{
SendMessageW
(
ctrl
->
hwnd
,
CB_DELETESTRING
,
position
,
0
);
}
item
->
cdcstate
=
dwState
;
return
S_OK
;
}
case
IDLG_CCTRL_MENU
:
{
TBBUTTON
tbb
;
...
...
dlls/comdlg32/tests/itemdlg.c
View file @
8d8e7584
...
...
@@ -1970,7 +1970,6 @@ static void test_customize(void)
ok
(
hr
==
E_FAIL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
selected
==
-
1
,
"got %d.
\n
"
,
selected
);
todo_wine
{
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlItemState
(
pfdc
,
i
,
0
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
...
...
@@ -1987,7 +1986,6 @@ static void test_customize(void)
hr
=
IFileDialogCustomize_GetControlItemState
(
pfdc
,
i
,
0
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
}
for
(
j
=
0
;
j
<
10
;
j
++
)
{
...
...
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