Map Editor

RD Core / Commit #3

Commit Map Editor

Alex Alex committed 18/10/2026 23:40 main Patch
436 files +250,791 -0
A RD_Map_Editor/source/palette_brushlist.h +446-0 View file
@@ -0,0 +1,446 @@
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_PALETTE_BRUSHLIST_H_
19+#define RME_PALETTE_BRUSHLIST_H_
20+
21+#include <wx/panel.h>
22+#include <wx/listctrl.h>
23+#include <wx/vscroll.h>
24+#include <wx/timer.h>
25+#include <wx/dcbuffer.h>
26+#include <wx/sizer.h>
27+#include <wx/checkbox.h>
28+#include <wx/choice.h>
29+#include <wx/choicebk.h>
30+
31+#include <map>
32+#include <set>
33+#include <vector>
34+
35+#include "tileset.h"
36+#include "palette_common.h"
37+
38+// Forward declarations
39+class ItemPalettePanel;
40+class BrushPalettePanel;
41+class BrushButton;
42+class BrushPanel;
43+class BrushBoxInterface;
44+
45+enum BrushListType {
46+ BRUSHLIST_LARGE_ICONS,
47+ BRUSHLIST_SMALL_ICONS,
48+ BRUSHLIST_LISTBOX,
49+ BRUSHLIST_TEXT_LISTBOX,
50+ BRUSHLIST_GRID,
51+ BRUSHLIST_DIRECT_DRAW,
52+ BRUSHLIST_SEAMLESS_GRID
53+};
54+
55+enum {
56+ PALETTE_LAYOUT_STYLE_BORDER,
57+ PALETTE_LAYOUT_STYLE_LARGE,
58+ PALETTE_LAYOUT_STYLE_LISTBOX,
59+ PALETTE_LAYOUT_STYLE_NEWUI,
60+ BUTTON_QUICK_ADD_ITEM,
61+ BUTTON_ADD_BORDER
62+};
63+
64+// Custom ID for Quick Add button
65+#define BUTTON_QUICK_ADD_ITEM 1001
66+#define BUTTON_ADD_BORDER 1002
67+
68+class BrushBoxInterface {
69+public:
70+ BrushBoxInterface(const TilesetCategory* _tileset) :
71+ tileset(_tileset), loaded(false) {
72+ ASSERT(tileset);
73+ }
74+ virtual ~BrushBoxInterface() { }
75+
76+ virtual wxWindow* GetSelfWindow() = 0;
77+
78+ // Select the first brush
79+ virtual void SelectFirstBrush() = 0;
80+ // Returns the currently selected brush (First brush if panel is not loaded)
81+ virtual Brush* GetSelectedBrush() const = 0;
82+ // Select the brush in the parameter, this only changes the look of the panel
83+ virtual bool SelectBrush(const Brush* brush) = 0;
84+
85+protected:
86+ const TilesetCategory* tileset;
87+ bool loaded;
88+};
89+
90+// New class for direct drawing of sprites in grid
91+class DirectDrawBrushPanel : public wxScrolledWindow, public BrushBoxInterface {
92+public:
93+ DirectDrawBrushPanel(wxWindow* parent, const TilesetCategory* _tileset);
94+ ~DirectDrawBrushPanel();
95+
96+ wxWindow* GetSelfWindow() { return this; }
97+
98+ // Select the first brush
99+ void SelectFirstBrush();
100+ // Returns the currently selected brush
101+ Brush* GetSelectedBrush() const;
102+ // Select the brush in the parameter
103+ bool SelectBrush(const Brush* brush);
104+
105+ // Event handling
106+ void OnMouseClick(wxMouseEvent& event);
107+ void OnPaint(wxPaintEvent& event);
108+ void OnSize(wxSizeEvent& event);
109+ void OnScroll(wxScrollWinEvent& event);
110+ void OnTimer(wxTimerEvent& event);
111+
112+ // Make timer accessible
113+ wxTimer* loading_timer;
114+
115+protected:
116+ void RecalculateGrid();
117+ void DrawItemsToPanel(wxDC& dc);
118+ void UpdateViewableItems(); // Method for lazy loading visible items
119+ void StartProgressiveLoading(); // Method for progressive loading with visual feedback
120+
121+protected:
122+ int columns;
123+ int item_width;
124+ int item_height;
125+ int selected_index;
126+ wxBitmap* buffer;
127+
128+ // Lazy loading properties
129+ int first_visible_row;
130+ int last_visible_row;
131+ int visible_rows_margin; // Extra rows to load above/below viewport
132+ int total_rows;
133+ bool need_full_redraw;
134+
135+ // Progressive loading properties
136+ bool use_progressive_loading;
137+ bool is_large_tileset;
138+ int loading_step;
139+ int max_loading_steps;
140+ // Moved loading_timer to public section
141+
142+ static const int LARGE_TILESET_THRESHOLD = 1000; // Number of items considered "large"
143+
144+ DECLARE_EVENT_TABLE();
145+};
146+
147+class BrushListBox : public wxVListBox, public BrushBoxInterface {
148+public:
149+ BrushListBox(wxWindow* parent, const TilesetCategory* _tileset);
150+ ~BrushListBox();
151+
152+ wxWindow* GetSelfWindow() {
153+ return this;
154+ }
155+
156+ // Select the first brush
157+ void SelectFirstBrush();
158+ // Returns the currently selected brush (First brush if panel is not loaded)
159+ Brush* GetSelectedBrush() const;
160+ // Select the brush in the parameter, this only changes the look of the panel
161+ bool SelectBrush(const Brush* brush);
162+
163+ // Event handlers
164+ virtual void OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const;
165+ virtual wxCoord OnMeasureItem(size_t n) const;
166+
167+ void OnKey(wxKeyEvent& event);
168+
169+ DECLARE_EVENT_TABLE();
170+};
171+
172+class BrushIconBox : public wxScrolledWindow, public BrushBoxInterface {
173+public:
174+ BrushIconBox(wxWindow* parent, const TilesetCategory* _tileset, RenderSize rsz);
175+ ~BrushIconBox();
176+
177+ wxWindow* GetSelfWindow() {
178+ return this;
179+ }
180+
181+ // Scrolls the window to the position of the named brush button
182+ void EnsureVisible(BrushButton* btn);
183+ void EnsureVisible(size_t n);
184+
185+ // Select the first brush
186+ void SelectFirstBrush();
187+ // Returns the currently selected brush (First brush if panel is not loaded)
188+ Brush* GetSelectedBrush() const;
189+ // Select the brush in the parameter, this only changes the look of the panel
190+ bool SelectBrush(const Brush* brush);
191+
192+ // Event handling...
193+ void OnClickBrushButton(wxCommandEvent& event);
194+
195+protected:
196+ // Used internally to deselect all buttons before selecting a newd one.
197+ void DeselectAll();
198+
199+protected:
200+ std::vector<BrushButton*> brush_buttons;
201+ RenderSize icon_size;
202+
203+ DECLARE_EVENT_TABLE();
204+};
205+
206+class BrushGridBox : public wxScrolledWindow, public BrushBoxInterface {
207+public:
208+ BrushGridBox(wxWindow* parent, const TilesetCategory* _tileset);
209+ ~BrushGridBox();
210+
211+ wxWindow* GetSelfWindow() { return this; }
212+
213+ // Select the first brush
214+ void SelectFirstBrush();
215+ // Returns the currently selected brush
216+ Brush* GetSelectedBrush() const;
217+ // Select the brush in the parameter
218+ bool SelectBrush(const Brush* brush);
219+
220+ // Event handling
221+ void OnClickBrushButton(wxCommandEvent& event);
222+ void OnSize(wxSizeEvent& event);
223+
224+protected:
225+ void RecalculateGrid();
226+ void DeselectAll();
227+
228+protected:
229+ std::vector<BrushButton*> brush_buttons;
230+ wxFlexGridSizer* grid_sizer;
231+ int columns;
232+
233+ DECLARE_EVENT_TABLE();
234+};
235+
236+// New class for seamless sprite grid with direct rendering
237+class SeamlessGridPanel : public wxScrolledWindow, public BrushBoxInterface {
238+public:
239+ SeamlessGridPanel(wxWindow* parent, const TilesetCategory* _tileset);
240+ ~SeamlessGridPanel();
241+
242+ wxWindow* GetSelfWindow() { return this; }
243+
244+ // Select the first brush
245+ void SelectFirstBrush();
246+ // Returns the currently selected brush
247+ Brush* GetSelectedBrush() const;
248+ // Select the brush in the parameter
249+ bool SelectBrush(const Brush* brush);
250+
251+ // Set whether to display item IDs
252+ void SetShowItemIDs(bool show) { show_item_ids = show; Refresh(); }
253+ bool IsShowingItemIDs() const { return show_item_ids; }
254+
255+ // Zoom level control methods
256+ int GetZoomLevel() const { return zoom_level; }
257+ int IncrementZoom();
258+ int DecrementZoom();
259+ void SetZoomLevel(int level);
260+
261+ // Move to public section
262+ void ClearSpriteCache();
263+
264+ // Make timer accessible
265+ wxTimer* loading_timer;
266+
267+ // Event handling
268+ void OnMouseClick(wxMouseEvent& event);
269+ void OnMouseMove(wxMouseEvent& event);
270+ void OnPaint(wxPaintEvent& event);
271+ void OnSize(wxSizeEvent& event);
272+ void OnScroll(wxScrollWinEvent& event);
273+ void OnTimer(wxTimerEvent& event);
274+ void OnKeyDown(wxKeyEvent& event); // New keyboard handler
275+
276+protected:
277+ void RecalculateGrid();
278+ void DrawItemsToPanel(wxDC& dc);
279+ void DrawSpriteAt(wxDC& dc, int x, int y, int index);
280+ void UpdateViewableItems();
281+ void StartProgressiveLoading();
282+ void UpdateGridSize();
283+ // Moved ClearSpriteCache to public section
284+ void ManageSpriteCache();
285+ int GetSpriteIndexAt(int x, int y) const;
286+ void SelectIndex(int index);
287+ void CreateNavigationPanel(wxWindow* parent);
288+ void UpdateNavigationPanel();
289+ void OnNavigationButtonClicked(wxCommandEvent& event);
290+
291+private:
292+ int columns;
293+ int sprite_size;
294+ int zoom_level; // Zoom level (1=32px, 2=64px, etc)
295+ int selected_index;
296+ int hover_index;
297+ wxBitmap* buffer;
298+ bool show_item_ids;
299+
300+ // Rendering optimization
301+ int first_visible_row;
302+ int last_visible_row;
303+ int visible_rows_margin;
304+ int total_rows;
305+ bool need_full_redraw;
306+
307+ // Progressive loading for large tilesets
308+ bool use_progressive_loading;
309+ bool is_large_tileset;
310+ int loading_step;
311+ int max_loading_steps;
312+ // Moved loading_timer to public section
313+
314+ // Chunking properties
315+ int chunk_size; // Number of items per chunk
316+ int current_chunk; // Current chunk being displayed
317+ int total_chunks; // Total number of chunks
318+ wxRect prev_chunk_button; // Rectangle for previous chunk button
319+ wxRect next_chunk_button; // Rectangle for next chunk button
320+ wxPanel* navigation_panel; // Panel for navigation buttons
321+
322+ // Constants
323+ static const int LARGE_TILESET_THRESHOLD = 1000; // Number of items considered "large"
324+
325+ // Cache structure for sprite rendering
326+ struct CachedSprite {
327+ wxBitmap bitmap;
328+ int zoom_level;
329+ bool is_valid;
330+
331+ CachedSprite() : zoom_level(1), is_valid(false) {}
332+ };
333+
334+ std::map<int, CachedSprite> sprite_cache;
335+
336+ DECLARE_EVENT_TABLE();
337+};
338+
339+// A panel capable of displaying a collection of brushes
340+class BrushPanel : public wxPanel {
341+public:
342+ BrushPanel(wxWindow* parent);
343+ ~BrushPanel();
344+
345+ // Interface
346+ void InvalidateContents();
347+ void LoadContents();
348+
349+ // Sets the display type (list or icons)
350+ void SetListType(BrushListType ltype);
351+ void SetListType(wxString ltype);
352+ // Assigns a tileset to this list
353+ void AssignTileset(const TilesetCategory* tileset);
354+
355+ // Set whether to display item IDs
356+ void SetShowItemIDs(bool show);
357+
358+ // Select the first brush
359+ void SelectFirstBrush();
360+ // Returns the currently selected brush
361+ Brush* GetSelectedBrush() const;
362+ // Select the brush in the parameter
363+ bool SelectBrush(const Brush* whatbrush);
364+
365+ // Called when the window is about to be displayed
366+ void OnSwitchIn();
367+ // Called when this page is hidden
368+ void OnSwitchOut();
369+
370+ // wxWidgets event handlers
371+ void OnClickListBoxRow(wxCommandEvent& event);
372+ void OnViewModeToggle(wxCommandEvent& event);
373+ void OnShowItemIDsToggle(wxCommandEvent& event);
374+
375+ // Get the panel's sizer
376+ wxSizer* GetSizer() const { return sizer; }
377+
378+ // Make sizer public so it can be accessed from navigation panel
379+ wxSizer* sizer;
380+
381+protected:
382+ void LoadViewMode();
383+ void CleanupBrushbox(BrushBoxInterface* box);
384+
385+protected:
386+ const TilesetCategory* tileset;
387+ BrushBoxInterface* brushbox;
388+ bool loaded;
389+ BrushListType list_type;
390+ wxCheckBox* view_mode_toggle;
391+ wxChoice* view_type_choice;
392+ wxCheckBox* show_ids_toggle;
393+
394+ DECLARE_EVENT_TABLE();
395+};
396+
397+class BrushPalettePanel : public PalettePanel {
398+public:
399+ BrushPalettePanel(wxWindow* parent, const TilesetContainer& tilesets, TilesetCategoryType category, wxWindowID id = wxID_ANY);
400+ virtual ~BrushPalettePanel();
401+
402+ // Structure to hold selection information
403+ struct SelectionInfo {
404+ std::vector<Brush*> brushes;
405+ };
406+
407+ // Get currently selected brushes
408+ const SelectionInfo& GetSelectionInfo() const;
409+
410+ virtual void InvalidateContents() override;
411+ virtual void LoadCurrentContents() override;
412+ virtual void LoadAllContents() override;
413+
414+ PaletteType GetType() const override;
415+
416+ // Sets the display type (list or icons)
417+ void SetListType(BrushListType ltype);
418+ void SetListType(wxString ltype);
419+
420+ virtual void SelectFirstBrush() override;
421+ virtual Brush* GetSelectedBrush() const override;
422+ virtual bool SelectBrush(const Brush* whatbrush) override;
423+
424+ virtual void OnSwitchIn() override;
425+ void OnSwitchingPage(wxChoicebookEvent& event);
426+ void OnPageChanged(wxChoicebookEvent& event);
427+ void OnClickAddTileset(wxCommandEvent& event);
428+ void OnClickAddItemTileset(wxCommandEvent& event);
429+ void OnClickQuickAddItemTileset(wxCommandEvent& event);
430+ void OnClickCreateBorder(wxCommandEvent& event);
431+
432+ // Properly destroy all caches and resources
433+ void DestroyAllCaches();
434+
435+protected:
436+ wxButton* quick_add_button;
437+ std::string last_tileset_name;
438+ wxChoicebook* choicebook;
439+ TilesetCategoryType palette_type;
440+ PalettePanel* size_panel;
441+ std::map<wxWindow*, Brush*> remembered_brushes;
442+
443+ DECLARE_EVENT_TABLE();
444+};
445+
446+#endif
A RD_Map_Editor/source/palette_common.h +304-0 View file
@@ -0,0 +1,304 @@
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_PALETTE_COMMONS_H_
19+#define RME_PALETTE_COMMONS_H_
20+
21+#include "main.h"
22+
23+#include "dcbutton.h"
24+#include "tileset.h"
25+#include "gui_ids.h"
26+#include "common_windows.h"
27+
28+class GUI;
29+class BrushButton;
30+class TilesetCategory;
31+class BrushSizePanel;
32+class BrushPalettePanel;
33+class PaletteWindow;
34+
35+typedef TilesetCategoryType PaletteType;
36+
37+class BrushButton : public ItemToggleButton {
38+public:
39+ BrushButton(wxWindow* parent, Brush* brush, RenderSize, uint32_t id = wxID_ANY);
40+ BrushButton(wxWindow* parent, Brush* brush, RenderSize, EditorSprite* espr, uint32_t id = wxID_ANY);
41+ virtual ~BrushButton();
42+
43+ Brush* brush;
44+
45+ void OnKey(wxKeyEvent& event);
46+
47+ DECLARE_EVENT_TABLE()
48+};
49+
50+class PalettePanel : public wxPanel {
51+public:
52+ PalettePanel(wxWindow* parent, wxWindowID id = wxID_ANY, long style = wxTAB_TRAVERSAL);
53+ ~PalettePanel();
54+
55+ // Interface
56+ // Flushes this panel and consequent views will feature reloaded data
57+ virtual void InvalidateContents();
58+ // Loads the currently displayed page
59+ virtual void LoadCurrentContents();
60+ // Loads all content in this panel
61+ virtual void LoadAllContents();
62+
63+ PaletteWindow* GetParentPalette() const;
64+ virtual wxString GetName() const;
65+ virtual PaletteType GetType() const;
66+
67+ // Add a tool panel!
68+ virtual void AddToolPanel(PalettePanel* panel);
69+ // Sets the style for this toolbar and child toolabrs
70+ virtual void SetToolbarIconSize(bool large_icons);
71+
72+ // Select the first brush
73+ virtual void SelectFirstBrush();
74+ // Returns the currently selected brush (First brush if panel is not loaded)
75+ virtual Brush* GetSelectedBrush() const;
76+ // Returns the currently selected brush size
77+ virtual int GetSelectedBrushSize() const;
78+ // Select the brush in the parameter, this only changes the look of the panel
79+ virtual bool SelectBrush(const Brush* whatbrush);
80+
81+ virtual void DeselectAll() { }
82+
83+ // Updates the palette window to use the current brush size
84+ virtual void OnUpdateBrushSize(BrushShape shape, int size);
85+ // Called when this page is about to be displayed
86+ virtual void OnSwitchIn();
87+ // Called when this page is hidden
88+ virtual void OnSwitchOut();
89+ // Called sometimes
90+ virtual void OnUpdate();
91+ // When the palette should do a delayed refresh (necessary for multiple palettes)
92+ void OnRefreshTimer(wxTimerEvent&);
93+
94+ void RefreshOtherPalettes();
95+
96+protected:
97+ typedef std::vector<PalettePanel*> ToolBarList;
98+ ToolBarList tool_bars;
99+ wxTimer refresh_timer;
100+ int last_brush_size;
101+
102+ DECLARE_EVENT_TABLE();
103+};
104+
105+class ZoneBrushPanel : public PalettePanel {
106+public:
107+ ZoneBrushPanel(wxWindow* parent);
108+ ~ZoneBrushPanel() { }
109+
110+ // Interface
111+ // Flushes this panel and consequent views will feature reloaded data
112+ void InvalidateContents();
113+ // Loads the currently displayed page
114+ void LoadCurrentContents();
115+ // Loads all content in this panel
116+ void LoadAllContents();
117+
118+ // Returns the currently selected brush (First brush if panel is not loaded)
119+ Brush* GetSelectedBrush() const;
120+ // Select the brush in the parameter, this only changes the look of the panel
121+ bool SelectBrush(const Brush* whatbrush);
122+
123+ wxString GetName() const;
124+ void SetToolbarIconSize(bool large);
125+ void OnZoneIdChange(wxCommandEvent& WXUNUSED(event));
126+
127+ // Called when this page is displayed
128+ void OnSwitchIn();
129+
130+ // wxWidgets event handling
131+ void OnClickZoneBrushButton(wxCommandEvent& event);
132+ void DeselectAll();
133+
134+protected:
135+ bool loaded;
136+ bool large_icons;
137+
138+ BrushButton* zoneButton;
139+ wxSpinCtrl* zoneIdSpin;
140+
141+ DECLARE_EVENT_TABLE()
142+};
143+
144+class BrushSizePanel : public PalettePanel {
145+public:
146+ BrushSizePanel(wxWindow* parent);
147+ ~BrushSizePanel() { }
148+
149+ // Interface
150+ // Flushes this panel and consequent views will feature reloaded data
151+ void InvalidateContents();
152+ // Loads the currently displayed page
153+ void LoadCurrentContents();
154+ // Loads all content in this panel
155+ void LoadAllContents();
156+
157+ wxString GetName() const;
158+ void SetToolbarIconSize(bool large);
159+
160+ // Updates the palette window to use the current brush size
161+ void OnUpdateBrushSize(BrushShape shape, int size);
162+ // Called when this page is displayed
163+ void OnSwitchIn();
164+
165+ // wxWidgets event handling
166+ void OnClickSquareBrush(wxCommandEvent& event);
167+ void OnClickCircleBrush(wxCommandEvent& event);
168+
169+ void OnClickBrushSize(int which);
170+ void OnClickBrushSize0(wxCommandEvent& event) {
171+ OnClickBrushSize(0);
172+ }
173+ void OnClickBrushSize1(wxCommandEvent& event) {
174+ OnClickBrushSize(1);
175+ }
176+ void OnClickBrushSize2(wxCommandEvent& event) {
177+ OnClickBrushSize(2);
178+ }
179+ void OnClickBrushSize4(wxCommandEvent& event) {
180+ OnClickBrushSize(4);
181+ }
182+ void OnClickBrushSize6(wxCommandEvent& event) {
183+ OnClickBrushSize(6);
184+ }
185+ void OnClickBrushSize8(wxCommandEvent& event) {
186+ OnClickBrushSize(8);
187+ }
188+ void OnClickBrushSize11(wxCommandEvent& event) {
189+ OnClickBrushSize(11);
190+ }
191+
192+protected:
193+ bool loaded;
194+ bool large_icons;
195+
196+ DCButton* brushshapeSquareButton;
197+ DCButton* brushshapeCircleButton;
198+
199+ DCButton* brushsize0Button;
200+ DCButton* brushsize1Button;
201+ DCButton* brushsize2Button;
202+ DCButton* brushsize4Button;
203+ DCButton* brushsize6Button;
204+ DCButton* brushsize8Button;
205+ DCButton* brushsize11Button;
206+
207+ DECLARE_EVENT_TABLE()
208+};
209+
210+class BrushToolPanel : public PalettePanel {
211+public:
212+ BrushToolPanel(wxWindow* parent);
213+ ~BrushToolPanel();
214+
215+ // Interface
216+ // Flushes this panel and consequent views will feature reloaded data
217+ void InvalidateContents();
218+ // Loads the currently displayed page
219+ void LoadCurrentContents();
220+ // Loads all content in this panel
221+ void LoadAllContents();
222+
223+ wxString GetName() const;
224+ void SetToolbarIconSize(bool large);
225+
226+ // Returns the currently selected brush (First brush if panel is not loaded)
227+ Brush* GetSelectedBrush() const;
228+ // Select the brush in the parameter, this only changes the look of the panel
229+ bool SelectBrush(const Brush* whatbrush);
230+
231+ // Called when this page is displayed
232+ void OnSwitchIn();
233+
234+ // wxWidgets event handling
235+ void OnClickGravelButton(wxCommandEvent& event);
236+ void OnClickEraserButton(wxCommandEvent& event);
237+ // ----
238+ void OnClickNormalDoorButton(wxCommandEvent& event);
239+ void OnClickLockedDoorButton(wxCommandEvent& event);
240+ void OnClickMagicDoorButton(wxCommandEvent& event);
241+ void OnClickQuestDoorButton(wxCommandEvent& event);
242+ void OnClickHatchDoorButton(wxCommandEvent& event);
243+ void OnClickWindowDoorButton(wxCommandEvent& event);
244+ void OnClickNormalAltDoorButton(wxCommandEvent& event);
245+ void OnClickArchwayDoorButton(wxCommandEvent& event);
246+ // ----
247+ void OnClickPZBrushButton(wxCommandEvent& event);
248+ void OnClickNOPVPBrushButton(wxCommandEvent& event);
249+ void OnClickNoLogoutBrushButton(wxCommandEvent& event);
250+ void OnClickPVPZoneBrushButton(wxCommandEvent& event);
251+ // ----
252+ void OnClickLockDoorCheckbox(wxCommandEvent& event);
253+
254+public:
255+ void DeselectAll();
256+
257+ bool loaded;
258+ bool large_icons;
259+
260+ BrushButton* optionalBorderButton;
261+ BrushButton* eraserButton;
262+ // ----
263+ BrushButton* normalDoorButton;
264+ BrushButton* lockedDoorButton;
265+ BrushButton* magicDoorButton;
266+ BrushButton* questDoorButton;
267+ BrushButton* hatchDoorButton;
268+ BrushButton* windowDoorButton;
269+ BrushButton* normalDoorAltButton;
270+ BrushButton* archwayDoorButton;
271+ // ----
272+ BrushButton* pzBrushButton;
273+ BrushButton* nopvpBrushButton;
274+ BrushButton* nologBrushButton;
275+ BrushButton* pvpzoneBrushButton;
276+
277+ wxCheckBox* lockDoorCheckbox;
278+
279+ DECLARE_EVENT_TABLE()
280+};
281+
282+class BrushThicknessPanel : public PalettePanel {
283+public:
284+ BrushThicknessPanel(wxWindow* parent);
285+ ~BrushThicknessPanel();
286+
287+ // Interface
288+ wxString GetName() const;
289+
290+ // Called when this page is displayed
291+ void OnSwitchIn();
292+
293+ // wxWidgets event handling
294+ void OnScroll(wxScrollEvent& event);
295+ void OnClickCustomThickness(wxCommandEvent& event);
296+
297+public:
298+ wxSlider* slider;
299+ wxCheckBox* use_button;
300+
301+ DECLARE_EVENT_TABLE()
302+};
303+
304+#endif
Top