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_POSITION_CTRL_H_
19#define _RME_POSITION_CTRL_H_
20
21#include "numbertextctrl.h"
22
23class PositionCtrl : public wxStaticBoxSizer {
24public:
25 PositionCtrl(wxWindow* parent, const wxString& label, int x, int y, int z, int maxx = MAP_MAX_WIDTH, int maxy = MAP_MAX_HEIGHT, int maxz = MAP_MAX_LAYER);
26 ~PositionCtrl();
27
28 long GetX() const {
29 return x_field->GetIntValue();
30 }
31 long GetY() const {
32 return y_field->GetIntValue();
33 }
34 long GetZ() const {
35 return z_field->GetIntValue();
36 }
37 Position GetPosition() const;
38
39 void SetX(long value) {
40 x_field->SetIntValue(value);
41 }
42 void SetY(long value) {
43 y_field->SetIntValue(value);
44 }
45 void SetZ(long value) {
46 z_field->SetIntValue(value);
47 }
48 void SetPosition(Position pos);
49
50 bool Enable(bool enable = true);
51
52 void OnClipboardText(wxClipboardTextEvent&);
53
54protected:
55 NumberTextCtrl* x_field;
56 NumberTextCtrl* y_field;
57 NumberTextCtrl* z_field;
58
59private:
60 int maxWidth, maxHeight;
61};
62
63#endif
64