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
7f7cde0e
Commit
7f7cde0e
authored
Nov 21, 2003
by
Rein Klazes
Committed by
Alexandre Julliard
Nov 21, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some confusion between number of bitmaps and number of buttons in
TOOLBAR_ReplaceBitmap().
parent
4a8e3395
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
toolbar.c
dlls/comctl32/toolbar.c
+13
-7
No files found.
dlls/comctl32/toolbar.c
View file @
7f7cde0e
...
...
@@ -3801,7 +3801,8 @@ TOOLBAR_PressButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
return
TRUE
;
}
/* FIXME: there might still be some confusion her between number of buttons
* and number of bitmaps */
static
LRESULT
TOOLBAR_ReplaceBitmap
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
...
...
@@ -3809,6 +3810,7 @@ TOOLBAR_ReplaceBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
LPTBREPLACEBITMAP
lpReplace
=
(
LPTBREPLACEBITMAP
)
lParam
;
HBITMAP
hBitmap
;
int
i
=
0
,
nOldButtons
=
0
,
pos
=
0
;
int
nOldBitmaps
,
nNewBitmaps
;
HIMAGELIST
himlDef
=
0
;
TRACE
(
"hInstOld %p nIDOld %x hInstNew %p nIDNew %x nButtons %x
\n
"
,
...
...
@@ -3852,16 +3854,14 @@ TOOLBAR_ReplaceBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
WARN
(
"No hinst/bitmap found! hInst %p nID %x
\n
"
,
lpReplace
->
hInstOld
,
lpReplace
->
nIDOld
);
return
FALSE
;
}
infoPtr
->
nNumBitmaps
=
infoPtr
->
nNumBitmaps
-
nOldButtons
+
lpReplace
->
nButtons
;
himlDef
=
GETDEFIMAGELIST
(
infoPtr
,
0
);
/* fixme: correct? */
nOldBitmaps
=
ImageList_GetImageCount
(
himlDef
);
/* ImageList_Replace(GETDEFIMAGELIST(), pos, hBitmap, NULL); */
himlDef
=
GETDEFIMAGELIST
(
infoPtr
,
0
);
for
(
i
=
pos
+
nOldButtons
-
1
;
i
>=
pos
;
i
--
)
{
for
(
i
=
pos
+
nOldBitmaps
-
1
;
i
>=
pos
;
i
--
)
ImageList_Remove
(
himlDef
,
i
);
}
{
BITMAP
bmp
;
...
...
@@ -3891,9 +3891,15 @@ TOOLBAR_ReplaceBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
DeleteDC
(
hdcBitmap
);
ImageList_AddMasked
(
himlDef
,
hbmLoad
,
CLR_DEFAULT
);
nNewBitmaps
=
ImageList_GetImageCount
(
himlDef
);
DeleteObject
(
hbmLoad
);
}
infoPtr
->
nNumBitmaps
=
infoPtr
->
nNumBitmaps
-
nOldBitmaps
+
nNewBitmaps
;
TRACE
(
" pos %d %d old bitmaps replaced by %d new ones.
\n
"
,
pos
,
nOldBitmaps
,
nNewBitmaps
);
InvalidateRect
(
hwnd
,
NULL
,
FALSE
);
return
TRUE
;
...
...
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