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
abd673bd
Commit
abd673bd
authored
Apr 28, 2015
by
Huw Davies
Committed by
Alexandre Julliard
Apr 28, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: A change in TBSTYLE_WRAPABLE should produce a recalc.
parent
e82b9dc3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
3 deletions
+47
-3
toolbar.c
dlls/comctl32/tests/toolbar.c
+44
-2
toolbar.c
dlls/comctl32/toolbar.c
+3
-1
No files found.
dlls/comctl32/tests/toolbar.c
View file @
abd673bd
...
...
@@ -1388,12 +1388,12 @@ static void restore_recalc_state(HWND hToolbar)
RECT
rect
;
/* return to style with a 2px top margin */
SetWindowLongA
(
hToolbar
,
GWL_STYLE
,
GetWindowLongA
(
hToolbar
,
GWL_STYLE
)
&
~
TBSTYLE_FLAT
);
SendMessageA
(
hToolbar
,
TB_GETSTYLE
,
0
,
0
)
&
~
TBSTYLE_FLAT
);
/* recalc */
SendMessageA
(
hToolbar
,
TB_ADDBUTTONSA
,
1
,
(
LPARAM
)
&
buttons3
[
3
]);
/* top margin will be 0px if a recalc occurs */
SetWindowLongA
(
hToolbar
,
GWL_STYLE
,
GetWindowLongA
(
hToolbar
,
GWL_STYLE
)
|
TBSTYLE_FLAT
);
SendMessageA
(
hToolbar
,
TB_GETSTYLE
,
0
,
0
)
|
TBSTYLE_FLAT
);
/* safety check */
SendMessageA
(
hToolbar
,
TB_GETITEMRECT
,
1
,
(
LPARAM
)
&
rect
);
ok
(
rect
.
top
==
2
,
"Test will make no sense because initial top is %d instead of 2
\n
"
,
...
...
@@ -1408,6 +1408,7 @@ static void test_recalc(void)
const
int
EX_STYLES_COUNT
=
5
;
int
i
;
BOOL
recalc
;
DWORD
style
;
/* Like TB_ADDBUTTONSA tested in test_sized, inserting a button without text
* results in a relayout, while adding one with text forces a recalc */
...
...
@@ -1468,6 +1469,47 @@ static void test_recalc(void)
/* undocumented exstyle 0x2 seems to change the top margin, which
* interferes with these tests */
/* Show that a change in TBSTYLE_WRAPABLE causes a recalc */
prepare_recalc_test
(
&
hToolbar
);
style
=
SendMessageA
(
hToolbar
,
TB_GETSTYLE
,
0
,
0
);
SendMessageA
(
hToolbar
,
TB_SETSTYLE
,
0
,
style
);
recalc
=
did_recalc
(
hToolbar
);
ok
(
!
recalc
,
"recalc %d
\n
"
,
recalc
);
SendMessageA
(
hToolbar
,
TB_SETSTYLE
,
0
,
style
|
TBSTYLE_TOOLTIPS
|
TBSTYLE_TRANSPARENT
|
CCS_BOTTOM
);
recalc
=
did_recalc
(
hToolbar
);
ok
(
!
recalc
,
"recalc %d
\n
"
,
recalc
);
SendMessageA
(
hToolbar
,
TB_SETSTYLE
,
0
,
style
|
TBSTYLE_WRAPABLE
);
recalc
=
did_recalc
(
hToolbar
);
ok
(
recalc
,
"recalc %d
\n
"
,
recalc
);
restore_recalc_state
(
hToolbar
);
SendMessageA
(
hToolbar
,
TB_SETSTYLE
,
0
,
style
|
TBSTYLE_WRAPABLE
);
recalc
=
did_recalc
(
hToolbar
);
ok
(
!
recalc
,
"recalc %d
\n
"
,
recalc
);
SendMessageA
(
hToolbar
,
TB_SETSTYLE
,
0
,
style
);
recalc
=
did_recalc
(
hToolbar
);
ok
(
recalc
,
"recalc %d
\n
"
,
recalc
);
restore_recalc_state
(
hToolbar
);
/* Changing CCS_VERT does not recalc */
SendMessageA
(
hToolbar
,
TB_SETSTYLE
,
0
,
style
|
CCS_VERT
);
recalc
=
did_recalc
(
hToolbar
);
ok
(
!
recalc
,
"recalc %d
\n
"
,
recalc
);
restore_recalc_state
(
hToolbar
);
SendMessageA
(
hToolbar
,
TB_SETSTYLE
,
0
,
style
);
recalc
=
did_recalc
(
hToolbar
);
ok
(
!
recalc
,
"recalc %d
\n
"
,
recalc
);
restore_recalc_state
(
hToolbar
);
/* Setting the window's style directly also causes recalc */
SetWindowLongA
(
hToolbar
,
GWL_STYLE
,
style
|
TBSTYLE_WRAPABLE
);
recalc
=
did_recalc
(
hToolbar
);
ok
(
recalc
,
"recalc %d
\n
"
,
recalc
);
DestroyWindow
(
hToolbar
);
}
...
...
dlls/comctl32/toolbar.c
View file @
abd673bd
...
...
@@ -4934,7 +4934,9 @@ TOOLBAR_SetStyle (TOOLBAR_INFO *infoPtr, DWORD style)
infoPtr
->
dwStyle
=
style
;
TOOLBAR_CheckStyle
(
infoPtr
);
if
((
dwOldStyle
^
style
)
&
(
TBSTYLE_WRAPABLE
|
CCS_VERT
))
if
((
dwOldStyle
^
style
)
&
TBSTYLE_WRAPABLE
)
TOOLBAR_CalcToolbar
(
infoPtr
);
else
if
((
dwOldStyle
^
style
)
&
CCS_VERT
)
TOOLBAR_LayoutToolbar
(
infoPtr
);
/* only resize if one of the CCS_* styles was changed */
...
...
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