xref: /reactos/base/applications/mspaint/dialogs.h (revision e6c23361)
1 /*
2  * PROJECT:    PAINT for ReactOS
3  * LICENSE:    LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
4  * PURPOSE:    Window procedures of the dialog windows plus launching functions
5  * COPYRIGHT:  Copyright 2015 Benedikt Freisen <b.freisen@gmx.net>
6  */
7 
8 #pragma once
9 
10 void ShowError(INT stringID, ...);
11 
12 class CMirrorRotateDialog : public CDialogImpl<CMirrorRotateDialog>
13 {
14 public:
15     enum { IDD = IDD_MIRRORROTATE };
16 
17     BEGIN_MSG_MAP(CMirrorRotateDialog)
18         MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
19         MESSAGE_HANDLER(WM_CLOSE, OnClose)
20         COMMAND_ID_HANDLER(IDOK, OnOk)
21         COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
22         COMMAND_ID_HANDLER(IDD_MIRRORROTATERB3, OnRadioButton3)
23         COMMAND_ID_HANDLER(IDD_MIRRORROTATERB1, OnRadioButton12)
24         COMMAND_ID_HANDLER(IDD_MIRRORROTATERB2, OnRadioButton12)
25     END_MSG_MAP()
26 
27     LRESULT OnInitDialog(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
28     LRESULT OnClose(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
29     LRESULT OnOk(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
30     LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
31     LRESULT OnRadioButton3(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
32     LRESULT OnRadioButton12(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
33 };
34 
35 class CAttributesDialog : public CDialogImpl<CAttributesDialog>
36 {
37 public:
38     enum { IDD = IDD_ATTRIBUTES };
39 
40     BEGIN_MSG_MAP(CAttributesDialog)
41         MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
42         MESSAGE_HANDLER(WM_CLOSE, OnClose)
43         COMMAND_ID_HANDLER(IDOK, OnOk)
44         COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
45         COMMAND_ID_HANDLER(IDD_ATTRIBUTESSTANDARD, OnDefault)
46         COMMAND_ID_HANDLER(IDD_ATTRIBUTESRB1, OnRadioButton1)
47         COMMAND_ID_HANDLER(IDD_ATTRIBUTESRB2, OnRadioButton2)
48         COMMAND_ID_HANDLER(IDD_ATTRIBUTESRB3, OnRadioButton3)
49         COMMAND_ID_HANDLER(IDD_ATTRIBUTESEDIT1, OnEdit1)
50         COMMAND_ID_HANDLER(IDD_ATTRIBUTESEDIT2, OnEdit2)
51     END_MSG_MAP()
52 
53     LRESULT OnInitDialog(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
54     LRESULT OnClose(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
55     LRESULT OnOk(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
56     LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
57     LRESULT OnDefault(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
58     LRESULT OnRadioButton1(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
59     LRESULT OnRadioButton2(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
60     LRESULT OnRadioButton3(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
61     LRESULT OnEdit1(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
62     LRESULT OnEdit2(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
63 
64 public:
65     int newWidth;
66     int newHeight;
67     BOOL m_bBlackAndWhite;
68 };
69 
70 class CStretchSkewDialog : public CDialogImpl<CStretchSkewDialog>
71 {
72 public:
73     enum { IDD = IDD_STRETCHSKEW };
74 
75     BEGIN_MSG_MAP(CStretchSkewDialog)
76         MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
77         MESSAGE_HANDLER(WM_CLOSE, OnClose)
78         COMMAND_ID_HANDLER(IDOK, OnOk)
79         COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
80     END_MSG_MAP()
81 
82     LRESULT OnInitDialog(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
83     LRESULT OnClose(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
84     LRESULT OnOk(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
85     LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
86 
87 public:
88     POINT percentage;
89     POINT angle;
90 };
91 
92 class CFontsDialog : public CDialogImpl<CFontsDialog>
93 {
94 public:
95     enum { IDD = IDD_FONTS };
96 
97     CFontsDialog();
98     void InitFontNames();
99     void InitFontSizes();
100     void InitToolbar();
101 
102     BEGIN_MSG_MAP(CFontsDialog)
103         MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
104         MESSAGE_HANDLER(WM_CLOSE, OnClose)
105         MESSAGE_HANDLER(WM_COMMAND, OnCommand)
106         MESSAGE_HANDLER(WM_MOVE, OnMove)
107         MESSAGE_HANDLER(WM_NOTIFY, OnNotify)
108         MESSAGE_HANDLER(WM_TOOLSMODELTOOLCHANGED, OnToolsModelToolChanged)
109         MESSAGE_HANDLER(WM_MEASUREITEM, OnMeasureItem)
110         MESSAGE_HANDLER(WM_DRAWITEM, OnDrawItem)
111     END_MSG_MAP()
112 
113 protected:
114     LRESULT OnInitDialog(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
115     LRESULT OnClose(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
116     LRESULT OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
117     LRESULT OnMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
118     LRESULT OnNotify(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
119     LRESULT OnToolsModelToolChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
120     LRESULT OnMeasureItem(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
121     LRESULT OnDrawItem(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
122     void OnFontSize(UINT codeNotify);
123     void OnFontName(UINT codeNotify);
124 };
125