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
d93ae6ff
Commit
d93ae6ff
authored
May 31, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/toolbar: Support undocumented IDs for standard bitmap lists.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ece34a13
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
97 additions
and
3 deletions
+97
-3
toolbar.c
dlls/comctl32/tests/toolbar.c
+91
-2
toolbar.c
dlls/comctl32/toolbar.c
+6
-1
No files found.
dlls/comctl32/tests/toolbar.c
View file @
d93ae6ff
...
...
@@ -490,13 +490,81 @@ static void add_128x15_bitmap(HWND hToolbar, int nCmds)
static
void
test_add_bitmap
(
void
)
{
TBADDBITMAP
stdsmall
,
std
;
HWND
hToolbar
=
NULL
;
TBADDBITMAP
bmp128
;
TBADDBITMAP
bmp80
;
TBADDBITMAP
stdsmall
;
TBADDBITMAP
addbmp
;
HIMAGELIST
himl
;
INT
ret
;
INT
ret
,
id
;
/* Test default bitmaps range */
for
(
id
=
IDB_STD_SMALL_COLOR
;
id
<
IDB_HIST_LARGE_COLOR
;
id
++
)
{
HIMAGELIST
himl
;
int
cx
,
cy
,
count
;
rebuild_toolbar
(
&
hToolbar
);
std
.
hInst
=
HINST_COMMCTRL
;
std
.
nID
=
id
;
ret
=
SendMessageA
(
hToolbar
,
TB_ADDBITMAP
,
0
,
(
LPARAM
)
&
std
);
ok
(
ret
==
0
,
"Got %d
\n
"
,
ret
);
himl
=
(
HIMAGELIST
)
SendMessageA
(
hToolbar
,
TB_GETIMAGELIST
,
0
,
0
);
ok
(
himl
!=
NULL
,
"Got %p
\n
"
,
himl
);
ret
=
ImageList_GetIconSize
(
himl
,
&
cx
,
&
cy
);
ok
(
ret
,
"Got %d
\n
"
,
ret
);
ok
(
cx
==
cy
,
"Got %d x %d
\n
"
,
cx
,
cy
);
count
=
ImageList_GetImageCount
(
himl
);
/* Image count */
switch
(
id
)
{
case
IDB_STD_SMALL_COLOR
:
case
IDB_STD_LARGE_COLOR
:
case
2
:
case
3
:
ok
(
count
==
15
,
"got count %d
\n
"
,
count
);
break
;
case
IDB_VIEW_SMALL_COLOR
:
case
IDB_VIEW_LARGE_COLOR
:
case
6
:
case
7
:
ok
(
count
==
12
,
"got count %d
\n
"
,
count
);
break
;
case
IDB_HIST_SMALL_COLOR
:
case
IDB_HIST_LARGE_COLOR
:
ok
(
count
==
5
,
"got count %d
\n
"
,
count
);
break
;
default:
ok
(
0
,
"id %d, count %d
\n
"
,
id
,
count
);
}
/* Image sizes */
switch
(
id
)
{
case
IDB_STD_SMALL_COLOR
:
case
2
:
case
IDB_VIEW_SMALL_COLOR
:
case
6
:
case
IDB_HIST_SMALL_COLOR
:
ok
(
cx
==
16
,
"got size %d
\n
"
,
cx
);
break
;
case
IDB_STD_LARGE_COLOR
:
case
3
:
case
IDB_VIEW_LARGE_COLOR
:
case
7
:
case
IDB_HIST_LARGE_COLOR
:
ok
(
cx
==
24
,
"got size %d
\n
"
,
cx
);
break
;
default:
ok
(
0
,
"id %d, size %d
\n
"
,
id
,
cx
);
}
}
/* empty 128x15 bitmap */
bmp128
.
hInst
=
GetModuleHandleA
(
NULL
);
...
...
@@ -2409,6 +2477,26 @@ todo_wine
DestroyWindow
(
hwnd
);
}
static
void
test_imagelist
(
void
)
{
HIMAGELIST
imagelist
;
HWND
hwnd
=
NULL
;
int
ret
;
rebuild_toolbar
(
&
hwnd
);
imagelist
=
(
HIMAGELIST
)
SendMessageA
(
hwnd
,
TB_GETIMAGELIST
,
0
,
0
);
ok
(
imagelist
==
NULL
,
"got %p
\n
"
,
imagelist
);
ret
=
SendMessageA
(
hwnd
,
TB_SETBITMAPSIZE
,
0
,
MAKELONG
(
16
,
16
));
ok
(
ret
,
"got %d
\n
"
,
ret
);
imagelist
=
(
HIMAGELIST
)
SendMessageA
(
hwnd
,
TB_GETIMAGELIST
,
0
,
0
);
ok
(
imagelist
==
NULL
,
"got %p
\n
"
,
imagelist
);
DestroyWindow
(
hwnd
);
}
START_TEST
(
toolbar
)
{
WNDCLASSA
wc
;
...
...
@@ -2454,6 +2542,7 @@ START_TEST(toolbar)
test_noresize
();
test_save
();
test_drawtext_flags
();
test_imagelist
();
PostQuitMessage
(
0
);
while
(
GetMessageA
(
&
msg
,
0
,
0
,
0
))
{
...
...
dlls/comctl32/toolbar.c
View file @
d93ae6ff
...
...
@@ -2810,18 +2810,22 @@ TOOLBAR_AddBitmap (TOOLBAR_INFO *infoPtr, INT count, const TBADDBITMAP *lpAddBmp
switch
(
lpAddBmp
->
nID
)
{
case
IDB_STD_SMALL_COLOR
:
case
2
:
info
.
nButtons
=
15
;
info
.
nID
=
IDB_STD_SMALL
;
break
;
case
IDB_STD_LARGE_COLOR
:
case
3
:
info
.
nButtons
=
15
;
info
.
nID
=
IDB_STD_LARGE
;
break
;
case
IDB_VIEW_SMALL_COLOR
:
case
6
:
info
.
nButtons
=
12
;
info
.
nID
=
IDB_VIEW_SMALL
;
break
;
case
IDB_VIEW_LARGE_COLOR
:
case
7
:
info
.
nButtons
=
12
;
info
.
nID
=
IDB_VIEW_LARGE
;
break
;
...
...
@@ -2834,6 +2838,7 @@ TOOLBAR_AddBitmap (TOOLBAR_INFO *infoPtr, INT count, const TBADDBITMAP *lpAddBmp
info
.
nID
=
IDB_HIST_LARGE
;
break
;
default:
WARN
(
"unknown bitmap id, %ld
\n
"
,
lpAddBmp
->
nID
);
return
-
1
;
}
...
...
@@ -4346,7 +4351,7 @@ TOOLBAR_SetBitmapSize (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
short
width
=
(
short
)
LOWORD
(
lParam
);
short
height
=
(
short
)
HIWORD
(
lParam
);
TRACE
(
"hwnd=%p, wParam=%ld,
lParam=%ld
\n
"
,
infoPtr
->
hwndSelf
,
wParam
,
lParam
);
TRACE
(
"hwnd=%p, wParam=%ld,
size %d x %d
\n
"
,
infoPtr
->
hwndSelf
,
wParam
,
width
,
height
);
if
(
wParam
!=
0
)
FIXME
(
"wParam is %ld. Perhaps image list index?
\n
"
,
wParam
);
...
...
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