dcbutton.h

main 64 lines · 1.6 KB Raw
Alex Alex Commit Map Editor 18/10/2026 23:40
1//////////////////////////////////////////////////////////////////////
2// This file is part of Remere's Map Editor
3//////////////////////////////////////////////////////////////////////
4// Remere's Map Editor is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Remere's Map Editor is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16//////////////////////////////////////////////////////////////////////
17
18#ifndef RME_DC_BUTTON_H
19#define RME_DC_BUTTON_H
20
21class Sprite;
22class GameSprite;
23class EditorSprite;
24
25enum {
26 DC_BTN_NORMAL,
27 DC_BTN_TOGGLE,
28};
29
30enum RenderSize {
31 RENDER_SIZE_16x16,
32 RENDER_SIZE_32x32,
33 RENDER_SIZE_64x64,
34};
35
36class DCButton : public wxPanel {
37public:
38 DCButton();
39 DCButton(wxWindow* parent, wxWindowID id, wxPoint pos, int type, RenderSize sz, int sprite_id);
40 virtual ~DCButton();
41
42 void SetValue(bool val);
43 bool GetValue() const;
44
45 void SetSprite(int id);
46
47 void OnPaint(wxPaintEvent&);
48 void OnClick(wxMouseEvent&);
49
50protected:
51 void SetOverlay(Sprite* espr);
52
53 int type;
54 bool state; // pressed/unpressed
55 RenderSize size;
56 Sprite* sprite;
57 Sprite* overlay;
58
59 DECLARE_DYNAMIC_CLASS(DCButton)
60 DECLARE_EVENT_TABLE()
61};
62
63#endif
64
Top