2015-07-07 11:44:50 +00:00
|
|
|
/*
|
2023-06-23 11:04:32 +00:00
|
|
|
* PROJECT: PAINT for ReactOS
|
|
|
|
* LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
|
|
|
|
* PURPOSE: Window procedure of the main window and all children apart from
|
|
|
|
* hPalWin, hToolSettings and hSelection
|
2023-06-27 18:22:21 +00:00
|
|
|
* COPYRIGHT: Copyright 2015 Benedikt Freisen <b.freisen@gmx.net>
|
2015-07-07 11:44:50 +00:00
|
|
|
*/
|
|
|
|
|
2017-12-09 12:36:45 +00:00
|
|
|
#pragma once
|
|
|
|
|
2023-03-14 22:29:25 +00:00
|
|
|
#define TOOLBAR_ROWS 8
|
|
|
|
#define TOOLBAR_COLUMNS 2
|
|
|
|
#define CXY_TB_BUTTON 25
|
2023-03-21 04:13:53 +00:00
|
|
|
#define CX_TOOLBAR (TOOLBAR_COLUMNS * CXY_TB_BUTTON)
|
|
|
|
#define CY_TOOLBAR (TOOLBAR_ROWS * CXY_TB_BUTTON)
|
2023-03-14 22:29:25 +00:00
|
|
|
|
2023-04-03 05:34:56 +00:00
|
|
|
class CPaintToolBar : public CWindow
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
BOOL DoCreate(HWND hwndParent);
|
2023-06-17 12:15:35 +00:00
|
|
|
static LRESULT CALLBACK ToolBarWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
2023-04-03 05:34:56 +00:00
|
|
|
};
|
|
|
|
|
2023-03-10 22:42:04 +00:00
|
|
|
class CToolBox : public CWindowImpl<CToolBox>
|
2015-07-07 11:44:50 +00:00
|
|
|
{
|
|
|
|
public:
|
2023-11-04 10:25:45 +00:00
|
|
|
DECLARE_WND_CLASS_EX(L"ToolBox", CS_DBLCLKS, COLOR_BTNFACE)
|
2015-07-07 11:44:50 +00:00
|
|
|
|
|
|
|
BEGIN_MSG_MAP(CToolBox)
|
|
|
|
MESSAGE_HANDLER(WM_CREATE, OnCreate)
|
|
|
|
MESSAGE_HANDLER(WM_SYSCOLORCHANGE, OnSysColorChange)
|
|
|
|
MESSAGE_HANDLER(WM_COMMAND, OnCommand)
|
2023-04-03 05:34:56 +00:00
|
|
|
MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)
|
|
|
|
MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)
|
|
|
|
MESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp)
|
2015-07-07 11:44:50 +00:00
|
|
|
MESSAGE_HANDLER(WM_TOOLSMODELTOOLCHANGED, OnToolsModelToolChanged)
|
|
|
|
END_MSG_MAP()
|
|
|
|
|
2023-03-21 04:13:53 +00:00
|
|
|
BOOL DoCreate(HWND hwndParent);
|
|
|
|
|
|
|
|
private:
|
2023-04-03 05:34:56 +00:00
|
|
|
CPaintToolBar toolbar;
|
2015-07-07 11:44:50 +00:00
|
|
|
|
|
|
|
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);
|
2023-04-03 05:34:56 +00:00
|
|
|
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);
|
2015-07-07 11:44:50 +00:00
|
|
|
LRESULT OnToolsModelToolChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
|
|
};
|