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
54b6ccd5
Commit
54b6ccd5
authored
Feb 10, 2004
by
Ulrich Czekalla
Committed by
Alexandre Julliard
Feb 10, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for BTNS_WHOLEDROPDOWN.
Populate button rect when sending TBN_DROPDOWN.
parent
bdb63eca
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
12 deletions
+23
-12
toolbar.c
dlls/comctl32/toolbar.c
+23
-12
No files found.
dlls/comctl32/toolbar.c
View file @
54b6ccd5
...
...
@@ -684,8 +684,11 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
{
TOOLBAR_INFO
*
infoPtr
=
TOOLBAR_GetInfoPtr
(
hwnd
);
DWORD
dwStyle
=
GetWindowLongA
(
hwnd
,
GWL_STYLE
);
BOOL
hasDropDownArrow
=
TOOLBAR_HasDropDownArrows
(
infoPtr
->
dwExStyle
)
&&
(
btnPtr
->
fsStyle
&
BTNS_DROPDOWN
);
BOOL
hasDropDownArrow
=
(
TOOLBAR_HasDropDownArrows
(
infoPtr
->
dwExStyle
)
&&
(
btnPtr
->
fsStyle
&
BTNS_DROPDOWN
))
||
(
btnPtr
->
fsStyle
&
BTNS_WHOLEDROPDOWN
);
BOOL
drawSepDropDownArrow
=
hasDropDownArrow
&&
(
~
btnPtr
->
fsStyle
&
BTNS_WHOLEDROPDOWN
);
RECT
rc
,
rcArrow
,
rcBitmap
,
rcText
,
rcFill
;
LPWSTR
lpText
=
NULL
;
NMTBCUSTOMDRAW
tbcd
;
...
...
@@ -705,11 +708,17 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
if
(
hasDropDownArrow
)
{
int
right
;
if
(
dwStyle
&
TBSTYLE_FLAT
)
r
c
.
r
ight
=
max
(
rc
.
left
,
rc
.
right
-
DDARROW_WIDTH
);
right
=
max
(
rc
.
left
,
rc
.
right
-
DDARROW_WIDTH
);
else
rc
.
right
=
max
(
rc
.
left
,
rc
.
right
-
DDARROW_WIDTH
-
2
);
rcArrow
.
left
=
rc
.
right
;
right
=
max
(
rc
.
left
,
rc
.
right
-
DDARROW_WIDTH
-
2
);
if
(
drawSepDropDownArrow
)
rc
.
right
=
right
;
rcArrow
.
left
=
right
;
}
/* copy text rect after adjusting for drop-down arrow
...
...
@@ -870,7 +879,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
{
DrawEdge
(
hdc
,
&
rc
,
EDGE_RAISED
,
BF_SOFT
|
BF_RECT
|
BF_MIDDLE
|
BF_ADJUST
);
if
(
has
DropDownArrow
)
if
(
drawSep
DropDownArrow
)
DrawEdge
(
hdc
,
&
rcArrow
,
EDGE_RAISED
,
BF_SOFT
|
BF_RECT
|
BF_MIDDLE
|
BF_ADJUST
);
}
...
...
@@ -899,13 +908,13 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
if
(
dwStyle
&
TBSTYLE_FLAT
)
{
DrawEdge
(
hdc
,
&
rc
,
BDR_SUNKENOUTER
,
BF_RECT
|
BF_ADJUST
);
if
(
has
DropDownArrow
)
if
(
drawSep
DropDownArrow
)
DrawEdge
(
hdc
,
&
rcArrow
,
BDR_SUNKENOUTER
,
BF_RECT
|
BF_ADJUST
);
}
else
{
DrawEdge
(
hdc
,
&
rc
,
EDGE_SUNKEN
,
BF_RECT
|
BF_MIDDLE
|
BF_ADJUST
);
if
(
has
DropDownArrow
)
if
(
drawSep
DropDownArrow
)
DrawEdge
(
hdc
,
&
rcArrow
,
EDGE_SUNKEN
,
BF_RECT
|
BF_MIDDLE
|
BF_ADJUST
);
}
}
...
...
@@ -989,7 +998,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
if
(
hasDropDownArrow
)
{
if
(
!
(
infoPtr
->
dwItemCDFlag
&
TBCDRF_NOEDGES
))
if
(
drawSepDropDownArrow
&&
!
(
infoPtr
->
dwItemCDFlag
&
TBCDRF_NOEDGES
))
DrawEdge
(
hdc
,
&
rcArrow
,
EDGE_RAISED
,
BF_SOFT
|
BF_RECT
|
BF_MIDDLE
|
BF_ADJUST
);
TOOLBAR_DrawArrow
(
hdc
,
rcArrow
.
left
,
rcArrow
.
top
+
(
rcArrow
.
bottom
-
rcArrow
.
top
-
ARROW_HEIGHT
)
/
2
,
COLOR_WINDOWFRAME
);
...
...
@@ -5012,9 +5021,11 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
arrowRect
.
left
=
max
(
btnPtr
->
rect
.
left
,
btnPtr
->
rect
.
right
-
DDARROW_WIDTH
);
/* for EX_DRAWDDARROWS style, click must be in the drop-down arrow rect */
if
((
btnPtr
->
fsState
&
TBSTATE_ENABLED
)
&&
(
btnPtr
->
fsStyle
&
BTNS_DROPDOWN
)
&&
if
((
btnPtr
->
fsState
&
TBSTATE_ENABLED
)
&&
((
btnPtr
->
fsStyle
&
BTNS_WHOLEDROPDOWN
)
||
((
btnPtr
->
fsStyle
&
BTNS_DROPDOWN
)
&&
((
TOOLBAR_HasDropDownArrows
(
infoPtr
->
dwExStyle
)
&&
PtInRect
(
&
arrowRect
,
pt
))
||
(
!
TOOLBAR_HasDropDownArrows
(
infoPtr
->
dwExStyle
))))
(
!
TOOLBAR_HasDropDownArrows
(
infoPtr
->
dwExStyle
))
))))
{
LRESULT
res
;
/*
...
...
@@ -5028,7 +5039,7 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
memset
(
&
nmtb
.
tbButton
,
0
,
sizeof
(
TBBUTTON
));
nmtb
.
cchText
=
0
;
nmtb
.
pszText
=
0
;
memset
(
&
nmtb
.
rcButton
,
0
,
sizeof
(
RECT
)
);
CopyRect
(
&
nmtb
.
rcButton
,
&
btnPtr
->
rect
);
res
=
TOOLBAR_SendNotify
((
NMHDR
*
)
&
nmtb
,
infoPtr
,
TBN_DROPDOWN
);
if
(
res
!=
TBDDRET_TREATPRESSED
)
...
...
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