2015-05-08 16:02:36 +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 palette window
|
2023-06-27 18:22:21 +00:00
|
|
|
* COPYRIGHT: Copyright 2015 Benedikt Freisen <b.freisen@gmx.net>
|
2015-05-08 16:02:36 +00:00
|
|
|
*/
|
|
|
|
|
2017-12-09 12:36:45 +00:00
|
|
|
#pragma once
|
|
|
|
|
2023-03-14 22:29:25 +00:00
|
|
|
#define CXY_COLORBOX 16 /* width / height of a normal color box */
|
|
|
|
#define CXY_BIGBOX (CXY_COLORBOX * 2) /* width / height of the big box */
|
|
|
|
#define CY_PALETTE (8 + CXY_BIGBOX + 8)
|
|
|
|
|
2015-07-07 10:42:49 +00:00
|
|
|
class CPaletteWindow : public CWindowImpl<CPaletteWindow>
|
|
|
|
{
|
|
|
|
public:
|
2023-11-04 10:25:45 +00:00
|
|
|
DECLARE_WND_CLASS_EX(L"Palette", CS_DBLCLKS, COLOR_BTNFACE)
|
2015-05-08 16:02:36 +00:00
|
|
|
|
2015-07-07 10:42:49 +00:00
|
|
|
BEGIN_MSG_MAP(CPaletteWindow)
|
2023-03-14 22:29:25 +00:00
|
|
|
MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBkgnd)
|
2015-07-07 10:42:49 +00:00
|
|
|
MESSAGE_HANDLER(WM_PAINT, OnPaint)
|
|
|
|
MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)
|
|
|
|
MESSAGE_HANDLER(WM_RBUTTONDOWN, OnRButtonDown)
|
|
|
|
MESSAGE_HANDLER(WM_LBUTTONDBLCLK, OnLButtonDblClk)
|
|
|
|
MESSAGE_HANDLER(WM_RBUTTONDBLCLK, OnRButtonDblClk)
|
2023-04-04 10:06:06 +00:00
|
|
|
MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)
|
|
|
|
MESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp)
|
2015-07-07 11:44:50 +00:00
|
|
|
MESSAGE_HANDLER(WM_PALETTEMODELCOLORCHANGED, OnPaletteModelColorChanged)
|
2015-07-07 10:42:49 +00:00
|
|
|
END_MSG_MAP()
|
|
|
|
|
2023-06-15 23:05:23 +00:00
|
|
|
CPaletteWindow();
|
|
|
|
virtual ~CPaletteWindow();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
HBITMAP m_hbmCached; // Cached buffer bitmap
|
|
|
|
|
2023-03-14 22:29:25 +00:00
|
|
|
LRESULT OnEraseBkgnd(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
2015-07-07 10:42:49 +00:00
|
|
|
LRESULT OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
|
|
LRESULT OnLButtonDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
|
|
LRESULT OnRButtonDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
|
|
LRESULT OnLButtonDblClk(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
|
|
LRESULT OnRButtonDblClk(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
2023-04-04 10:06:06 +00:00
|
|
|
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 OnPaletteModelColorChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
2023-03-14 22:29:25 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
INT DoHitTest(INT xPos, INT yPos) const;
|
2015-07-07 10:42:49 +00:00
|
|
|
};
|