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
54b6c767
Commit
54b6c767
authored
Jan 07, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 09, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Fix TB_SETSTYLE behaviour and return value.
parent
9a849104
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
5 deletions
+54
-5
toolbar.c
dlls/comctl32/tests/toolbar.c
+50
-0
toolbar.c
dlls/comctl32/toolbar.c
+4
-5
No files found.
dlls/comctl32/tests/toolbar.c
View file @
54b6c767
...
...
@@ -164,6 +164,7 @@ static void basic_test(void)
TBBUTTON
buttons
[
9
];
HWND
hToolbar
;
int
i
;
for
(
i
=
0
;
i
<
9
;
i
++
)
MakeButton
(
buttons
+
i
,
1000
+
i
,
TBSTYLE_CHECKGROUP
,
0
);
MakeButton
(
buttons
+
3
,
1003
,
TBSTYLE_SEP
|
TBSTYLE_GROUP
,
0
);
...
...
@@ -1633,6 +1634,54 @@ static void test_tooltip(void)
DestroyWindow
(
hToolbar
);
}
static
void
test_get_set_style
(
void
)
{
TBBUTTON
buttons
[
9
];
DWORD
style
,
style2
,
ret
;
HWND
hToolbar
;
int
i
;
for
(
i
=
0
;
i
<
9
;
i
++
)
MakeButton
(
buttons
+
i
,
1000
+
i
,
TBSTYLE_CHECKGROUP
,
0
);
MakeButton
(
buttons
+
3
,
1003
,
TBSTYLE_SEP
|
TBSTYLE_GROUP
,
0
);
MakeButton
(
buttons
+
6
,
1006
,
TBSTYLE_SEP
,
0
);
hToolbar
=
CreateToolbarEx
(
hMainWnd
,
WS_VISIBLE
|
WS_CLIPCHILDREN
|
CCS_TOP
|
WS_CHILD
|
TBSTYLE_LIST
,
100
,
0
,
NULL
,
0
,
buttons
,
sizeof
(
buttons
)
/
sizeof
(
buttons
[
0
]),
0
,
0
,
20
,
16
,
sizeof
(
TBBUTTON
));
ok
(
hToolbar
!=
NULL
,
"Toolbar creation
\n
"
);
SendMessage
(
hToolbar
,
TB_ADDSTRINGA
,
0
,
(
LPARAM
)
"test
\000
"
);
style
=
SendMessageA
(
hToolbar
,
TB_GETSTYLE
,
0
,
0
);
style2
=
GetWindowLongA
(
hToolbar
,
GWL_STYLE
);
todo_wine
ok
(
style
==
style2
,
"got 0x%08x, expected 0x%08x
\n
"
,
style
,
style2
);
/* try to alter common window bits */
style2
|=
WS_BORDER
;
ret
=
SendMessageA
(
hToolbar
,
TB_SETSTYLE
,
0
,
style2
);
ok
(
ret
==
0
,
"got %d
\n
"
,
ret
);
style
=
SendMessageA
(
hToolbar
,
TB_GETSTYLE
,
0
,
0
);
style2
=
GetWindowLongA
(
hToolbar
,
GWL_STYLE
);
ok
((
style
!=
style2
)
&&
(
style
==
(
style2
|
WS_BORDER
)),
"got 0x%08x, expected 0x%08x
\n
"
,
style
,
style2
);
ok
(
style
&
WS_BORDER
,
"got 0x%08x
\n
"
,
style
);
/* now styles are the same, alter window style */
ret
=
SendMessageA
(
hToolbar
,
TB_SETSTYLE
,
0
,
style2
);
ok
(
ret
==
0
,
"got %d
\n
"
,
ret
);
style2
|=
WS_BORDER
;
SetWindowLongA
(
hToolbar
,
GWL_STYLE
,
style2
);
style
=
SendMessageA
(
hToolbar
,
TB_GETSTYLE
,
0
,
0
);
ok
(
style
==
style2
,
"got 0x%08x, expected 0x%08x
\n
"
,
style
,
style2
);
DestroyWindow
(
hToolbar
);
}
START_TEST
(
toolbar
)
{
WNDCLASSA
wc
;
...
...
@@ -1672,6 +1721,7 @@ START_TEST(toolbar)
test_setrows
();
test_getstring
();
test_tooltip
();
test_get_set_style
();
PostQuitMessage
(
0
);
while
(
GetMessageA
(
&
msg
,
0
,
0
,
0
))
{
...
...
dlls/comctl32/toolbar.c
View file @
54b6c767
...
...
@@ -4908,11 +4908,10 @@ TOOLBAR_SetState (TOOLBAR_INFO *infoPtr, INT Id, LPARAM lParam)
static
LRESULT
TOOLBAR_SetStyle
(
TOOLBAR_INFO
*
infoPtr
,
LPARAM
lParam
)
TOOLBAR_SetStyle
(
TOOLBAR_INFO
*
infoPtr
,
DWORD
style
)
{
SetWindowLongW
(
infoPtr
->
hwndSelf
,
GWL_STYLE
,
lParam
);
return
TRUE
;
infoPtr
->
dwStyle
=
style
;
return
0
;
}
...
...
@@ -5155,7 +5154,7 @@ TOOLBAR_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
DWORD
dwStyle
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
LOGFONTW
logFont
;
TRACE
(
"hwnd = %p
\n
"
,
hwnd
);
TRACE
(
"hwnd = %p
, style=0x%08x
\n
"
,
hwnd
,
lpcs
->
style
);
infoPtr
->
dwStyle
=
dwStyle
;
GetClientRect
(
hwnd
,
&
infoPtr
->
client_rect
);
...
...
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