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
14a913c2
Commit
14a913c2
authored
Apr 24, 2002
by
Guy L. Albertelli
Committed by
Alexandre Julliard
Apr 24, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Improve I_IMAGECALLBACK handling and support I_IMAGENONE.
- Implement TBN_HOTITEMCHANGE in the mouse move routine.
parent
69494b87
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
11 deletions
+29
-11
toolbar.c
dlls/comctl32/toolbar.c
+29
-11
No files found.
dlls/comctl32/toolbar.c
View file @
14a913c2
...
...
@@ -330,13 +330,15 @@ TOOLBAR_DrawImageList (TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HIMAGELIST h
if
(
!
himl
)
return
FALSE
;
if
(
!
TOOLBAR_IsValidBitmapIndex
(
infoPtr
,
btnPtr
->
iBitmap
))
{
if
(
btnPtr
->
iBitmap
==
I_IMAGENONE
)
return
FALSE
;
ERR
(
"index %d is not valid, max %d
\n
"
,
btnPtr
->
iBitmap
,
infoPtr
->
nNumBitmaps
);
return
FALSE
;
}
if
((
index
=
TOOLBAR_GetBitmapIndex
(
infoPtr
,
btnPtr
))
<
0
)
{
if
(
index
==
-
1
)
return
FALSE
;
if
((
index
==
I_IMAGECALLBACK
)
||
(
index
==
I_IMAGENONE
))
return
FALSE
;
ERR
(
"TBN_GETDISPINFO returned invalid index %d
\n
"
,
index
);
return
FALSE
;
...
...
@@ -363,13 +365,15 @@ TOOLBAR_TestImageExist (TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HIMAGELIST
if
(
!
himl
)
return
FALSE
;
if
(
!
TOOLBAR_IsValidBitmapIndex
(
infoPtr
,
btnPtr
->
iBitmap
))
{
if
(
btnPtr
->
iBitmap
==
I_IMAGENONE
)
return
FALSE
;
ERR
(
"index %d is not valid, max %d
\n
"
,
btnPtr
->
iBitmap
,
infoPtr
->
nNumBitmaps
);
return
FALSE
;
}
if
((
index
=
TOOLBAR_GetBitmapIndex
(
infoPtr
,
btnPtr
))
<
0
)
{
if
(
index
==
-
1
)
return
FALSE
;
if
((
index
==
I_IMAGECALLBACK
)
||
(
index
==
I_IMAGENONE
))
return
FALSE
;
ERR
(
"TBN_GETDISPINFO returned invalid index %d
\n
"
,
index
);
return
FALSE
;
...
...
@@ -4870,11 +4874,12 @@ TOOLBAR_MouseLeave (HWND hwnd, WPARAM wParam, LPARAM lParam)
static
LRESULT
TOOLBAR_MouseMove
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TBUTTON_INFO
*
btnPtr
,
*
oldBtnPtr
;
TBUTTON_INFO
*
btnPtr
=
NULL
,
*
oldBtnPtr
=
NULL
;
TOOLBAR_INFO
*
infoPtr
=
TOOLBAR_GetInfoPtr
(
hwnd
);
POINT
pt
;
INT
nHit
;
TRACKMOUSEEVENT
trackinfo
;
NMTBHOTITEM
nmhotitem
;
/* fill in the TRACKMOUSEEVENT struct */
trackinfo
.
cbSize
=
sizeof
(
TRACKMOUSEEVENT
);
...
...
@@ -4912,10 +4917,7 @@ TOOLBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
oldBtnPtr
=
&
infoPtr
->
buttons
[
infoPtr
->
nOldHit
];
oldBtnPtr
->
bHot
=
FALSE
;
InvalidateRect
(
hwnd
,
&
oldBtnPtr
->
rect
,
TOOLBAR_HasText
(
infoPtr
,
oldBtnPtr
));
}
}
/* It's not a separator or in nowhere. It's a hot button. */
if
(
nHit
>=
0
)
...
...
@@ -4928,13 +4930,29 @@ TOOLBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
if
(
infoPtr
->
buttons
[
nHit
].
fsState
&
TBSTATE_ENABLED
)
{
btnPtr
->
bHot
=
TRUE
;
InvalidateRect
(
hwnd
,
&
btnPtr
->
rect
,
TOOLBAR_HasText
(
infoPtr
,
btnPtr
));
}
}
if
(
infoPtr
->
bCaptured
)
{
nmhotitem
.
dwFlags
=
HICF_MOUSE
;
if
(
oldBtnPtr
)
nmhotitem
.
idOld
=
oldBtnPtr
->
idCommand
;
else
nmhotitem
.
dwFlags
|=
HICF_ENTERING
;
if
(
btnPtr
)
nmhotitem
.
idNew
=
btnPtr
->
idCommand
;
else
nmhotitem
.
dwFlags
|=
HICF_LEAVING
;
TOOLBAR_SendNotify
((
NMHDR
*
)
&
nmhotitem
,
infoPtr
,
TBN_HOTITEMCHANGE
);
/* now invalidate the old and new buttons so they will be painted */
if
(
oldBtnPtr
)
InvalidateRect
(
hwnd
,
&
oldBtnPtr
->
rect
,
TOOLBAR_HasText
(
infoPtr
,
oldBtnPtr
));
if
(
btnPtr
&&
(
btnPtr
->
fsState
&
TBSTATE_ENABLED
))
InvalidateRect
(
hwnd
,
&
btnPtr
->
rect
,
TOOLBAR_HasText
(
infoPtr
,
btnPtr
));
if
(
infoPtr
->
bCaptured
)
{
btnPtr
=
&
infoPtr
->
buttons
[
infoPtr
->
nButtonDown
];
if
(
infoPtr
->
nOldHit
==
infoPtr
->
nButtonDown
)
{
btnPtr
->
fsState
&=
~
TBSTATE_PRESSED
;
...
...
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