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
d183e4ac
Commit
d183e4ac
authored
Nov 21, 1999
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 21, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added undocumented feature to InsertButtonA.
Added dropdown button support.
parent
331931a8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
4 deletions
+52
-4
toolbar.c
dlls/comctl32/toolbar.c
+44
-4
commctrl.h
include/commctrl.h
+8
-0
No files found.
dlls/comctl32/toolbar.c
View file @
d183e4ac
...
...
@@ -1900,7 +1900,25 @@ TOOLBAR_InsertButtonA (HWND hwnd, WPARAM wParam, LPARAM lParam)
if
(
lpTbb
==
NULL
)
return
FALSE
;
if
(
nIndex
<
0
)
if
(
nIndex
==
-
1
)
{
/* EPP: this seems to be an undocumented call (from my IE4)
* I assume in that case that:
* - lpTbb->iString is a string pointer (not a string index in strings[] table
* - index of insertion is at the end of existing buttons
* I only see this happen with nIndex == -1, but it could have a special
* meaning (like -nIndex (or ~nIndex) to get the real position of insertion).
*/
int
len
=
lstrlenA
((
char
*
)
lpTbb
->
iString
)
+
2
;
LPSTR
ptr
=
COMCTL32_Alloc
(
len
);
nIndex
=
infoPtr
->
nNumButtons
;
strcpy
(
ptr
,
(
char
*
)
lpTbb
->
iString
);
ptr
[
len
-
1
]
=
0
;
/* ended by two '\0' */
lpTbb
->
iString
=
TOOLBAR_AddStringA
(
hwnd
,
0
,
(
LPARAM
)
ptr
);
COMCTL32_Free
(
ptr
);
}
else
if
(
nIndex
<
0
)
return
FALSE
;
TRACE
(
"inserting button index=%d
\n
"
,
nIndex
);
...
...
@@ -2162,6 +2180,7 @@ TOOLBAR_SetButtonInfoA (HWND hwnd, WPARAM wParam, LPARAM lParam)
if
(
lptbbi
->
dwMask
&
TBIF_TEXT
)
{
if
((
btnPtr
->
iString
>=
0
)
||
(
btnPtr
->
iString
<
infoPtr
->
nNumStrings
))
{
TRACE
(
"Ooooooch
\n
"
);
#if 0
CHAR **lpString = &infoPtr->strings[btnPtr->iString];
INT len = lstrlenA (lptbbi->pszText);
...
...
@@ -2669,7 +2688,6 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
return
0
;
}
static
LRESULT
TOOLBAR_LButtonUp
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
...
...
@@ -2724,10 +2742,32 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
TOOLBAR_DrawButton
(
hwnd
,
btnPtr
,
hdc
);
ReleaseDC
(
hwnd
,
hdc
);
if
(
bSendMessage
)
SendMessageA
(
infoPtr
->
hwndNotify
,
WM_COMMAND
,
if
(
bSendMessage
)
{
SendMessageA
(
GetParent
(
hwnd
)
,
WM_COMMAND
,
MAKEWPARAM
(
btnPtr
->
idCommand
,
0
),
(
LPARAM
)
hwnd
);
if
((
GetWindowLongA
(
hwnd
,
GWL_STYLE
)
&
TBSTYLE_DROPDOWN
)
||
(
btnPtr
->
fsStyle
&
0x08
/* BTNS_DROPDOWN */
))
{
NMTOOLBARW
nmtb
;
nmtb
.
hdr
.
hwndFrom
=
hwnd
;
nmtb
.
hdr
.
idFrom
=
GetWindowLongA
(
hwnd
,
GWL_ID
);
nmtb
.
hdr
.
code
=
TBN_DROPDOWN
;
nmtb
.
iItem
=
nHit
;
/* nmtb.tbButton not used with TBN_DROPDOWN */
if
((
btnPtr
->
iString
>=
0
)
&&
(
btnPtr
->
iString
<
infoPtr
->
nNumStrings
))
{
nmtb
.
pszText
=
infoPtr
->
strings
[
btnPtr
->
iString
];
nmtb
.
cchText
=
lstrlenW
(
nmtb
.
pszText
);
}
else
{
nmtb
.
pszText
=
NULL
;
nmtb
.
cchText
=
0
;
}
nmtb
.
rcButton
=
btnPtr
->
rect
;
SendMessageW
(
infoPtr
->
hwndNotify
,
WM_NOTIFY
,
(
WPARAM
)
nmtb
.
hdr
.
idFrom
,
(
LPARAM
)
&
nmtb
);
}
}
infoPtr
->
nButtonDown
=
-
1
;
infoPtr
->
nOldHit
=
-
1
;
}
...
...
include/commctrl.h
View file @
d183e4ac
...
...
@@ -941,6 +941,14 @@ typedef struct _TBBUTTON {
}
TBBUTTON
,
*
PTBBUTTON
,
*
LPTBBUTTON
;
typedef
const
TBBUTTON
*
LPCTBBUTTON
;
typedef
struct
tagNMTOOLBAR
{
NMHDR
hdr
;
int
iItem
;
TBBUTTON
tbButton
;
int
cchText
;
LPWSTR
pszText
;
RECT
rcButton
;
/*Version 5.80*/
}
NMTOOLBARW
,
*
LPNMTOOLBARW
;
typedef
struct
_COLORMAP
{
COLORREF
from
;
...
...
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