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
fe966335
Commit
fe966335
authored
Mar 19, 2008
by
Lei Zhang
Committed by
Alexandre Julliard
Mar 20, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Implement listview checkbox toggle.
parent
778c04db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
10 deletions
+17
-10
listview.c
dlls/comctl32/listview.c
+16
-9
listview.c
dlls/comctl32/tests/listview.c
+1
-1
No files found.
dlls/comctl32/listview.c
View file @
fe966335
...
...
@@ -1353,6 +1353,19 @@ static inline BOOL is_autoarrange(const LISTVIEW_INFO *infoPtr)
(
uView
==
LVS_ICON
||
uView
==
LVS_SMALLICON
);
}
static
void
toggle_checkbox_state
(
LISTVIEW_INFO
*
infoPtr
,
INT
nItem
)
{
DWORD
state
=
STATEIMAGEINDEX
(
LISTVIEW_GetItemState
(
infoPtr
,
nItem
,
LVIS_STATEIMAGEMASK
));
if
(
state
==
1
||
state
==
2
)
{
LVITEMW
lvitem
;
state
^=
3
;
lvitem
.
state
=
INDEXTOSTATEIMAGEMASK
(
state
);
lvitem
.
stateMask
=
LVIS_STATEIMAGEMASK
;
LISTVIEW_SetItemState
(
infoPtr
,
nItem
,
&
lvitem
);
}
}
/******** Internal API functions ************************************/
static
inline
COLUMN_INFO
*
LISTVIEW_GetColumnInfo
(
const
LISTVIEW_INFO
*
infoPtr
,
INT
nSubItem
)
...
...
@@ -8283,6 +8296,8 @@ static LRESULT LISTVIEW_KeyDown(LISTVIEW_INFO *infoPtr, INT nVirtualKey, LONG lK
{
case
VK_SPACE
:
nItem
=
infoPtr
->
nFocusedItem
;
if
(
infoPtr
->
dwLvExStyle
&
LVS_EX_CHECKBOXES
)
toggle_checkbox_state
(
infoPtr
,
infoPtr
->
nFocusedItem
);
break
;
case
VK_RETURN
:
...
...
@@ -8475,15 +8490,7 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, IN
{
if
((
infoPtr
->
dwLvExStyle
&
LVS_EX_CHECKBOXES
)
&&
(
lvHitTestInfo
.
flags
&
LVHT_ONITEMSTATEICON
))
{
DWORD
state
=
STATEIMAGEINDEX
(
LISTVIEW_GetItemState
(
infoPtr
,
nItem
,
LVIS_STATEIMAGEMASK
));
if
(
state
==
1
||
state
==
2
)
{
LVITEMW
lvitem
;
state
^=
3
;
lvitem
.
state
=
INDEXTOSTATEIMAGEMASK
(
state
);
lvitem
.
stateMask
=
LVIS_STATEIMAGEMASK
;
LISTVIEW_SetItemState
(
infoPtr
,
nItem
,
&
lvitem
);
}
toggle_checkbox_state
(
infoPtr
,
nItem
);
return
0
;
}
...
...
dlls/comctl32/tests/listview.c
View file @
fe966335
...
...
@@ -564,7 +564,7 @@ static void test_checkboxes(void)
item
.
mask
=
LVIF_STATE
;
item
.
stateMask
=
0xffff
;
r
=
SendMessage
(
hwnd
,
LVM_GETITEMA
,
0
,
(
LPARAM
)
&
item
);
todo_wine
ok
(
item
.
state
==
0x2aab
,
"state %x
\n
"
,
item
.
state
);
ok
(
item
.
state
==
0x2aab
,
"state %x
\n
"
,
item
.
state
);
r
=
SendMessage
(
hwnd
,
WM_KEYDOWN
,
VK_SPACE
,
0
);
expect
(
0
,
r
);
...
...
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