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
f596eceb
Commit
f596eceb
authored
Apr 29, 2002
by
Marco Bizzarri
Committed by
Alexandre Julliard
Apr 29, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented the TB_REPLACEBITMAP message.
parent
aa04a6f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
2 deletions
+95
-2
toolbar.c
dlls/comctl32/toolbar.c
+95
-2
No files found.
dlls/comctl32/toolbar.c
View file @
f596eceb
...
...
@@ -89,6 +89,13 @@ typedef struct
typedef
struct
{
UINT
nButtons
;
HINSTANCE
hInst
;
UINT
nID
;
}
TBITMAP_INFO
;
typedef
struct
{
DWORD
dwStructSize
;
/* size of TBBUTTON struct */
INT
nHeight
;
/* height of the toolbar */
INT
nWidth
;
/* width of the toolbar */
...
...
@@ -104,6 +111,7 @@ typedef struct
INT
nNumButtons
;
/* number of buttons */
INT
nNumBitmaps
;
/* number of bitmaps */
INT
nNumStrings
;
/* number of strings */
INT
nNumBitmapInfos
;
BOOL
bUnicode
;
/* ASCII (FALSE) or Unicode (TRUE)? */
BOOL
bCaptured
;
/* mouse captured? */
INT
nButtonDown
;
...
...
@@ -139,6 +147,7 @@ typedef struct
TBUTTON_INFO
*
buttons
;
/* pointer to button array */
LPWSTR
*
strings
;
/* pointer to string array */
TBITMAP_INFO
*
bitmaps
;
}
TOOLBAR_INFO
,
*
PTOOLBAR_INFO
;
...
...
@@ -2200,6 +2209,26 @@ TOOLBAR_AddBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
DeleteObject
(
hbmLoad
);
}
TRACE
(
"Number of bitmap infos: %d
\n
"
,
infoPtr
->
nNumBitmapInfos
);
if
(
infoPtr
->
nNumBitmapInfos
==
0
)
{
infoPtr
->
bitmaps
=
COMCTL32_Alloc
(
sizeof
(
TBITMAP_INFO
));
}
else
{
TBITMAP_INFO
*
oldBitmaps
=
infoPtr
->
bitmaps
;
infoPtr
->
bitmaps
=
COMCTL32_Alloc
((
infoPtr
->
nNumBitmapInfos
+
1
)
*
sizeof
(
TBITMAP_INFO
));
memcpy
(
&
infoPtr
->
bitmaps
[
0
],
&
oldBitmaps
[
0
],
infoPtr
->
nNumBitmapInfos
);
}
infoPtr
->
bitmaps
[
infoPtr
->
nNumBitmapInfos
].
nButtons
=
nButtons
;
infoPtr
->
bitmaps
[
infoPtr
->
nNumBitmapInfos
].
hInst
=
lpAddBmp
->
hInst
;
infoPtr
->
bitmaps
[
infoPtr
->
nNumBitmapInfos
].
nID
=
lpAddBmp
->
nID
;
infoPtr
->
nNumBitmapInfos
++
;
TRACE
(
"Number of bitmap infos: %d
\n
"
,
infoPtr
->
nNumBitmapInfos
);
if
(
nIndex
!=
-
1
)
{
INT
imagecount
=
ImageList_GetImageCount
(
infoPtr
->
himlDef
);
...
...
@@ -3625,8 +3654,71 @@ TOOLBAR_PressButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
/* << TOOLBAR_ReplaceBitmap >> */
static
LRESULT
TOOLBAR_ReplaceBitmap
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TOOLBAR_INFO
*
infoPtr
=
TOOLBAR_GetInfoPtr
(
hwnd
);
LPTBREPLACEBITMAP
lpReplace
=
(
LPTBREPLACEBITMAP
)
lParam
;
HBITMAP
hBitmap
;
int
i
=
0
,
nOldButtons
=
0
,
pos
=
0
;
TRACE
(
"hInstOld %x nIDOld %x hInstNew %x nIDNew %x nButtons %x
\n
"
,
lpReplace
->
hInstOld
,
lpReplace
->
nIDOld
,
lpReplace
->
hInstNew
,
lpReplace
->
nIDNew
,
lpReplace
->
nButtons
);
if
(
lpReplace
->
hInstOld
==
-
1
)
{
FIXME
(
"changing standard bitmaps not implemented
\n
"
);
return
FALSE
;
}
else
if
(
lpReplace
->
hInstOld
!=
0
)
{
FIXME
(
"resources not in the current module not implemented
\n
"
);
return
FALSE
;
}
else
{
hBitmap
=
(
HBITMAP
)
lpReplace
->
nIDNew
;
}
TRACE
(
"To be replaced hInstOld %x nIDOld %x
\n
"
,
lpReplace
->
hInstOld
,
lpReplace
->
nIDOld
);
for
(
i
=
0
;
i
<
infoPtr
->
nNumBitmapInfos
;
i
++
)
{
TBITMAP_INFO
*
tbi
=
&
infoPtr
->
bitmaps
[
i
];
TRACE
(
"tbimapinfo %d hInstOld %x nIDOld %x
\n
"
,
i
,
tbi
->
hInst
,
tbi
->
nID
);
if
(
tbi
->
hInst
==
lpReplace
->
hInstOld
&&
tbi
->
nID
==
lpReplace
->
nIDOld
)
{
TRACE
(
"Found: nButtons %d hInst %x nID %x
\n
"
,
tbi
->
nButtons
,
tbi
->
hInst
,
tbi
->
nID
);
nOldButtons
=
tbi
->
nButtons
;
tbi
->
nButtons
=
lpReplace
->
nButtons
;
tbi
->
hInst
=
lpReplace
->
hInstNew
;
tbi
->
nID
=
lpReplace
->
nIDNew
;
TRACE
(
"tbimapinfo changed %d hInstOld %x nIDOld %x
\n
"
,
i
,
tbi
->
hInst
,
tbi
->
nID
);
break
;
}
pos
+=
tbi
->
nButtons
;
}
if
(
nOldButtons
==
0
)
{
WARN
(
"No hinst/bitmap found! hInst %x nID %x
\n
"
,
lpReplace
->
hInstOld
,
lpReplace
->
nIDOld
);
return
FALSE
;
}
infoPtr
->
nNumBitmaps
=
infoPtr
->
nNumBitmaps
-
nOldButtons
+
lpReplace
->
nButtons
;
/* ImageList_Replace(infoPtr->himlDef, pos, hBitmap, NULL); */
for
(
i
=
pos
+
nOldButtons
-
1
;
i
>=
pos
;
i
--
)
{
ImageList_Remove
(
infoPtr
->
himlDef
,
i
);
}
ImageList_AddMasked
(
infoPtr
->
himlDef
,
hBitmap
,
CLR_DEFAULT
);
InvalidateRect
(
hwnd
,
NULL
,
FALSE
);
return
TRUE
;
}
static
LRESULT
TOOLBAR_SaveRestoreA
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
...
...
@@ -5531,7 +5623,8 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case
TB_PRESSBUTTON
:
return
TOOLBAR_PressButton
(
hwnd
,
wParam
,
lParam
);
/* case TB_REPLACEBITMAP: */
case
TB_REPLACEBITMAP
:
return
TOOLBAR_ReplaceBitmap
(
hwnd
,
wParam
,
lParam
);
case
TB_SAVERESTOREA
:
return
TOOLBAR_SaveRestoreA
(
hwnd
,
wParam
,
lParam
);
...
...
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