ReactOS 0.4.15-dev-7942-gd23573b
CPaintToolBar Class Reference

#include <toolbox.h>

Inheritance diagram for CPaintToolBar:
Collaboration diagram for CPaintToolBar:

Public Member Functions

BOOL DoCreate (HWND hwndParent)
 

Static Public Member Functions

static LRESULT CALLBACK ToolBarWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Detailed Description

Definition at line 17 of file toolbox.h.

Member Function Documentation

◆ DoCreate()

BOOL CPaintToolBar::DoCreate ( HWND  hwndParent)

Definition at line 34 of file toolbox.cpp.

35{
36 // NOTE: The horizontal line above the toolbar is hidden by CCS_NODIVIDER style.
37 RECT toolbarPos =
38 {
39 0, 0,
42 };
46 return FALSE;
47
48 HIMAGELIST hImageList = ImageList_Create(16, 16, ILC_COLOR24 | ILC_MASK, 16, 0);
49 SendMessage(TB_SETIMAGELIST, 0, (LPARAM)hImageList);
50
52 IMAGE_BITMAP, 256, 16, 0);
53 ImageList_AddMasked(hImageList, hbmIcons, RGB(255, 0, 255));
54 ::DeleteObject(hbmIcons);
55
57
58 WCHAR szToolTip[30];
59 TBBUTTON tbbutton;
60 ZeroMemory(&tbbutton, sizeof(tbbutton));
61 tbbutton.fsStyle = TBSTYLE_CHECKGROUP;
62 for (INT i = 0; i < NUM_TOOLS; i++)
63 {
64 ::LoadStringW(g_hinstExe, IDS_TOOLTIP1 + i, szToolTip, _countof(szToolTip));
65 tbbutton.iString = (INT_PTR)szToolTip;
66 tbbutton.fsState = TBSTATE_ENABLED | ((i % 2 == 1) ? TBSTATE_WRAP : 0);
67 tbbutton.idCommand = ID_FREESEL + i;
68 tbbutton.iBitmap = i;
69 SendMessage(TB_ADDBUTTONS, 1, (LPARAM) &tbbutton);
70 }
71
75
77 return TRUE;
78}
Arabic default style
Definition: afstyles.h:94
HINSTANCE g_hinstExe
Definition: main.cpp:17
#define IDB_TOOLBARICONS
Definition: resource.h:14
#define IDS_TOOLTIP1
Definition: resource.h:195
#define ID_PEN
Definition: resource.h:118
#define NUM_TOOLS
Definition: resource.h:128
#define ID_FREESEL
Definition: resource.h:112
HWND Create(LPCTSTR lpstrWndClass, HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
Definition: atlwin.h:417
static LRESULT CALLBACK ToolBarWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: toolbox.cpp:16
static HWND hwndParent
Definition: cryptui.c:300
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
INT WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
Definition: imagelist.c:563
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define RGB(r, g, b)
Definition: precomp.h:71
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static HBITMAP
Definition: button.c:44
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
#define TB_ADDBUTTONS
Definition: commctrl.h:1271
#define TBSTYLE_TOOLTIPS
Definition: commctrl.h:989
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1134
#define TB_CHECKBUTTON
Definition: commctrl.h:1043
#define CCS_VERT
Definition: commctrl.h:2249
#define TB_SETIMAGELIST
Definition: commctrl.h:1150
#define TBSTYLE_CHECKGROUP
Definition: commctrl.h:985
#define TB_SETBUTTONSIZE
Definition: commctrl.h:1135
#define TOOLBARCLASSNAMEW
Definition: commctrl.h:943
#define TBSTATE_ENABLED
Definition: commctrl.h:974
#define TBSTYLE_FLAT
Definition: commctrl.h:992
#define ILC_MASK
Definition: commctrl.h:351
#define CCS_NOPARENTALIGN
Definition: commctrl.h:2246
#define CCS_NORESIZE
Definition: commctrl.h:2245
#define TBSTATE_WRAP
Definition: commctrl.h:977
#define ILC_COLOR24
Definition: commctrl.h:357
#define TB_SETMAXTEXTROWS
Definition: commctrl.h:1162
#define _countof(array)
Definition: sndvol32.h:68
BYTE fsState
Definition: commctrl.h:951
INT_PTR iString
Definition: commctrl.h:959
int idCommand
Definition: commctrl.h:950
int iBitmap
Definition: commctrl.h:949
BYTE fsStyle
Definition: commctrl.h:952
#define CXY_TB_BUTTON
Definition: toolbox.h:13
#define CY_TOOLBAR
Definition: toolbox.h:15
#define CX_TOOLBAR
Definition: toolbox.h:14
#define SetWindowLongPtr
Definition: treelist.c:70
#define GWLP_WNDPROC
Definition: treelist.c:66
#define GWLP_USERDATA
Definition: treelist.c:63
int32_t INT_PTR
Definition: typedefs.h:64
int32_t INT
Definition: typedefs.h:58
#define ZeroMemory
Definition: winbase.h:1712
LONG_PTR LPARAM
Definition: windef.h:208
#define IMAGE_BITMAP
Definition: winuser.h:211
#define MAKELPARAM(l, h)
Definition: winuser.h:4008
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2203
#define SM_CYBORDER
Definition: winuser.h:965
#define SM_CXBORDER
Definition: winuser.h:964
#define SendMessage
Definition: winuser.h:5843
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
int WINAPI GetSystemMetrics(_In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by CToolBox::OnCreate().

◆ ToolBarWndProc()

LRESULT CALLBACK CPaintToolBar::ToolBarWndProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 16 of file toolbox.cpp.

17{
19 if (uMsg == WM_LBUTTONUP)
20 {
21 // We have to detect clicking on toolbar even if no change of pressed button
24 if (index >= 0)
25 {
29 }
30 }
31 return ::CallWindowProc(oldWndProc, hwnd, uMsg, wParam, lParam);
32}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define pt(x, y)
Definition: drawing.c:79
GLuint index
Definition: glext.h:6031
DWORD button
Definition: button.c:166
static WNDPROC oldWndProc
Definition: propsheet.c:637
#define INT
Definition: polytest.cpp:20
#define TB_GETBUTTON
Definition: commctrl.h:1109
#define TB_HITTEST
Definition: commctrl.h:1268
#define GetWindowLongPtr
Definition: treelist.c:73
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_COMMAND
Definition: winuser.h:1740
#define WM_LBUTTONUP
Definition: winuser.h:1777
HWND WINAPI GetParent(_In_ HWND)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2906
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by DoCreate().


The documentation for this class was generated from the following files: