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
5c5a0608
Commit
5c5a0608
authored
Jun 28, 2004
by
Robert Shearman
Committed by
Alexandre Julliard
Jun 28, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Clean up the mask drawing code.
- Improve bitmap not found message.
parent
f3b681a2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
toolbar.c
dlls/comctl32/toolbar.c
+13
-13
No files found.
dlls/comctl32/toolbar.c
View file @
5c5a0608
...
...
@@ -407,7 +407,7 @@ TOOLBAR_GetImageListForDrawing (TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, IMA
if
(
!
TOOLBAR_IsValidBitmapIndex
(
infoPtr
,
btnPtr
->
iBitmap
))
{
if
(
btnPtr
->
iBitmap
==
I_IMAGENONE
)
return
NULL
;
ERR
(
"
index %d,%d is not valid, max
%d
\n
"
,
ERR
(
"
bitmap for ID %d, index %d is not valid, number of bitmaps in imagelist:
%d
\n
"
,
HIWORD
(
btnPtr
->
iBitmap
),
LOWORD
(
btnPtr
->
iBitmap
),
infoPtr
->
nNumBitmaps
);
return
NULL
;
}
...
...
@@ -641,15 +641,8 @@ TOOLBAR_DrawPattern (LPRECT lpRect, NMTBCUSTOMDRAW *tbcd)
}
static
void
TOOLBAR_DrawMasked
(
TOOLBAR_INFO
*
infoPtr
,
TBUTTON_INFO
*
btnPtr
,
HDC
hdc
,
INT
x
,
INT
y
)
static
void
TOOLBAR_DrawMasked
(
HIMAGELIST
himl
,
int
index
,
HDC
hdc
,
INT
x
,
INT
y
,
UINT
draw_flags
)
{
int
index
;
HIMAGELIST
himl
=
TOOLBAR_GetImageListForDrawing
(
infoPtr
,
btnPtr
,
IMAGE_LIST_DEFAULT
,
&
index
);
if
(
himl
)
{
INT
cx
,
cy
;
HBITMAP
hbmMask
,
hbmImage
;
HDC
hdcMask
,
hdcImage
;
...
...
@@ -662,7 +655,7 @@ static void TOOLBAR_DrawMasked(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr,
GetDeviceCaps
(
hdc
,
BITSPIXEL
),
NULL
);
SelectObject
(
hdcImage
,
hbmImage
);
ImageList_DrawEx
(
himl
,
index
,
hdcImage
,
0
,
0
,
cx
,
cy
,
RGB
(
0xff
,
0xff
,
0xff
),
RGB
(
0
,
0
,
0
),
ILD_NORMAL
);
RGB
(
0xff
,
0xff
,
0xff
),
RGB
(
0
,
0
,
0
),
draw_flags
);
/* Create Mask */
hdcMask
=
CreateCompatibleDC
(
0
);
...
...
@@ -688,7 +681,6 @@ static void TOOLBAR_DrawMasked(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr,
DeleteDC
(
hdcImage
);
DeleteObject
(
hbmMask
);
DeleteDC
(
hdcMask
);
}
}
...
...
@@ -721,8 +713,11 @@ TOOLBAR_DrawImage(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, INT left, INT top
{
himl
=
TOOLBAR_GetImageListForDrawing
(
infoPtr
,
btnPtr
,
IMAGE_LIST_DISABLED
,
&
index
);
if
(
!
himl
)
{
himl
=
TOOLBAR_GetImageListForDrawing
(
infoPtr
,
btnPtr
,
IMAGE_LIST_DEFAULT
,
&
index
);
draw_masked
=
TRUE
;
}
}
else
if
((
tbcd
->
nmcd
.
uItemState
&
CDIS_HOT
)
&&
(
infoPtr
->
dwStyle
&
TBSTYLE_FLAT
))
{
/* if hot, attempt to draw with hot image list, if fails,
...
...
@@ -734,6 +729,9 @@ TOOLBAR_DrawImage(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, INT left, INT top
else
himl
=
TOOLBAR_GetImageListForDrawing
(
infoPtr
,
btnPtr
,
IMAGE_LIST_DEFAULT
,
&
index
);
if
(
!
himl
)
return
;
if
(
!
(
infoPtr
->
dwItemCDFlag
&
TBCDRF_NOOFFSET
)
&&
(
tbcd
->
nmcd
.
uItemState
&
(
CDIS_SELECTED
|
CDIS_CHECKED
)))
offset
=
1
;
...
...
@@ -746,8 +744,8 @@ TOOLBAR_DrawImage(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, INT left, INT top
index
,
himl
,
left
,
top
,
offset
);
if
(
draw_masked
)
TOOLBAR_DrawMasked
(
infoPtr
,
btnPtr
,
tbcd
->
nmcd
.
hdc
,
left
+
offset
,
top
+
offset
);
else
if
(
himl
)
TOOLBAR_DrawMasked
(
himl
,
index
,
tbcd
->
nmcd
.
hdc
,
left
+
offset
,
top
+
offset
,
draw_flags
);
else
ImageList_Draw
(
himl
,
index
,
tbcd
->
nmcd
.
hdc
,
left
+
offset
,
top
+
offset
,
draw_flags
);
}
...
...
@@ -5313,6 +5311,8 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
NMTOOLBARA
nmtb
;
BOOL
bDragKeyPressed
;
TRACE
(
"
\n
"
);
if
(
infoPtr
->
dwStyle
&
TBSTYLE_ALTDRAG
)
bDragKeyPressed
=
(
GetKeyState
(
VK_MENU
)
<
0
);
else
...
...
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