3f164b347e74148b26bfdb994c454bfcbdc4e363
[reactos.git] / reactos / base / applications / mspaint / selection.h
1 /*
2 * PROJECT: PAINT for ReactOS
3 * LICENSE: LGPL
4 * FILE: base/applications/mspaint/selection.h
5 * PURPOSE: Window procedure of the selection window
6 * PROGRAMMERS: Benedikt Freisen
7 */
8
9 class CSelectionWindow : public CWindowImpl<CSelectionWindow>
10 {
11 public:
12 DECLARE_WND_CLASS_EX(_T("Selection"), CS_DBLCLKS, COLOR_BTNFACE)
13
14 BEGIN_MSG_MAP(CSelectionWindow)
15 MESSAGE_HANDLER(WM_PAINT, OnPaint)
16 MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBkgnd)
17 MESSAGE_HANDLER(WM_CREATE, OnCreate)
18 MESSAGE_HANDLER(WM_SYSCOLORCHANGE, OnSysColorChange)
19 MESSAGE_HANDLER(WM_SETCURSOR, OnSetCursor)
20 MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)
21 MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)
22 MESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp)
23 MESSAGE_HANDLER(WM_PALETTEMODELCOLORCHANGED, OnPaletteModelColorChanged)
24 MESSAGE_HANDLER(WM_TOOLSMODELSETTINGSCHANGED, OnToolsModelSettingsChanged)
25 MESSAGE_HANDLER(WM_SELECTIONMODELREFRESHNEEDED, OnSelectionModelRefreshNeeded)
26 END_MSG_MAP()
27
28 LRESULT OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
29 LRESULT OnEraseBkgnd(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
30 LRESULT OnCreate(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
31 LRESULT OnSysColorChange(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
32 LRESULT OnSetCursor(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
33 LRESULT OnLButtonDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
34 LRESULT OnMouseMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
35 LRESULT OnLButtonUp(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
36 LRESULT OnPaletteModelColorChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
37 LRESULT OnToolsModelSettingsChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
38 LRESULT OnSelectionModelRefreshNeeded(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
39
40 private:
41 static const LPCTSTR m_lpszCursorLUT[9];
42 BOOL m_bMoving;
43 int m_iAction;
44 POINT m_ptPos;
45 POINT m_ptFrac;
46 POINT m_ptDelta;
47 DWORD m_dwSystemSelectionColor;
48
49 int IdentifyCorner(int iXPos, int iYPos, int iWidth, int iHeight);
50 };
51
52 void ForceRefreshSelectionContents();