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
869c3bb7
Commit
869c3bb7
authored
Oct 08, 2006
by
Mikołaj Zalewski
Committed by
Alexandre Julliard
Oct 09, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: toolbar: Merge AddButtonsA and AddButtonsW into AddButtonsT.
parent
81050cca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
74 deletions
+11
-74
toolbar.c
dlls/comctl32/toolbar.c
+11
-74
No files found.
dlls/comctl32/toolbar.c
View file @
869c3bb7
...
...
@@ -2858,31 +2858,19 @@ TOOLBAR_AddBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
static
LRESULT
TOOLBAR_AddButtons
A
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
TOOLBAR_AddButtons
T
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
fUnicode
)
{
TOOLBAR_INFO
*
infoPtr
=
TOOLBAR_GetInfoPtr
(
hwnd
);
LPTBBUTTON
lpTbb
=
(
LPTBBUTTON
)
lParam
;
INT
nOldButtons
,
nNewButtons
,
nAddButtons
,
nCount
;
TRACE
(
"adding %d buttons
!
\n
"
,
wParam
);
TRACE
(
"adding %d buttons
(unicode=%d)!
\n
"
,
wParam
,
fUnicode
);
nAddButtons
=
(
UINT
)
wParam
;
nOldButtons
=
infoPtr
->
nNumButtons
;
nNewButtons
=
nOldButtons
+
nAddButtons
;
if
(
infoPtr
->
nNumButtons
==
0
)
{
infoPtr
->
buttons
=
Alloc
(
sizeof
(
TBUTTON_INFO
)
*
nNewButtons
);
}
else
{
TBUTTON_INFO
*
oldButtons
=
infoPtr
->
buttons
;
infoPtr
->
buttons
=
Alloc
(
sizeof
(
TBUTTON_INFO
)
*
nNewButtons
);
memcpy
(
&
infoPtr
->
buttons
[
0
],
&
oldButtons
[
0
],
nOldButtons
*
sizeof
(
TBUTTON_INFO
));
Free
(
oldButtons
);
}
infoPtr
->
buttons
=
ReAlloc
(
infoPtr
->
buttons
,
sizeof
(
TBUTTON_INFO
)
*
nNewButtons
);
infoPtr
->
nNumButtons
=
nNewButtons
;
/* insert new button data */
...
...
@@ -2893,67 +2881,16 @@ TOOLBAR_AddButtonsA (HWND hwnd, WPARAM wParam, LPARAM lParam)
btnPtr
->
fsState
=
lpTbb
[
nCount
].
fsState
;
btnPtr
->
fsStyle
=
lpTbb
[
nCount
].
fsStyle
;
btnPtr
->
dwData
=
lpTbb
[
nCount
].
dwData
;
if
(
HIWORD
(
lpTbb
[
nCount
].
iString
)
&&
lpTbb
[
nCount
].
iString
!=
-
1
)
Str_SetPtrAtoW
((
LPWSTR
*
)
&
btnPtr
->
iString
,
(
LPSTR
)
lpTbb
[
nCount
].
iString
);
else
btnPtr
->
iString
=
lpTbb
[
nCount
].
iString
;
btnPtr
->
bHot
=
FALSE
;
TOOLBAR_TooltipAddTool
(
infoPtr
,
btnPtr
);
}
TOOLBAR_CalcToolbar
(
hwnd
);
TOOLBAR_AutoSize
(
hwnd
);
TOOLBAR_DumpToolbar
(
infoPtr
,
__LINE__
);
InvalidateRect
(
hwnd
,
NULL
,
TRUE
);
return
TRUE
;
}
static
LRESULT
TOOLBAR_AddButtonsW
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TOOLBAR_INFO
*
infoPtr
=
TOOLBAR_GetInfoPtr
(
hwnd
);
LPTBBUTTON
lpTbb
=
(
LPTBBUTTON
)
lParam
;
INT
nOldButtons
,
nNewButtons
,
nAddButtons
,
nCount
;
TRACE
(
"adding %d buttons!
\n
"
,
wParam
);
nAddButtons
=
(
UINT
)
wParam
;
nOldButtons
=
infoPtr
->
nNumButtons
;
nNewButtons
=
nOldButtons
+
nAddButtons
;
if
(
infoPtr
->
nNumButtons
==
0
)
{
infoPtr
->
buttons
=
Alloc
(
sizeof
(
TBUTTON_INFO
)
*
nNewButtons
);
}
else
{
TBUTTON_INFO
*
oldButtons
=
infoPtr
->
buttons
;
infoPtr
->
buttons
=
Alloc
(
sizeof
(
TBUTTON_INFO
)
*
nNewButtons
);
memcpy
(
&
infoPtr
->
buttons
[
0
],
&
oldButtons
[
0
],
nOldButtons
*
sizeof
(
TBUTTON_INFO
));
Free
(
oldButtons
);
}
infoPtr
->
nNumButtons
=
nNewButtons
;
/* insert new button data */
for
(
nCount
=
0
;
nCount
<
nAddButtons
;
nCount
++
)
{
TBUTTON_INFO
*
btnPtr
=
&
infoPtr
->
buttons
[
nOldButtons
+
nCount
];
btnPtr
->
iBitmap
=
lpTbb
[
nCount
].
iBitmap
;
btnPtr
->
idCommand
=
lpTbb
[
nCount
].
idCommand
;
btnPtr
->
fsState
=
lpTbb
[
nCount
].
fsState
;
btnPtr
->
fsStyle
=
lpTbb
[
nCount
].
fsStyle
;
btnPtr
->
dwData
=
lpTbb
[
nCount
].
dwData
;
if
(
HIWORD
(
lpTbb
[
nCount
].
iString
)
&&
lpTbb
[
nCount
].
iString
!=
-
1
)
Str_SetPtrW
((
LPWSTR
*
)
&
btnPtr
->
iString
,
(
LPWSTR
)
lpTbb
[
nCount
].
iString
);
{
if
(
fUnicode
)
Str_SetPtrW
((
LPWSTR
*
)
&
btnPtr
->
iString
,
(
LPWSTR
)
lpTbb
[
nCount
].
iString
);
else
Str_SetPtrAtoW
((
LPWSTR
*
)
&
btnPtr
->
iString
,
(
LPSTR
)
lpTbb
[
nCount
].
iString
);
}
else
btnPtr
->
iString
=
lpTbb
[
nCount
].
iString
;
btnPtr
->
bHot
=
FALSE
;
TOOLBAR_TooltipAddTool
(
infoPtr
,
btnPtr
);
}
...
...
@@ -6783,10 +6720,10 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return
TOOLBAR_AddBitmap
(
hwnd
,
wParam
,
lParam
);
case
TB_ADDBUTTONSA
:
return
TOOLBAR_AddButtons
A
(
hwnd
,
wParam
,
lParam
);
return
TOOLBAR_AddButtons
T
(
hwnd
,
wParam
,
lParam
,
FALSE
);
case
TB_ADDBUTTONSW
:
return
TOOLBAR_AddButtons
W
(
hwnd
,
wParam
,
lParam
);
return
TOOLBAR_AddButtons
T
(
hwnd
,
wParam
,
lParam
,
TRUE
);
case
TB_ADDSTRINGA
:
return
TOOLBAR_AddStringA
(
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