ReactOS 0.4.15-dev-7934-g1dc8d80
CToolBox Class Reference

#include <toolbox.h>

Inheritance diagram for CToolBox:
Collaboration diagram for CToolBox:

Public Member Functions

BOOL DoCreate (HWND hwndParent)
 

Private Member Functions

LRESULT OnCreate (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSysColorChange (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCommand (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnLButtonDown (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnMouseMove (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnLButtonUp (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnToolsModelToolChanged (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 

Private Attributes

CPaintToolBar toolbar
 

Detailed Description

Definition at line 24 of file toolbox.h.

Member Function Documentation

◆ DoCreate()

BOOL CToolBox::DoCreate ( HWND  hwndParent)

Definition at line 80 of file toolbox.cpp.

81{
82 RECT rcToolBox = { 0, 0, 0, 0 }; // Rely on mainWindow's WM_SIZE
84 return !!Create(hwndParent, rcToolBox, NULL, style);
85}
Arabic default style
Definition: afstyles.h:94
RegistrySettings registrySettings
Definition: registry.cpp:14
@ Create
Definition: registry.c:563
DWORD ShowToolBox
Definition: registry.h:44
static HWND hwndParent
Definition: cryptui.c:300
#define NULL
Definition: types.h:112
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by CMainWindow::OnCreate().

◆ OnCommand()

LRESULT CToolBox::OnCommand ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 127 of file toolbox.cpp.

128{
129 UINT id = LOWORD(wParam);
130 for (size_t i = 0; i < _countof(CommandToToolMapping); ++i)
131 {
132 if (CommandToToolMapping[i].id == id)
133 {
135 break;
136 }
137 }
138 return 0;
139}
ToolsModel toolsModel
Definition: toolsmodel.cpp:10
void SetActiveTool(TOOLTYPE nActiveTool)
Definition: toolsmodel.cpp:144
WPARAM wParam
Definition: combotst.c:138
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
unsigned int UINT
Definition: ndis.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define _countof(array)
Definition: sndvol32.h:68
static const COMMAND_TO_TOOL CommandToToolMapping[]
Definition: toolbox.cpp:106

◆ OnCreate()

LRESULT CToolBox::OnCreate ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 87 of file toolbox.cpp.

88{
89 toolbar.DoCreate(m_hWnd);
91 return 0;
92}
CToolSettingsWindow toolSettingsWindow
BOOL DoCreate(HWND hwndParent)
Definition: toolbox.cpp:34
CPaintToolBar toolbar
Definition: toolbox.h:42
BOOL DoCreate(HWND hwndParent)

◆ OnLButtonDown()

LRESULT CToolBox::OnLButtonDown ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 160 of file toolbox.cpp.

161{
162 SetCapture();
163 return 0;
164}
HWND WINAPI SetCapture(_In_ HWND hWnd)

◆ OnLButtonUp()

LRESULT CToolBox::OnLButtonUp ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 189 of file toolbox.cpp.

190{
191 if (::GetCapture() != m_hWnd)
192 return 0;
193
195 return 0;
196}
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
HWND WINAPI GetCapture(void)
Definition: message.c:2881

◆ OnMouseMove()

LRESULT CToolBox::OnMouseMove ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 166 of file toolbox.cpp.

167{
168 if (::GetCapture() != m_hWnd)
169 return 0;
172
173 RECT rc;
175
176 POINT ptCenter = { (rc.left + rc.right) / 2, (rc.top + rc.bottom) / 2 };
177
178 DWORD dwExpectedBar2ID = ((pt.x < ptCenter.x) ? BAR2ID_LEFT : BAR2ID_RIGHT);
179
180 if (registrySettings.Bar2ID != dwExpectedBar2ID)
181 {
182 registrySettings.Bar2ID = dwExpectedBar2ID;
184 }
185
186 return 0;
187}
CMainWindow mainWindow
Definition: main.cpp:25
#define BAR2ID_LEFT
Definition: registry.h:55
#define BAR2ID_RIGHT
Definition: registry.h:56
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:816
BOOL PostMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1044
LPARAM lParam
Definition: combotst.c:139
#define pt(x, y)
Definition: drawing.c:79
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
#define WM_SIZE
Definition: winuser.h:1611
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)

◆ OnSysColorChange()

LRESULT CToolBox::OnSysColorChange ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 94 of file toolbox.cpp.

95{
96 toolbar.SendMessage(WM_SYSCOLORCHANGE, 0, 0);
97 return 0;
98}
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1626

◆ OnToolsModelToolChanged()

LRESULT CToolBox::OnToolsModelToolChanged ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 141 of file toolbox.cpp.

142{
144 toolsModel.resetTool(); // resets the point-buffer of the polygon and bezier functions
145
146 // Check the toolbar button
148 for (size_t i = 0; i < _countof(CommandToToolMapping); ++i)
149 {
150 if (CommandToToolMapping[i].tool == tool)
151 {
153 break;
154 }
155 }
156
157 return 0;
158}
SelectionModel selectionModel
void resetTool()
Definition: toolsmodel.cpp:302
TOOLTYPE GetActiveTool() const
Definition: toolsmodel.cpp:134
#define TRUE
Definition: types.h:120
#define TB_CHECKBUTTON
Definition: commctrl.h:1043
TOOLTYPE
Definition: toolsmodel.h:11

Member Data Documentation

◆ toolbar

CPaintToolBar CToolBox::toolbar
private

Definition at line 42 of file toolbox.h.

Referenced by OnCreate(), OnSysColorChange(), and OnToolsModelToolChanged().


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