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
797f4269
Commit
797f4269
authored
May 19, 2015
by
Huw Davies
Committed by
Alexandre Julliard
May 19, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Wrap the buttons inside the toolbar's client rect.
The toolbar need not be the same width as the parent.
parent
0bcadfa8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
16 deletions
+57
-16
toolbar.c
dlls/comctl32/tests/toolbar.c
+56
-0
toolbar.c
dlls/comctl32/toolbar.c
+1
-16
No files found.
dlls/comctl32/tests/toolbar.c
View file @
797f4269
...
@@ -2024,6 +2024,61 @@ static void test_TB_GET_SET_EXTENDEDSTYLE(void)
...
@@ -2024,6 +2024,61 @@ static void test_TB_GET_SET_EXTENDEDSTYLE(void)
DestroyWindow
(
hwnd
);
DestroyWindow
(
hwnd
);
}
}
static
void
test_noresize
(
void
)
{
HWND
wnd
;
int
i
;
TBBUTTON
button
=
{
0
,
10
,
TBSTATE_ENABLED
,
0
,
{
0
,
},
0
,
-
1
};
wnd
=
CreateWindowExA
(
0
,
TOOLBARCLASSNAMEA
,
NULL
,
WS_CHILD
|
WS_VISIBLE
|
CCS_NORESIZE
|
TBSTYLE_WRAPABLE
,
0
,
0
,
100
,
20
,
hMainWnd
,
(
HMENU
)
5
,
GetModuleHandleA
(
NULL
),
NULL
);
SendMessageA
(
wnd
,
TB_BUTTONSTRUCTSIZE
,
sizeof
(
TBBUTTON
),
0
);
for
(
i
=
0
;
i
<
30
;
i
++
)
{
button
.
idCommand
=
10
+
i
;
SendMessageA
(
wnd
,
TB_ADDBUTTONSA
,
1
,
(
LPARAM
)
&
button
);
}
SendMessageA
(
wnd
,
TB_SETSTATE
,
10
,
TBSTATE_WRAP
|
TBSTATE_ENABLED
);
/* autosize clears the wrap on button 0 */
SendMessageA
(
wnd
,
TB_AUTOSIZE
,
0
,
0
);
for
(
i
=
0
;
i
<
30
;
i
++
)
{
SendMessageA
(
wnd
,
TB_GETBUTTON
,
i
,
(
LPARAM
)
&
button
);
if
(
i
%
4
==
3
)
ok
(
button
.
fsState
==
(
TBSTATE_WRAP
|
TBSTATE_ENABLED
),
"%d: got %08x
\n
"
,
i
,
button
.
fsState
);
else
ok
(
button
.
fsState
==
TBSTATE_ENABLED
,
"%d: got %08x
\n
"
,
i
,
button
.
fsState
);
}
/* changing the parent doesn't do anything */
MoveWindow
(
hMainWnd
,
0
,
0
,
400
,
200
,
FALSE
);
for
(
i
=
0
;
i
<
30
;
i
++
)
{
SendMessageA
(
wnd
,
TB_GETBUTTON
,
i
,
(
LPARAM
)
&
button
);
if
(
i
%
4
==
3
)
ok
(
button
.
fsState
==
(
TBSTATE_WRAP
|
TBSTATE_ENABLED
),
"%d: got %08x
\n
"
,
i
,
button
.
fsState
);
else
ok
(
button
.
fsState
==
TBSTATE_ENABLED
,
"%d: got %08x
\n
"
,
i
,
button
.
fsState
);
}
/* again nothing here */
SendMessageA
(
wnd
,
TB_AUTOSIZE
,
0
,
0
);
for
(
i
=
0
;
i
<
30
;
i
++
)
{
SendMessageA
(
wnd
,
TB_GETBUTTON
,
i
,
(
LPARAM
)
&
button
);
if
(
i
%
4
==
3
)
ok
(
button
.
fsState
==
(
TBSTATE_WRAP
|
TBSTATE_ENABLED
),
"%d: got %08x
\n
"
,
i
,
button
.
fsState
);
else
ok
(
button
.
fsState
==
TBSTATE_ENABLED
,
"%d: got %08x
\n
"
,
i
,
button
.
fsState
);
}
DestroyWindow
(
wnd
);
}
START_TEST
(
toolbar
)
START_TEST
(
toolbar
)
{
{
WNDCLASSA
wc
;
WNDCLASSA
wc
;
...
@@ -2066,6 +2121,7 @@ START_TEST(toolbar)
...
@@ -2066,6 +2121,7 @@ START_TEST(toolbar)
test_get_set_style
();
test_get_set_style
();
test_create
();
test_create
();
test_TB_GET_SET_EXTENDEDSTYLE
();
test_TB_GET_SET_EXTENDEDSTYLE
();
test_noresize
();
PostQuitMessage
(
0
);
PostQuitMessage
(
0
);
while
(
GetMessageA
(
&
msg
,
0
,
0
,
0
))
{
while
(
GetMessageA
(
&
msg
,
0
,
0
,
0
))
{
...
...
dlls/comctl32/toolbar.c
View file @
797f4269
...
@@ -1282,7 +1282,6 @@ TOOLBAR_WrapToolbar(TOOLBAR_INFO *infoPtr)
...
@@ -1282,7 +1282,6 @@ TOOLBAR_WrapToolbar(TOOLBAR_INFO *infoPtr)
{
{
TBUTTON_INFO
*
btnPtr
;
TBUTTON_INFO
*
btnPtr
;
INT
x
,
cx
,
i
,
j
,
width
;
INT
x
,
cx
,
i
,
j
,
width
;
RECT
rc
;
BOOL
bButtonWrap
;
BOOL
bButtonWrap
;
/* When the toolbar window style is not TBSTYLE_WRAPABLE, */
/* When the toolbar window style is not TBSTYLE_WRAPABLE, */
...
@@ -1293,21 +1292,7 @@ TOOLBAR_WrapToolbar(TOOLBAR_INFO *infoPtr)
...
@@ -1293,21 +1292,7 @@ TOOLBAR_WrapToolbar(TOOLBAR_INFO *infoPtr)
btnPtr
=
infoPtr
->
buttons
;
btnPtr
=
infoPtr
->
buttons
;
x
=
infoPtr
->
nIndent
;
x
=
infoPtr
->
nIndent
;
width
=
infoPtr
->
client_rect
.
right
-
infoPtr
->
client_rect
.
left
;
if
(
GetParent
(
infoPtr
->
hwndSelf
))
{
/* this can get the parents width, to know how far we can extend
* this toolbar. We cannot use its height, as there may be multiple
* toolbars in a rebar control
*/
GetClientRect
(
GetParent
(
infoPtr
->
hwndSelf
),
&
rc
);
width
=
rc
.
right
-
rc
.
left
;
}
else
{
GetWindowRect
(
infoPtr
->
hwndSelf
,
&
rc
);
width
=
rc
.
right
-
rc
.
left
;
}
bButtonWrap
=
FALSE
;
bButtonWrap
=
FALSE
;
...
...
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