ToolMap
Loading...
Searching...
No Matches
editvertex_dlg.h
1/***************************************************************************
2 editvertex_dlg.h
3 Dialog for manuel editing vertex position
4 -------------------
5 copyright : (C) 2009 CREALP Lucien Schreiber
6 ***************************************************************************/
7
8/***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16
17// comment doxygen
18
19#ifndef _TM_EDIT_VERTEX_DLG_H_
20#define _TM_EDIT_VERTEX_DLG_H_
21
22// For compilers that support precompilation, includes "wx/wx.h".
23#include <wx/wxprec.h>
24
25// Include wxWidgets' headers
26#ifndef WX_PRECOMP
27#include <wx/wx.h>
28#endif
29
30#include <wx/grid.h> // for grid definition
31#include <wx/statline.h> // for staticline
32
33#include "../core/tmarraysize.h" // for array of real
34#include "../gis/tmlayerpropertiesdef.h" // for LAYER_LINE definitions
35#include "wxflatbutton.h" // for flat buttons.
36
37#define ID_BTN_ADD_VERTEX 22100
38#define ID_BTN_REMOVE_VERTEX 22101
39#define ID_BTN_DISPLAYVERTEX 22102
40
41const int tmVERTEX_PRECISION = 10;
42
43// EVENT
44DECLARE_EVENT_TYPE(tmEVT_EV_DISPLAY_VERTEX_COORD, -1);
45
46// margin for systems
47const int gSizeMargin = 10;
48
49/***************************************************************************/
67class EditVertexDLG : public wxDialog {
68 private:
69 // member controls
70 wxGrid* m_VertexGrid;
71 wxFlatButton* m_DisplayVertexPosBtn;
72 wxStatusBar* m_Status;
73 wxFlatButton* m_BtnAddVertex;
74 wxFlatButton* m_BtnRemoveVertex;
75 wxButton* m_BtnUpdate;
76
77 // member functions
78 void CreateControls();
79
80 // status function
81 void SetStatusSelectedID(long oid);
82
83 void SetStatusNumberVertex(int ivertexnumber);
84
85 // buttons update functions
86 void UpdateAddVertexButton(bool selection);
87
88 void UpdateRemoveVertexButton(bool selection);
89
90 void UpdateHighlightVertexButton(bool selection);
91
92 void UpdateSaveButton();
93
94 // validation function
95 bool IsAllCellsNumber(int& col, int& row);
96
97 // Grid functions
98 bool GridInsertLine(int iIndex = -1, wxRealPoint* pt = nullptr);
99
100 bool GridClear();
101
102 int GridGetSelection();
103
104 // event function
105 void OnVertexAdd(wxCommandEvent& event);
106
107 void OnVertexRemove(wxCommandEvent& event);
108
109 void OnVertexHighlight(wxCommandEvent& event);
110
111 void OnIdleTime(wxIdleEvent& event);
112
113 void OnSave(wxCommandEvent& event);
114
115 DECLARE_EVENT_TABLE();
116
117 public:
118 // ctor and dtor
119 EditVertexDLG(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Edit Vertex"),
120 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
121 long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
122
124
125 // member for data exchange
126 wxArrayRealPoints m_VertexPts;
127 long m_SelectedOID;
128 int m_LayerType;
129
130 // data transfert, called automatically
131 virtual bool TransferDataToWindow();
132
133 virtual bool TransferDataFromWindow();
134};
135
136#endif
Display a dialog for editing vertex position.
Definition editvertex_dlg.h:67
~EditVertexDLG()
Destructor.
Definition editvertex_dlg.cpp:52
virtual bool TransferDataFromWindow()
Data transfert.
Definition editvertex_dlg.cpp:197
virtual bool TransferDataToWindow()
Data transfert.
Definition editvertex_dlg.cpp:179
Definition wxflatbutton.h:61