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_PROPERTIES_WINDOW_H_
19#define RME_PROPERTIES_WINDOW_H_
20
21#include "main.h"
22
23#include "common_windows.h"
24
25class ContainerItemButton;
26class ContainerItemPopupMenu;
27class ItemAttribute;
28
29class PropertiesWindow : public ObjectPropertiesWindowBase {
30public:
31 PropertiesWindow(wxWindow* parent, const Map* map, const Tile* tile, Item* item, wxPoint position = wxDefaultPosition);
32 ~PropertiesWindow();
33
34 void OnClickOK(wxCommandEvent&);
35 void OnClickCancel(wxCommandEvent&);
36 void OnClickAddAttribute(wxCommandEvent&);
37 void OnClickRemoveAttribute(wxCommandEvent&);
38
39 void OnResize(wxSizeEvent&);
40 void OnNotebookPageChanged(wxNotebookEvent&);
41 void OnGridValueChanged(wxGridEvent&);
42
43 void Update();
44
45protected:
46 // Simple pane
47 wxWindow* createGeneralPanel(wxWindow* parent);
48 void saveGeneralPanel();
49
50 // Container pane
51 std::vector<ContainerItemButton*> container_items;
52 wxWindow* createContainerPanel(wxWindow* parent);
53 void saveContainerPanel();
54
55 // Advanced pane
56 wxGrid* attributesGrid;
57 wxWindow* createAttributesPanel(wxWindow* parent);
58 void saveAttributesPanel();
59 void SetGridValue(wxGrid* grid, int rowIndex, std::string name, const ItemAttribute& attr);
60
61protected:
62 wxNotebook* notebook;
63 wxWindow* currentPanel;
64
65 DECLARE_EVENT_TABLE()
66};
67
68#endif
69