ToolMap
Loading...
Searching...
No Matches
project_def_layers_dlg.h
1/***************************************************************************
2 project_def_layers_dlg.h
3 Display Project Definition layers dialog (step 2 of a project definition)
4 -------------------
5 copyright : (C) 2007 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 PROJECT_DEF_LAYERS_DLG_H
20#define PROJECT_DEF_LAYERS_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/filedlg.h> // file selector dialog
31#include <wx/notebook.h>
32#include <wx/statline.h> // for static line in ProjectDefLayersEditObjectDlg
33
34#include "../core/prjdefmemmanage.h"
35#include "../core/textparser.h" // for text parsing during importation
36#include "listgenreport.h"
37#include "project_def_fields_dlg.h"
38#include "wxflatbutton.h"
39
41
43
45
46#define ID_DLGPDL 10007
47#define ID_DLGPDL_LAYER_TYPE 10000
48#define ID_DLGPDL_LAYER_NAME 10001
49#define ID_NOTEBOOK 10002
50#define ID_DLGPDL_PANEL_OBJ 10003
51#define ID_DLGPDL_OBJ_LIST 10009
52#define ID_DLGPDL_OBJECT_ADD 10010
53#define ID_DLGPDL_OBJECT_REMOVE 10225
54#define ID_DLGPDL_OBJECT_IMPORT 10251
55#define ID_DLGPDL_PANEL_FIELDS 10008
56#define ID_DLGPDL_FIELDS_LIST 10220
57#define ID_DLGPDL_FIELD_ADD 10005
58#define ID_DLGPDL_FIELD_REMOVE 10006
59#define ID_DLGPDL_CHK_ORIENTATION 10290
60#define SYMBOL_PROJECTDEFLAYERSDLG_STYLE wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCLOSE_BOX
61#define SYMBOL_PROJECTDEFLAYERSDLG_TITLE _("Thematic layer definition")
62#define SYMBOL_PROJECTDEFLAYERSDLG_IDNAME ID_DLGPDL
63#define SYMBOL_PROJECTDEFLAYERSDLG_SIZE wxSize(400, 300)
64#define SYMBOL_PROJECTDEFLAYERSDLG_POSITION wxDefaultPosition
65
67 private:
68 // void OnMySelectionChange (wxListEvent & event);
69 wxChoice* m_ChoiceToChange;
70 int m_SpatialType;
71
72 ProjectDefMemoryObjects* m_ObjectObj;
73 PrjDefMemManage* m_pPrjDefinition;
74
75 virtual void AfterAdding(bool bRealyAddItem);
76
77 virtual void AfterEditing(bool bRealyEdited);
78
79 virtual void BeforeAdding();
80
81 virtual void BeforeDeleting();
82
83 virtual void BeforeEditing();
84
85 virtual void AddingValueToArray(wxArrayString& myImportedValues);
86
87 public:
88 static const int ID_PARAMLIST;
89
90 ProjectDefLayersObjectList(wxWindow* parent, wxWindowID id, wxSize size);
91
93
94 PrjMemObjectsArray* m_ObjectsArray;
95
96 void SetSpatialType(int spatialtype) {
97 m_SpatialType = spatialtype;
98 }
99
100 void PassPrjDefToList(PrjDefMemManage* myPrjMemManage) {
101 m_pPrjDefinition = myPrjMemManage;
102 }
103};
104
106 private:
107 bool m_bIsModeEditing;
108
109 PrjDefMemManage* m_pPrjDefinition;
110 ProjectDefMemoryFields* m_FieldsObj;
111 wxCheckBox* m_ChkOrientation;
112
113 virtual void AfterAdding(bool bRealyAddItem);
114
115 virtual void AfterEditing(bool bRealyEdited);
116
117 virtual void BeforeAdding();
118
119 virtual void BeforeDeleting();
120
121 virtual void BeforeEditing();
122 // virtual void AddingValueToArray (wxArrayString & myImportedValues);
123
124 // pointer to the parent dialog
125 ProjectDefLayersDlg* m_DlgParent;
126
127 wxChoice* m_ChoiceToChange;
128
129 // event functions
130 void OnItemSelectChange(wxListEvent& event);
131
132 DECLARE_EVENT_TABLE();
133
134 public:
135 static const int ID_PARAMLIST;
136
137 ProjectDefLayersFieldsList(wxWindow* parent, wxWindowID id, wxSize size, ProjectDefLayersDlg* myDlg);
138
140
141 void PassPrjDefToList(PrjDefMemManage* myPrjMemManage) {
142 m_pPrjDefinition = myPrjMemManage;
143 }
144
145 void SetListCtrls(wxCheckBox* pChkOrientation = nullptr) {
146 m_ChkOrientation = pChkOrientation;
147 }
148
149 void SetOrientation(int orientation, const int& index);
150
151 bool IsOrientationAllowed(int index);
152 // int GetParamType (wxString myTextParam);
153 //
154 // wxString GetParamType (int imyType);
155 //
156 // void AddItemToParamList(wxString myValue, wxString myComment, ACOMMENTPOSITION type);
157 // void SetChoiceList (wxChoice * myChoiceList);
158 // DECLARE_EVENT_TABLE();
159};
160
162#define ID_PROJECTDEFLAYERSEDITOBJECTDLG 10117
163#define ID_DLGEO_CODE 10259
164#define ID_DLGEO_VALUE 10260
165#define ID_STATICLINE2 10261
166#define SYMBOL_PROJECTDEFLAYERSEDITOBJECTDLG_STYLE wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCLOSE_BOX
167#define SYMBOL_PROJECTDEFLAYERSEDITOBJECTDLG_TITLE _("Edit Object Kind")
168#define SYMBOL_PROJECTDEFLAYERSEDITOBJECTDLG_IDNAME ID_PROJECTDEFLAYERSEDITOBJECTDLG
169#define SYMBOL_PROJECTDEFLAYERSEDITOBJECTDLG_SIZE wxSize(400, 300)
170#define SYMBOL_PROJECTDEFLAYERSEDITOBJECTDLG_POSITION wxDefaultPosition
172
173class ProjectDefLayersEditObjectDlg : public wxDialog {
174 private:
175 void OnTextChange(wxCommandEvent& event);
176
181 ProjectDefMemoryObjects* m_ObjectObj;
182 ProjectDefMemoryFieldsCodedVal* m_CodedValObj;
183
184 void _SetValidator();
185
186 DECLARE_DYNAMIC_CLASS(ProjectDefLayersEditObjectDlg);
187 DECLARE_EVENT_TABLE();
188
189 public:
192
193 ProjectDefLayersEditObjectDlg(wxWindow* parent, wxWindowID id = SYMBOL_PROJECTDEFLAYERSEDITOBJECTDLG_IDNAME,
194 const wxString& caption = SYMBOL_PROJECTDEFLAYERSEDITOBJECTDLG_TITLE,
195 const wxPoint& pos = SYMBOL_PROJECTDEFLAYERSEDITOBJECTDLG_POSITION,
196 const wxSize& size = SYMBOL_PROJECTDEFLAYERSEDITOBJECTDLG_SIZE,
197 long style = SYMBOL_PROJECTDEFLAYERSEDITOBJECTDLG_STYLE);
198
200 bool Create(wxWindow* parent, wxWindowID id = SYMBOL_PROJECTDEFLAYERSEDITOBJECTDLG_IDNAME,
201 const wxString& caption = SYMBOL_PROJECTDEFLAYERSEDITOBJECTDLG_TITLE,
202 const wxPoint& pos = SYMBOL_PROJECTDEFLAYERSEDITOBJECTDLG_POSITION,
203 const wxSize& size = SYMBOL_PROJECTDEFLAYERSEDITOBJECTDLG_SIZE,
204 long style = SYMBOL_PROJECTDEFLAYERSEDITOBJECTDLG_STYLE);
205
208
210 void Init();
211
213 void CreateDlgControls();
214
216 virtual bool TransferDataToWindow();
217
218 virtual bool TransferDataFromWindow();
219
220 void SetMemoryObjectObject(ProjectDefMemoryObjects* myObjectObj) {
221 m_ObjectObj = myObjectObj;
222 }
223
224 void SetMemoryCodedValObject(ProjectDefMemoryFieldsCodedVal* myCodedValObj) {
225 m_CodedValObj = myCodedValObj;
226 }
227
228 wxTextCtrl* m_DlgEO_Code;
229 wxTextCtrl* m_DlgEO_Value;
230 wxButton* m_DlgEO_OK_Btn;
231};
232
233class ProjectDefLayersDlg : public wxDialog {
234 private:
235 wxString m_DlgPDL_Contour_Prefix;
236
237 ProjectDefFieldDlg* m_FieldDialog;
238 ProjectDefMemoryLayers* m_LayersObj;
239
240 PrjDefMemManage* m_pPrjDefinition;
241
242 void OnAddField(wxCommandEvent& event);
243
244 void OnRemoveField(wxCommandEvent& event);
245
246 void OnAddObject(wxCommandEvent& event);
247
248 void OnRemoveObject(wxCommandEvent& event);
249
250 void OnImportObject(wxCommandEvent& event);
251
252 void OnChangeOrientation(wxCommandEvent& event);
253
254 void OnSelectLayerType(wxCommandEvent& event);
255
256 void OnLayerNameChange(wxCommandEvent& event);
257
258 void UpdateDefaultPolygonBorderName(const wxString& name);
259
260 bool m_bIsModeEditing;
261 bool m_bIsModeAddingEditing;
262
263 void DisableControlsForEdition();
264
265 void ActivateOrientation();
266
267 DECLARE_DYNAMIC_CLASS(ProjectDefLayersDlg);
268 DECLARE_EVENT_TABLE();
269
270 public:
273
274 ProjectDefLayersDlg(wxWindow* parent, PrjDefMemManage* pPrjDef, bool isEditingMode = FALSE,
275 bool isAddingMode = FALSE, wxWindowID id = SYMBOL_PROJECTDEFLAYERSDLG_IDNAME,
276 const wxString& caption = SYMBOL_PROJECTDEFLAYERSDLG_TITLE,
277 const wxPoint& pos = SYMBOL_PROJECTDEFLAYERSDLG_POSITION,
278 const wxSize& size = SYMBOL_PROJECTDEFLAYERSDLG_SIZE,
279 long style = SYMBOL_PROJECTDEFLAYERSDLG_STYLE);
280
282 bool Create(wxWindow* parent, wxWindowID id = SYMBOL_PROJECTDEFLAYERSDLG_IDNAME,
283 const wxString& caption = SYMBOL_PROJECTDEFLAYERSDLG_TITLE,
284 const wxPoint& pos = SYMBOL_PROJECTDEFLAYERSDLG_POSITION,
285 const wxSize& size = SYMBOL_PROJECTDEFLAYERSDLG_SIZE, long style = SYMBOL_PROJECTDEFLAYERSDLG_STYLE);
286
289
290 // contain the list of fields
291 PrjMemFieldArray m_FieldArray;
292
294 void Init();
295
296 bool IsEditMode() {
297 return m_bIsModeEditing;
298 }
299
301 void CreateControls();
302
303 // void RemoveObjFromArray();
304
305 void SetMemoryLayersObject(ProjectDefMemoryLayers* myLayersObj) {
306 m_LayersObj = myLayersObj;
307 }
308
311 virtual bool TransferDataFromWindow();
312
313 virtual bool TransferDataToWindow();
314
317 wxTextCtrl* m_DlgPDL_Layer_Name;
318 wxPanel* m_DlgPDL_Panel_Obj;
319 ProjectDefLayersObjectList* m_DlgPDL_Object_List;
320 wxPanel* m_DlgPDL_Panel_Fields;
321 ProjectDefLayersFieldsList* m_DlgPDL_Fields_List;
322 wxCheckBox* m_DlgPDL_Orientation_FLD;
323
324 // control for line constructing polygons
325 wxStaticBoxSizer* m_DlgPDL_Contour_Static;
326 wxTextCtrl* m_DlgPDL_Contour_Name;
327};
328
329#endif
Definition listgenreport.h:319
Definition prjdefmemmanage.h:54
Definition project_def_fields_dlg.h:101
Definition project_def_layers_dlg.h:233
virtual bool TransferDataFromWindow()
Definition project_def_layers_dlg.cpp:657
void CreateControls()
Creates the controls and sizers.
Definition project_def_layers_dlg.cpp:797
~ProjectDefLayersDlg()
Destructor.
Definition project_def_layers_dlg.cpp:766
ProjectDefLayersDlg()
Constructors.
Definition project_def_layers_dlg.cpp:729
wxChoice * m_DlgPDL_Layer_Type
controls variables
Definition project_def_layers_dlg.h:316
void Init()
Initialises member variables.
Definition project_def_layers_dlg.cpp:772
bool Create(wxWindow *parent, wxWindowID id=SYMBOL_PROJECTDEFLAYERSDLG_IDNAME, const wxString &caption=SYMBOL_PROJECTDEFLAYERSDLG_TITLE, const wxPoint &pos=SYMBOL_PROJECTDEFLAYERSDLG_POSITION, const wxSize &size=SYMBOL_PROJECTDEFLAYERSDLG_SIZE, long style=SYMBOL_PROJECTDEFLAYERSDLG_STYLE)
Creation.
Definition project_def_layers_dlg.cpp:753
Definition project_def_layers_dlg.h:173
~ProjectDefLayersEditObjectDlg()
Destructor.
Definition project_def_layers_dlg.cpp:408
ProjectDefLayersEditObjectDlg()
Constructors.
Definition project_def_layers_dlg.cpp:385
void Init()
Initialises member variables.
Definition project_def_layers_dlg.cpp:410
bool Create(wxWindow *parent, wxWindowID id=SYMBOL_PROJECTDEFLAYERSEDITOBJECTDLG_IDNAME, const wxString &caption=SYMBOL_PROJECTDEFLAYERSEDITOBJECTDLG_TITLE, const wxPoint &pos=SYMBOL_PROJECTDEFLAYERSEDITOBJECTDLG_POSITION, const wxSize &size=SYMBOL_PROJECTDEFLAYERSEDITOBJECTDLG_SIZE, long style=SYMBOL_PROJECTDEFLAYERSEDITOBJECTDLG_STYLE)
Creation.
Definition project_def_layers_dlg.cpp:395
virtual bool TransferDataToWindow()
Data transfert process, function called automatically.
Definition project_def_layers_dlg.cpp:494
void CreateDlgControls()
Creates the controls and sizers.
Definition project_def_layers_dlg.cpp:419
Definition project_def_layers_dlg.h:105
void SetOrientation(int orientation, const int &index)
Set orientation for field.
Definition project_def_layers_dlg.cpp:328
bool IsOrientationAllowed(int index)
Check if a field may be used for orientation.
Definition project_def_layers_dlg.cpp:361
Definition project_def_layers_dlg.h:66
Storing coded val linked to a field in memory.
Definition projectdefmemory.h:137
Storing Fields property in memory.
Definition projectdefmemory.h:198
Storing layers properties in memory.
Definition projectdefmemory.h:246
Storing object properties in memory.
Definition projectdefmemory.h:168