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
654ee2c1
Commit
654ee2c1
authored
May 22, 1999
by
Eric Kohl
Committed by
Alexandre Julliard
May 22, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Toolbar customization dialog (take one).
parent
b7e8e800
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
246 additions
and
17 deletions
+246
-17
comctl32.h
dlls/comctl32/comctl32.h
+15
-1
propsheet.c
dlls/comctl32/propsheet.c
+1
-1
rsrc.rc
dlls/comctl32/rsrc.rc
+20
-1
toolbar.c
dlls/comctl32/toolbar.c
+191
-14
commctrl.h
include/commctrl.h
+17
-0
toolbar.h
include/toolbar.h
+2
-0
No files found.
dlls/comctl32/
propsheet
.h
→
dlls/comctl32/
comctl32
.h
View file @
654ee2c1
/******************************************************************************
*
*
Property Sheets
*
Common definitions (resource ids and global variables)
*
* Copyright 1999 Thuy Nguyen
* Copyright 1999 Eric Kohl
*
*/
extern
HMODULE
COMCTL32_hModule
;
/* Property sheet / Wizard */
#define IDD_PROPSHEET 1006
#define IDD_WIZARD 1020
#define IDC_TABCONTROL 12320
#define IDC_APPLY_BUTTON 12321
/* Toolbar customization dialog */
#define IDD_TBCUSTOMIZE 200
#define IDC_AVAILBTN_LBOX 201
#define IDC_RESET_BTN 202
#define IDC_TOOLBARBTN_LBOX 203
#define IDC_REMOVE_BTN 204
#define IDC_HELP_BTN 205
#define IDC_MOVEUP_BTN 206
#define IDC_MOVEDN_BTN 207
dlls/comctl32/propsheet.c
View file @
654ee2c1
...
...
@@ -15,7 +15,7 @@
#include "commctrl.h"
#include "prsht.h"
#include "winnls.h"
#include "
propsheet
.h"
#include "
comctl32
.h"
#include "debug.h"
...
...
dlls/comctl32/rsrc.rc
View file @
654ee2c1
#include "winuser.h"
#include "
propsheet
.h"
#include "
comctl32
.h"
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 292, 159
...
...
@@ -14,3 +14,22 @@ BEGIN
CONTROL "Tab", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS,7,7,278,125
END
IDD_TBCUSTOMIZE DIALOG DISCARDABLE 10, 20, 357, 125
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Customize Toolbar"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "&Close", IDCANCEL,308,6,44,14
PUSHBUTTON "R&eset", IDC_RESET_BTN,308,23,44,14
PUSHBUTTON "&Help", IDC_HELP_BTN,308,40,44,14
PUSHBUTTON "Move &Up", IDC_MOVEUP_BTN,308,74,44,14
PUSHBUTTON "Move &Down", IDC_MOVEDN_BTN,308,91,44,14
LTEXT "A&vailable buttons:", -1,4,5,84,10
LISTBOX IDC_AVAILBTN_LBOX,4,17,120,100, LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
PUSHBUTTON "&Add ->", IDOK, 131, 42, 44, 14
PUSHBUTTON "<- &Remove", IDC_REMOVE_BTN,131,62,44,14
LTEXT "&Toolbar buttons:", -1,182,5,78,10
LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
END
dlls/comctl32/toolbar.c
View file @
654ee2c1
/*
* Toolbar control
*
* Copyright 1998 Eric Kohl
* Copyright 1998
,1999
Eric Kohl
*
* TODO:
* - A little bug in TOOLBAR_DrawMasked()
...
...
@@ -14,7 +13,7 @@
* - Unicode suppport.
* - Internal COMMCTL32 bitmaps.
* - Fix TOOLBAR_SetButtonInfo32A.
* -
Fix TOOLBAR_Customize. (Customize dialog.)
* -
Customize dialog (under construction).
*
* Testing:
* - Run tests using Waite Group Windows95 API Bible Volume 2.
...
...
@@ -32,6 +31,7 @@
#include "commctrl.h"
#include "sysmetrics.h"
#include "cache.h"
#include "comctl32.h"
#include "toolbar.h"
#include "debug.h"
...
...
@@ -41,9 +41,9 @@ DEFAULT_DEBUG_CHANNEL(toolbar)
#define TOP_BORDER 2
#define BOTTOM_BORDER 2
#define TOOLBAR_GetInfoPtr(wndPtr) ((TOOLBAR_INFO *)GetWindowLongA(hwnd,0))
static
void
TOOLBAR_DrawFlatSeparator
(
LPRECT
lpRect
,
HDC
hdc
)
{
...
...
@@ -716,6 +716,151 @@ TOOLBAR_RelayEvent (HWND hwndTip, HWND hwndMsg, UINT uMsg,
SendMessageA
(
hwndTip
,
TTM_RELAYEVENT
,
0
,
(
LPARAM
)
&
msg
);
}
/***********************************************************************
* TOOLBAR_CustomizeDialogProc
* This function implements the toolbar customization dialog.
*/
BOOL
WINAPI
TOOLBAR_CustomizeDialogProc
(
HWND
hwnd
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TOOLBAR_INFO
*
infoPtr
=
(
TOOLBAR_INFO
*
)
GetWindowLongA
(
hwnd
,
DWL_USER
);
static
HDSA
hDsa
=
NULL
;
switch
(
uMsg
)
{
case
WM_INITDIALOG
:
infoPtr
=
(
TOOLBAR_INFO
*
)
lParam
;
SetWindowLongA
(
hwnd
,
DWL_USER
,
(
DWORD
)
infoPtr
);
hDsa
=
DSA_Create
(
sizeof
(
TBUTTON_INFO
),
5
);
if
(
infoPtr
)
{
TBUTTON_INFO
*
btnPtr
;
INT
i
;
/* insert 'virtual' separator button into 'available buttons' list */
SendDlgItemMessageA
(
hwnd
,
IDC_AVAILBTN_LBOX
,
LB_ADDSTRING
,
0
,
(
LPARAM
)
""
);
/* copy all buttons and append them to the right listbox */
btnPtr
=
infoPtr
->
buttons
;
for
(
i
=
0
;
i
<
infoPtr
->
nNumButtons
;
i
++
,
btnPtr
++
)
{
DSA_InsertItem
(
hDsa
,
i
,
btnPtr
);
if
(
btnPtr
->
fsState
&
TBSTATE_HIDDEN
)
{
SendDlgItemMessageA
(
hwnd
,
IDC_AVAILBTN_LBOX
,
LB_ADDSTRING
,
0
,
(
LPARAM
)
""
);
}
else
{
SendDlgItemMessageA
(
hwnd
,
IDC_TOOLBARBTN_LBOX
,
LB_ADDSTRING
,
0
,
(
LPARAM
)
""
);
}
}
/* append 'virtual' sepatator button to the 'toolbar buttons' list */
/* TODO */
}
return
TRUE
;
case
WM_CLOSE
:
EndDialog
(
hwnd
,
FALSE
);
return
TRUE
;
case
WM_COMMAND
:
switch
(
LOWORD
(
wParam
))
{
case
IDCANCEL
:
EndDialog
(
hwnd
,
FALSE
);
break
;
}
return
TRUE
;
case
WM_DESTROY
:
if
(
hDsa
)
DSA_Destroy
(
hDsa
);
return
TRUE
;
case
WM_DRAWITEM
:
if
(
wParam
==
IDC_AVAILBTN_LBOX
||
wParam
==
IDC_TOOLBARBTN_LBOX
)
{
LPDRAWITEMSTRUCT
lpdis
=
(
LPDRAWITEMSTRUCT
)
lParam
;
RECT
rcButton
;
RECT
rcText
;
HPEN
hOldPen
;
HBRUSH
hOldBrush
;
COLORREF
oldText
=
0
;
COLORREF
oldBk
=
0
;
FIXME
(
toolbar
,
"action: %x itemState: %x
\n
"
,
lpdis
->
itemAction
,
lpdis
->
itemState
);
if
(
lpdis
->
itemState
&
ODS_FOCUS
)
{
oldBk
=
SetBkColor
(
lpdis
->
hDC
,
GetSysColor
(
COLOR_HIGHLIGHT
));
oldText
=
SetTextColor
(
lpdis
->
hDC
,
GetSysColor
(
COLOR_HIGHLIGHTTEXT
));
}
hOldPen
=
SelectObject
(
lpdis
->
hDC
,
GetSysColorPen
((
lpdis
->
itemState
&
ODS_SELECTED
)
?
COLOR_HIGHLIGHT
:
COLOR_WINDOW
));
hOldBrush
=
SelectObject
(
lpdis
->
hDC
,
GetSysColorBrush
((
lpdis
->
itemState
&
ODS_FOCUS
)
?
COLOR_HIGHLIGHT
:
COLOR_WINDOW
));
/* fill background rectangle */
Rectangle
(
lpdis
->
hDC
,
lpdis
->
rcItem
.
left
,
lpdis
->
rcItem
.
top
,
lpdis
->
rcItem
.
right
,
lpdis
->
rcItem
.
bottom
);
/* calculate button and text rectangles */
CopyRect
(
&
rcButton
,
&
lpdis
->
rcItem
);
InflateRect
(
&
rcButton
,
-
1
,
-
1
);
CopyRect
(
&
rcText
,
&
rcButton
);
rcButton
.
right
=
rcButton
.
left
+
infoPtr
->
nBitmapWidth
+
6
;
rcText
.
left
=
rcButton
.
right
+
2
;
/* draw focus rectangle */
if
(
lpdis
->
itemState
&
ODS_FOCUS
)
DrawFocusRect
(
lpdis
->
hDC
,
&
lpdis
->
rcItem
);
/* draw button */
DrawEdge
(
lpdis
->
hDC
,
&
rcButton
,
EDGE_RAISED
,
BF_RECT
|
BF_MIDDLE
|
BF_SOFT
);
/* draw text */
if
(
wParam
==
IDC_AVAILBTN_LBOX
&&
lpdis
->
itemID
==
0
)
DrawTextA
(
lpdis
->
hDC
,
"Separator"
,
-
1
,
&
rcText
,
DT_LEFT
|
DT_VCENTER
|
DT_SINGLELINE
);
if
(
lpdis
->
itemState
&
ODS_FOCUS
)
{
SetBkColor
(
lpdis
->
hDC
,
oldBk
);
SetTextColor
(
lpdis
->
hDC
,
oldText
);
}
SelectObject
(
lpdis
->
hDC
,
hOldBrush
);
SelectObject
(
lpdis
->
hDC
,
hOldPen
);
return
TRUE
;
}
return
FALSE
;
case
WM_MEASUREITEM
:
if
(
wParam
==
IDC_AVAILBTN_LBOX
||
wParam
==
IDC_TOOLBARBTN_LBOX
)
{
MEASUREITEMSTRUCT
*
lpmis
=
(
MEASUREITEMSTRUCT
*
)
lParam
;
if
(
infoPtr
)
lpmis
->
itemHeight
=
infoPtr
->
nBitmapHeight
+
8
;
else
lpmis
->
itemHeight
=
16
+
8
;
/* default height */
return
TRUE
;
}
return
FALSE
;
default
:
return
FALSE
;
}
}
/***********************************************************************
* TOOLBAR_AddBitmap: Add the bitmaps to the default image list.
*
...
...
@@ -1156,9 +1301,41 @@ TOOLBAR_CommandToIndex (HWND hwnd, WPARAM wParam, LPARAM lParam)
static
LRESULT
TOOLBAR_Customize
(
HWND
hwnd
)
{
FIXME
(
toolbar
,
"customization not implemented!
\n
"
);
TOOLBAR_INFO
*
infoPtr
=
TOOLBAR_GetInfoPtr
(
hwnd
);
LRESULT
ret
;
LPCVOID
template
;
HRSRC
hRes
;
NMHDR
nmhdr
;
return
0
;
/* send TBN_BEGINADJUST notification */
nmhdr
.
hwndFrom
=
hwnd
;
nmhdr
.
idFrom
=
GetWindowLongA
(
hwnd
,
GWL_ID
);
nmhdr
.
code
=
TBN_BEGINADJUST
;
SendMessageA
(
infoPtr
->
hwndNotify
,
WM_NOTIFY
,
(
WPARAM
)
nmhdr
.
idFrom
,
(
LPARAM
)
&
nmhdr
);
if
(
!
(
hRes
=
FindResourceA
(
COMCTL32_hModule
,
MAKEINTRESOURCEA
(
IDD_TBCUSTOMIZE
),
RT_DIALOGA
)))
return
FALSE
;
if
(
!
(
template
=
(
LPVOID
)
LoadResource
(
COMCTL32_hModule
,
hRes
)))
return
FALSE
;
ret
=
DialogBoxIndirectParamA
(
GetWindowLongA
(
hwnd
,
GWL_HINSTANCE
),
(
LPDLGTEMPLATEA
)
template
,
hwnd
,
(
DLGPROC
)
TOOLBAR_CustomizeDialogProc
,
(
LPARAM
)
infoPtr
);
/* send TBN_ENDADJUST notification */
nmhdr
.
code
=
TBN_ENDADJUST
;
SendMessageA
(
infoPtr
->
hwndNotify
,
WM_NOTIFY
,
(
WPARAM
)
nmhdr
.
idFrom
,
(
LPARAM
)
&
nmhdr
);
return
ret
;
}
...
...
@@ -2769,7 +2946,7 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case
TB_ADDBUTTONSA
:
return
TOOLBAR_AddButtonsA
(
hwnd
,
wParam
,
lParam
);
/* case TB_ADDBUTTONS
32
W: */
/* case TB_ADDBUTTONSW: */
case
TB_ADDSTRINGA
:
return
TOOLBAR_AddStringA
(
hwnd
,
wParam
,
lParam
);
...
...
@@ -2818,7 +2995,7 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case
TB_GETBUTTONINFOA
:
return
TOOLBAR_GetButtonInfoA
(
hwnd
,
wParam
,
lParam
);
/* case TB_GETBUTTONINFO
32
W: */
/* 4.71 */
/* case TB_GETBUTTONINFOW: */
/* 4.71 */
case
TB_GETBUTTONSIZE
:
return
TOOLBAR_GetButtonSize
(
hwnd
);
...
...
@@ -2826,7 +3003,7 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case
TB_GETBUTTONTEXTA
:
return
TOOLBAR_GetButtonTextA
(
hwnd
,
wParam
,
lParam
);
/* case TB_GETBUTTONTEXT
32
W: */
/* case TB_GETBUTTONTEXTW: */
/* case TB_GETCOLORSCHEME: */
/* 4.71 */
case
TB_GETDISABLEDIMAGELIST
:
...
...
@@ -2888,7 +3065,7 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case
TB_INSERTBUTTONA
:
return
TOOLBAR_InsertButtonA
(
hwnd
,
wParam
,
lParam
);
/* case TB_INSERTBUTTON
32
W: */
/* case TB_INSERTBUTTONW: */
/* case TB_INSERTMARKHITTEST: */
/* 4.71 */
case
TB_ISBUTTONCHECKED
:
...
...
@@ -2910,8 +3087,8 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return
TOOLBAR_IsButtonPressed
(
hwnd
,
wParam
,
lParam
);
/* case TB_LOADIMAGES: */
/* 4.70 */
/* case TB_MAPACCELERATOR
32
A: */
/* 4.71 */
/* case TB_MAPACCELERATOR
32
W: */
/* 4.71 */
/* case TB_MAPACCELERATORA: */
/* 4.71 */
/* case TB_MAPACCELERATORW: */
/* 4.71 */
/* case TB_MARKBUTTON: */
/* 4.71 */
/* case TB_MOVEBUTTON: */
/* 4.71 */
...
...
@@ -2923,7 +3100,7 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case
TB_SAVERESTOREA
:
return
TOOLBAR_SaveRestoreA
(
hwnd
,
wParam
,
lParam
);
/* case TB_SAVERESTORE
32
W: */
/* case TB_SAVERESTOREW: */
/* case TB_SETANCHORHIGHLIGHT: */
/* 4.71 */
case
TB_SETBITMAPSIZE
:
...
...
@@ -2932,7 +3109,7 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case
TB_SETBUTTONINFOA
:
return
TOOLBAR_SetButtonInfoA
(
hwnd
,
wParam
,
lParam
);
/* case TB_SETBUTTONINFO
32W:
*/
/* 4.71 */
/* case TB_SETBUTTONINFO
W:
*/
/* 4.71 */
case
TB_SETBUTTONSIZE
:
return
TOOLBAR_SetButtonSize
(
hwnd
,
wParam
,
lParam
);
...
...
include/commctrl.h
View file @
654ee2c1
...
...
@@ -893,6 +893,23 @@ typedef struct tagNMHDDISPINFOW
#define TBN_GETBUTTONINFOA (TBN_FIRST-0)
#define TBN_GETBUTTONINFOW (TBN_FIRST-20)
#define TBN_GETBUTTONINFO WINELIB_NAME_AW(TBN_GETBUTTONINFO)
#define TBN_BEGINDRAG (TBN_FIRST-1)
#define TBN_ENDDRAG (TBN_FIRST-2)
#define TBN_BEGINADJUST (TBN_FIRST-3)
#define TBN_ENDADJUST (TBN_FIRST-4)
#define TBN_RESET (TBN_FIRST-5)
#define TBN_QUERYINSERT (TBN_FIRST-6)
#define TBN_QUERYDELETE (TBN_FIRST-7)
#define TBN_TOOLBARCHANGE (TBN_FIRST-8)
#define TBN_CUSTHELP (TBN_FIRST-9)
#define TBN_DROPDOWN (TBN_FIRST-10)
#define TBN_GETOBJECT (TBN_FIRST-12)
#define TBN_HOTITEMCHANGE (TBN_FIRST-13)
#define TBN_DRAGOUT (TBN_FIRST-14)
#define TBN_DELETINGBUTTON (TBN_FIRST-15)
#define TBN_GETDISPINFOA (TBN_FIRST-16)
#define TBN_GETDISPINFOW (TBN_FIRST-17)
#define TBN_GETDISPINFO WINELIB_NAME_AW(TBN_GETDISPINFO)
#define TBN_GETINFOTIPA (TBN_FIRST-18)
#define TBN_GETINFOTIPW (TBN_FIRST-19)
#define TBN_GETINFOTIP WINELIB_NAME_AW(TBN_GETINFOTIP)
...
...
include/toolbar.h
View file @
654ee2c1
...
...
@@ -65,6 +65,8 @@ typedef struct tagTOOLBAR_INFO
}
TOOLBAR_INFO
;
extern
BOOL
WINAPI
TBARCUST_DialogProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
extern
VOID
TOOLBAR_Register
(
VOID
);
extern
VOID
TOOLBAR_Unregister
(
VOID
);
...
...
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