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
d4f0aa2b
Commit
d4f0aa2b
authored
May 27, 2011
by
David Hedberg
Committed by
Alexandre Julliard
May 27, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Implement support for custom control subitems.
parent
23571b6a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
134 additions
and
7 deletions
+134
-7
itemdlg.c
dlls/comdlg32/itemdlg.c
+134
-7
itemdlg.c
dlls/comdlg32/tests/itemdlg.c
+0
-0
No files found.
dlls/comdlg32/itemdlg.c
View file @
d4f0aa2b
...
...
@@ -3120,14 +3120,62 @@ static HRESULT WINAPI IFileDialogCustomize_fnSetCheckButtonState(IFileDialogCust
return
S_OK
;
}
static
UINT
get_combobox_index_from_id
(
HWND
cb_hwnd
,
DWORD
dwIDItem
)
{
UINT
count
=
SendMessageW
(
cb_hwnd
,
CB_GETCOUNT
,
0
,
0
);
UINT
i
;
if
(
!
count
||
(
count
==
CB_ERR
))
return
-
1
;
for
(
i
=
0
;
i
<
count
;
i
++
)
if
(
SendMessageW
(
cb_hwnd
,
CB_GETITEMDATA
,
i
,
0
)
==
dwIDItem
)
return
i
;
TRACE
(
"Item with id %d not found in combobox %p (item count: %d)
\n
"
,
dwIDItem
,
cb_hwnd
,
count
);
return
-
1
;
}
static
HRESULT
WINAPI
IFileDialogCustomize_fnAddControlItem
(
IFileDialogCustomize
*
iface
,
DWORD
dwIDCtl
,
DWORD
dwIDItem
,
LPCWSTR
pszLabel
)
{
FileDialogImpl
*
This
=
impl_from_IFileDialogCustomize
(
iface
);
FIXME
(
"stub - %p (%d, %d, %s)
\n
"
,
This
,
dwIDCtl
,
dwIDItem
,
debugstr_w
(
pszLabel
));
return
E_NOTIMPL
;
customctrl
*
ctrl
=
get_cctrl
(
This
,
dwIDCtl
);
TRACE
(
"%p (%d, %d, %s)
\n
"
,
This
,
dwIDCtl
,
dwIDItem
,
debugstr_w
(
pszLabel
));
if
(
!
ctrl
)
return
E_FAIL
;
switch
(
ctrl
->
type
)
{
case
IDLG_CCTRL_COMBOBOX
:
{
UINT
index
;
if
(
get_combobox_index_from_id
(
ctrl
->
hwnd
,
dwIDItem
)
!=
-
1
)
return
E_INVALIDARG
;
index
=
SendMessageW
(
ctrl
->
hwnd
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
pszLabel
);
SendMessageW
(
ctrl
->
hwnd
,
CB_SETITEMDATA
,
index
,
dwIDItem
);
return
S_OK
;
}
case
IDLG_CCTRL_MENU
:
{
TBBUTTON
tbb
;
SendMessageW
(
ctrl
->
hwnd
,
TB_GETBUTTON
,
0
,
(
LPARAM
)
&
tbb
);
if
(
GetMenuState
((
HMENU
)
tbb
.
dwData
,
dwIDItem
,
MF_BYCOMMAND
)
!=
-
1
)
return
E_INVALIDARG
;
AppendMenuW
((
HMENU
)
tbb
.
dwData
,
MF_STRING
,
dwIDItem
,
pszLabel
);
return
S_OK
;
}
default:
break
;
}
return
E_NOINTERFACE
;
/* win7 */
}
static
HRESULT
WINAPI
IFileDialogCustomize_fnRemoveControlItem
(
IFileDialogCustomize
*
iface
,
...
...
@@ -3135,8 +3183,46 @@ static HRESULT WINAPI IFileDialogCustomize_fnRemoveControlItem(IFileDialogCustom
DWORD
dwIDItem
)
{
FileDialogImpl
*
This
=
impl_from_IFileDialogCustomize
(
iface
);
FIXME
(
"stub - %p (%d, %d)
\n
"
,
This
,
dwIDCtl
,
dwIDItem
);
return
E_NOTIMPL
;
customctrl
*
ctrl
=
get_cctrl
(
This
,
dwIDCtl
);
TRACE
(
"%p (%d, %d)
\n
"
,
This
,
dwIDCtl
,
dwIDItem
);
if
(
!
ctrl
)
return
E_FAIL
;
switch
(
ctrl
->
type
)
{
case
IDLG_CCTRL_COMBOBOX
:
{
UINT
i
,
count
=
SendMessageW
(
ctrl
->
hwnd
,
CB_GETCOUNT
,
0
,
0
);
if
(
!
count
||
(
count
==
CB_ERR
))
return
E_FAIL
;
for
(
i
=
0
;
i
<
count
;
i
++
)
if
(
SendMessageW
(
ctrl
->
hwnd
,
CB_GETITEMDATA
,
0
,
0
)
==
dwIDItem
)
{
if
(
SendMessageW
(
ctrl
->
hwnd
,
CB_DELETESTRING
,
i
,
0
)
==
CB_ERR
)
return
E_FAIL
;
return
S_OK
;
}
return
E_UNEXPECTED
;
}
case
IDLG_CCTRL_MENU
:
{
TBBUTTON
tbb
;
HMENU
hmenu
;
SendMessageW
(
ctrl
->
hwnd
,
TB_GETBUTTON
,
0
,
(
LPARAM
)
&
tbb
);
hmenu
=
(
HMENU
)
tbb
.
dwData
;
if
(
!
hmenu
||
!
DeleteMenu
(
hmenu
,
dwIDItem
,
MF_BYCOMMAND
))
return
E_UNEXPECTED
;
return
S_OK
;
}
default:
break
;
}
return
E_FAIL
;
}
static
HRESULT
WINAPI
IFileDialogCustomize_fnRemoveAllControlItems
(
IFileDialogCustomize
*
iface
,
...
...
@@ -3174,7 +3260,26 @@ static HRESULT WINAPI IFileDialogCustomize_fnGetSelectedControlItem(IFileDialogC
DWORD
*
pdwIDItem
)
{
FileDialogImpl
*
This
=
impl_from_IFileDialogCustomize
(
iface
);
FIXME
(
"stub - %p
\n
"
,
This
);
customctrl
*
ctrl
=
get_cctrl
(
This
,
dwIDCtl
);
TRACE
(
"%p (%d, %p)
\n
"
,
This
,
dwIDCtl
,
pdwIDItem
);
if
(
!
ctrl
)
return
E_FAIL
;
switch
(
ctrl
->
type
)
{
case
IDLG_CCTRL_COMBOBOX
:
{
UINT
index
=
SendMessageW
(
ctrl
->
hwnd
,
CB_GETCURSEL
,
0
,
0
);
if
(
index
==
CB_ERR
)
return
E_FAIL
;
*
pdwIDItem
=
SendMessageW
(
ctrl
->
hwnd
,
CB_GETITEMDATA
,
index
,
0
);
return
S_OK
;
}
default:
FIXME
(
"Unsupported control type %d
\n
"
,
ctrl
->
type
);
}
return
E_NOTIMPL
;
}
...
...
@@ -3183,8 +3288,30 @@ static HRESULT WINAPI IFileDialogCustomize_fnSetSelectedControlItem(IFileDialogC
DWORD
dwIDItem
)
{
FileDialogImpl
*
This
=
impl_from_IFileDialogCustomize
(
iface
);
FIXME
(
"stub - %p (%d, %d)
\n
"
,
This
,
dwIDCtl
,
dwIDItem
);
return
E_NOTIMPL
;
customctrl
*
ctrl
=
get_cctrl
(
This
,
dwIDCtl
);
TRACE
(
"%p (%d, %d)
\n
"
,
This
,
dwIDCtl
,
dwIDItem
);
if
(
!
ctrl
)
return
E_INVALIDARG
;
switch
(
ctrl
->
type
)
{
case
IDLG_CCTRL_COMBOBOX
:
{
UINT
index
=
get_combobox_index_from_id
(
ctrl
->
hwnd
,
dwIDItem
);
if
(
index
==
-
1
)
return
E_INVALIDARG
;
if
(
SendMessageW
(
ctrl
->
hwnd
,
CB_SETCURSEL
,
index
,
0
)
==
CB_ERR
)
return
E_FAIL
;
return
S_OK
;
}
default:
FIXME
(
"Unsupported control type %d
\n
"
,
ctrl
->
type
);
}
return
E_INVALIDARG
;
}
static
HRESULT
WINAPI
IFileDialogCustomize_fnStartVisualGroup
(
IFileDialogCustomize
*
iface
,
...
...
dlls/comdlg32/tests/itemdlg.c
View file @
d4f0aa2b
This diff is collapsed.
Click to expand it.
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