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
7b899eab
Commit
7b899eab
authored
Oct 08, 2006
by
Mikołaj Zalewski
Committed by
Alexandre Julliard
Oct 09, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: toolbar: Move add/remove/setrect tooltip code to separate functions.
parent
03ec2183
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
88 deletions
+58
-88
toolbar.c
dlls/comctl32/toolbar.c
+58
-88
No files found.
dlls/comctl32/toolbar.c
View file @
7b899eab
...
...
@@ -251,6 +251,7 @@ static LRESULT TOOLBAR_LButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam);
static
void
TOOLBAR_SetHotItemEx
(
TOOLBAR_INFO
*
infoPtr
,
INT
nHit
,
DWORD
dwReason
);
static
LRESULT
TOOLBAR_AutoSize
(
HWND
hwnd
);
static
void
TOOLBAR_CheckImageListIconSize
(
TOOLBAR_INFO
*
infoPtr
);
static
void
TOOLBAR_TooltipSetRect
(
TOOLBAR_INFO
*
infoPtr
,
TBUTTON_INFO
*
button
);
static
LRESULT
TOOLBAR_NotifyFormat
(
TOOLBAR_INFO
*
infoPtr
,
WPARAM
wParam
,
LPARAM
lParam
);
...
...
@@ -1726,19 +1727,7 @@ TOOLBAR_CalcToolbar (HWND hwnd)
if
(
infoPtr
->
rcBound
.
bottom
<
y
+
cy
)
infoPtr
->
rcBound
.
bottom
=
y
+
cy
;
/* Set the toolTip only for non-hidden, non-separator button */
if
(
infoPtr
->
hwndToolTip
&&
!
(
btnPtr
->
fsStyle
&
BTNS_SEP
))
{
TTTOOLINFOW
ti
;
ZeroMemory
(
&
ti
,
sizeof
(
ti
));
ti
.
cbSize
=
sizeof
(
ti
);
ti
.
hwnd
=
hwnd
;
ti
.
uId
=
btnPtr
->
idCommand
;
ti
.
rect
=
btnPtr
->
rect
;
SendMessageW
(
infoPtr
->
hwndToolTip
,
TTM_NEWTOOLRECTW
,
0
,
(
LPARAM
)
&
ti
);
}
TOOLBAR_TooltipSetRect
(
infoPtr
,
btnPtr
);
/* btnPtr->nRow is zero based. The space between the rows is */
/* also considered as a row. */
...
...
@@ -1902,6 +1891,56 @@ TOOLBAR_RelayEvent (HWND hwndTip, HWND hwndMsg, UINT uMsg,
SendMessageW
(
hwndTip
,
TTM_RELAYEVENT
,
0
,
(
LPARAM
)
&
msg
);
}
static
void
TOOLBAR_TooltipAddTool
(
TOOLBAR_INFO
*
infoPtr
,
TBUTTON_INFO
*
button
)
{
if
(
infoPtr
->
hwndToolTip
&&
!
(
button
->
fsStyle
&
BTNS_SEP
))
{
TTTOOLINFOW
ti
;
ZeroMemory
(
&
ti
,
sizeof
(
TTTOOLINFOW
));
ti
.
cbSize
=
sizeof
(
TTTOOLINFOW
);
ti
.
hwnd
=
infoPtr
->
hwndSelf
;
ti
.
uId
=
button
->
idCommand
;
ti
.
hinst
=
0
;
ti
.
lpszText
=
LPSTR_TEXTCALLBACKW
;
/* ti.lParam = random value from the stack? */
SendMessageW
(
infoPtr
->
hwndToolTip
,
TTM_ADDTOOLW
,
0
,
(
LPARAM
)
&
ti
);
}
}
static
void
TOOLBAR_TooltipDelTool
(
TOOLBAR_INFO
*
infoPtr
,
TBUTTON_INFO
*
button
)
{
if
((
infoPtr
->
hwndToolTip
)
&&
!
(
button
->
fsStyle
&
BTNS_SEP
))
{
TTTOOLINFOW
ti
;
ZeroMemory
(
&
ti
,
sizeof
(
ti
));
ti
.
cbSize
=
sizeof
(
ti
);
ti
.
hwnd
=
infoPtr
->
hwndSelf
;
ti
.
uId
=
button
->
idCommand
;
SendMessageW
(
infoPtr
->
hwndToolTip
,
TTM_DELTOOLW
,
0
,
(
LPARAM
)
&
ti
);
}
}
static
void
TOOLBAR_TooltipSetRect
(
TOOLBAR_INFO
*
infoPtr
,
TBUTTON_INFO
*
button
)
{
/* Set the toolTip only for non-hidden, non-separator button */
if
(
infoPtr
->
hwndToolTip
&&
!
(
button
->
fsStyle
&
BTNS_SEP
))
{
TTTOOLINFOW
ti
;
ZeroMemory
(
&
ti
,
sizeof
(
ti
));
ti
.
cbSize
=
sizeof
(
ti
);
ti
.
hwnd
=
infoPtr
->
hwndSelf
;
ti
.
uId
=
button
->
idCommand
;
ti
.
rect
=
button
->
rect
;
SendMessageW
(
infoPtr
->
hwndToolTip
,
TTM_NEWTOOLRECTW
,
0
,
(
LPARAM
)
&
ti
);
}
}
/* keeps available button list box sorted by button id */
static
void
TOOLBAR_Cust_InsertAvailButton
(
HWND
hwnd
,
PCUSTOMBUTTON
btnInfoNew
)
{
...
...
@@ -2835,19 +2874,7 @@ TOOLBAR_AddButtonsA (HWND hwnd, WPARAM wParam, LPARAM lParam)
btnPtr
->
iString
=
lpTbb
[
nCount
].
iString
;
btnPtr
->
bHot
=
FALSE
;
if
((
infoPtr
->
hwndToolTip
)
&&
!
(
btnPtr
->
fsStyle
&
BTNS_SEP
))
{
TTTOOLINFOW
ti
;
ZeroMemory
(
&
ti
,
sizeof
(
ti
));
ti
.
cbSize
=
sizeof
(
ti
);
ti
.
hwnd
=
hwnd
;
ti
.
uId
=
btnPtr
->
idCommand
;
ti
.
hinst
=
0
;
ti
.
lpszText
=
LPSTR_TEXTCALLBACKW
;
SendMessageW
(
infoPtr
->
hwndToolTip
,
TTM_ADDTOOLW
,
0
,
(
LPARAM
)
&
ti
);
}
TOOLBAR_TooltipAddTool
(
infoPtr
,
btnPtr
);
}
TOOLBAR_CalcToolbar
(
hwnd
);
...
...
@@ -2903,20 +2930,7 @@ TOOLBAR_AddButtonsW (HWND hwnd, WPARAM wParam, LPARAM lParam)
btnPtr
->
iString
=
lpTbb
[
nCount
].
iString
;
btnPtr
->
bHot
=
FALSE
;
if
((
infoPtr
->
hwndToolTip
)
&&
!
(
btnPtr
->
fsStyle
&
BTNS_SEP
))
{
TTTOOLINFOW
ti
;
ZeroMemory
(
&
ti
,
sizeof
(
TTTOOLINFOW
));
ti
.
cbSize
=
sizeof
(
TTTOOLINFOW
);
ti
.
hwnd
=
hwnd
;
ti
.
uId
=
btnPtr
->
idCommand
;
ti
.
hinst
=
0
;
ti
.
lpszText
=
LPSTR_TEXTCALLBACKW
;
ti
.
lParam
=
lParam
;
SendMessageW
(
infoPtr
->
hwndToolTip
,
TTM_ADDTOOLW
,
0
,
(
LPARAM
)
&
ti
);
}
TOOLBAR_TooltipAddTool
(
infoPtr
,
btnPtr
);
}
TOOLBAR_CalcToolbar
(
hwnd
);
...
...
@@ -3251,17 +3265,7 @@ TOOLBAR_DeleteButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
nmtb
.
tbButton
.
iString
=
btnPtr
->
iString
;
TOOLBAR_SendNotify
(
&
nmtb
.
hdr
,
infoPtr
,
TBN_DELETINGBUTTON
);
if
((
infoPtr
->
hwndToolTip
)
&&
!
(
btnPtr
->
fsStyle
&
BTNS_SEP
))
{
TTTOOLINFOW
ti
;
ZeroMemory
(
&
ti
,
sizeof
(
ti
));
ti
.
cbSize
=
sizeof
(
ti
);
ti
.
hwnd
=
hwnd
;
ti
.
uId
=
infoPtr
->
buttons
[
nIndex
].
idCommand
;
SendMessageW
(
infoPtr
->
hwndToolTip
,
TTM_DELTOOLW
,
0
,
(
LPARAM
)
&
ti
);
}
TOOLBAR_TooltipDelTool
(
infoPtr
,
&
infoPtr
->
buttons
[
nIndex
]);
if
(
infoPtr
->
nNumButtons
==
1
)
{
TRACE
(
" simple delete!
\n
"
);
...
...
@@ -3909,19 +3913,7 @@ TOOLBAR_InsertButtonA (HWND hwnd, WPARAM wParam, LPARAM lParam)
else
infoPtr
->
buttons
[
nIndex
].
iString
=
lpTbb
->
iString
;
if
((
infoPtr
->
hwndToolTip
)
&&
!
(
lpTbb
->
fsStyle
&
BTNS_SEP
))
{
TTTOOLINFOW
ti
;
ZeroMemory
(
&
ti
,
sizeof
(
ti
));
ti
.
cbSize
=
sizeof
(
ti
);
ti
.
hwnd
=
hwnd
;
ti
.
uId
=
lpTbb
->
idCommand
;
ti
.
hinst
=
0
;
ti
.
lpszText
=
LPSTR_TEXTCALLBACKW
;
SendMessageW
(
infoPtr
->
hwndToolTip
,
TTM_ADDTOOLW
,
0
,
(
LPARAM
)
&
ti
);
}
TOOLBAR_TooltipAddTool
(
infoPtr
,
&
infoPtr
->
buttons
[
nIndex
]);
/* post insert copy */
if
(
nIndex
<
infoPtr
->
nNumButtons
-
1
)
{
...
...
@@ -4010,19 +4002,7 @@ TOOLBAR_InsertButtonW (HWND hwnd, WPARAM wParam, LPARAM lParam)
else
infoPtr
->
buttons
[
nIndex
].
iString
=
lpTbb
->
iString
;
if
((
infoPtr
->
hwndToolTip
)
&&
!
(
lpTbb
->
fsStyle
&
BTNS_SEP
))
{
TTTOOLINFOW
ti
;
ZeroMemory
(
&
ti
,
sizeof
(
TTTOOLINFOW
));
ti
.
cbSize
=
sizeof
(
TTTOOLINFOW
);
ti
.
hwnd
=
hwnd
;
ti
.
uId
=
lpTbb
->
idCommand
;
ti
.
hinst
=
0
;
ti
.
lpszText
=
LPSTR_TEXTCALLBACKW
;
SendMessageW
(
infoPtr
->
hwndToolTip
,
TTM_ADDTOOLW
,
0
,
(
LPARAM
)
&
ti
);
}
TOOLBAR_TooltipAddTool
(
infoPtr
,
&
infoPtr
->
buttons
[
nIndex
]);
/* post insert copy */
if
(
nIndex
<
infoPtr
->
nNumButtons
-
1
)
{
...
...
@@ -4441,20 +4421,10 @@ static void
TOOLBAR_DeleteAllButtons
(
TOOLBAR_INFO
*
infoPtr
)
{
INT
i
;
TTTOOLINFOW
ti
;
ZeroMemory
(
&
ti
,
sizeof
(
ti
));
ti
.
cbSize
=
sizeof
(
ti
);
ti
.
hwnd
=
infoPtr
->
hwndSelf
;
for
(
i
=
0
;
i
<
infoPtr
->
nNumButtons
;
i
++
)
{
if
((
infoPtr
->
hwndToolTip
)
&&
!
(
infoPtr
->
buttons
[
i
].
fsStyle
&
BTNS_SEP
))
{
ti
.
uId
=
infoPtr
->
buttons
[
i
].
idCommand
;
SendMessageW
(
infoPtr
->
hwndToolTip
,
TTM_DELTOOLW
,
0
,
(
LPARAM
)
&
ti
);
}
TOOLBAR_TooltipDelTool
(
infoPtr
,
&
infoPtr
->
buttons
[
i
]);
}
Free
(
infoPtr
->
buttons
);
...
...
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