Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
45851485
Commit
45851485
authored
Mar 23, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 24, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tab: Implement TCM_REMOVEIMAGE.
parent
e9ef9911
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
3 deletions
+96
-3
tab.c
dlls/comctl32/tab.c
+32
-3
tab.c
dlls/comctl32/tests/tab.c
+64
-0
No files found.
dlls/comctl32/tab.c
View file @
45851485
...
...
@@ -53,7 +53,6 @@
* TCN_KEYDOWN
*
* Messages:
* TCM_REMOVEIMAGE
* TCM_DESELECTALL
* TCM_GETEXTENDEDSTYLE
* TCM_SETEXTENDEDSTYLE
...
...
@@ -3099,6 +3098,37 @@ TAB_SetItemExtra (TAB_INFO *infoPtr, INT cbInfo)
return
TRUE
;
}
static
LRESULT
TAB_RemoveImage
(
TAB_INFO
*
infoPtr
,
INT
image
)
{
if
(
!
infoPtr
)
return
0
;
if
(
ImageList_Remove
(
infoPtr
->
himl
,
image
))
{
INT
i
,
*
idx
;
RECT
r
;
/* shift indices, repaint items if needed */
for
(
i
=
0
;
i
<
infoPtr
->
uNumItem
;
i
++
)
{
idx
=
&
infoPtr
->
items
[
i
].
iImage
;
if
(
*
idx
>=
image
)
{
if
(
*
idx
==
image
)
*
idx
=
-
1
;
else
(
*
idx
)
--
;
/* repaint item */
if
(
TAB_InternalGetItemRect
(
infoPtr
,
i
,
&
r
,
NULL
))
InvalidateRect
(
infoPtr
->
hwnd
,
&
r
,
TRUE
);
}
}
}
return
0
;
}
static
LRESULT
WINAPI
TAB_WindowProc
(
HWND
hwnd
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
...
...
@@ -3159,8 +3189,7 @@ TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return
TAB_SetItemSize
(
infoPtr
,
lParam
);
case
TCM_REMOVEIMAGE
:
FIXME
(
"Unimplemented msg TCM_REMOVEIMAGE
\n
"
);
return
0
;
return
TAB_RemoveImage
(
infoPtr
,
wParam
);
case
TCM_SETPADDING
:
return
TAB_SetPadding
(
infoPtr
,
lParam
);
...
...
dlls/comctl32/tests/tab.c
View file @
45851485
...
...
@@ -984,6 +984,69 @@ static void test_delete_focus(HWND parent_wnd)
DestroyWindow
(
hTab
);
}
static
void
test_removeimage
(
HWND
parent_wnd
)
{
static
const
BYTE
bits
[
32
];
HWND
hwTab
;
INT
i
;
TCITEM
item
;
HICON
hicon
;
HIMAGELIST
himl
=
ImageList_Create
(
16
,
16
,
ILC_COLOR
,
3
,
4
);
hicon
=
CreateIcon
(
NULL
,
16
,
16
,
1
,
1
,
bits
,
bits
);
ImageList_AddIcon
(
himl
,
hicon
);
ImageList_AddIcon
(
himl
,
hicon
);
ImageList_AddIcon
(
himl
,
hicon
);
hwTab
=
create_tabcontrol
(
TCS_FIXEDWIDTH
,
TCIF_TEXT
|
TCIF_IMAGE
);
SendMessage
(
hwTab
,
TCM_SETIMAGELIST
,
0
,
(
LPARAM
)
himl
);
memset
(
&
item
,
0
,
sizeof
(
TCITEM
));
item
.
mask
=
TCIF_IMAGE
;
for
(
i
=
0
;
i
<
3
;
i
++
)
{
SendMessage
(
hwTab
,
TCM_GETITEM
,
i
,
(
LPARAM
)
&
item
);
expect
(
i
,
item
.
iImage
);
}
/* remove image middle image */
SendMessage
(
hwTab
,
TCM_REMOVEIMAGE
,
1
,
0
);
expect
(
2
,
ImageList_GetImageCount
(
himl
));
item
.
iImage
=
-
1
;
SendMessage
(
hwTab
,
TCM_GETITEM
,
0
,
(
LPARAM
)
&
item
);
expect
(
0
,
item
.
iImage
);
item
.
iImage
=
0
;
SendMessage
(
hwTab
,
TCM_GETITEM
,
1
,
(
LPARAM
)
&
item
);
expect
(
-
1
,
item
.
iImage
);
item
.
iImage
=
0
;
SendMessage
(
hwTab
,
TCM_GETITEM
,
2
,
(
LPARAM
)
&
item
);
expect
(
1
,
item
.
iImage
);
/* remove first image */
SendMessage
(
hwTab
,
TCM_REMOVEIMAGE
,
0
,
0
);
expect
(
1
,
ImageList_GetImageCount
(
himl
));
item
.
iImage
=
0
;
SendMessage
(
hwTab
,
TCM_GETITEM
,
0
,
(
LPARAM
)
&
item
);
expect
(
-
1
,
item
.
iImage
);
item
.
iImage
=
0
;
SendMessage
(
hwTab
,
TCM_GETITEM
,
1
,
(
LPARAM
)
&
item
);
expect
(
-
1
,
item
.
iImage
);
item
.
iImage
=
-
1
;
SendMessage
(
hwTab
,
TCM_GETITEM
,
2
,
(
LPARAM
)
&
item
);
expect
(
0
,
item
.
iImage
);
/* remove the last one */
SendMessage
(
hwTab
,
TCM_REMOVEIMAGE
,
0
,
0
);
expect
(
0
,
ImageList_GetImageCount
(
himl
));
for
(
i
=
0
;
i
<
3
;
i
++
)
{
item
.
iImage
=
0
;
SendMessage
(
hwTab
,
TCM_GETITEM
,
i
,
(
LPARAM
)
&
item
);
expect
(
-
1
,
item
.
iImage
);
}
DestroyWindow
(
hwTab
);
ImageList_Destroy
(
himl
);
DestroyIcon
(
hicon
);
}
START_TEST
(
tab
)
{
HWND
parent_wnd
;
...
...
@@ -1021,6 +1084,7 @@ START_TEST(tab)
test_insert_focus
(
parent_wnd
);
test_delete_focus
(
parent_wnd
);
test_removeimage
(
parent_wnd
);
DestroyWindow
(
parent_wnd
);
}
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