ToolMap
Loading...
Searching...
No Matches
project_def_fields_dlg.h
1/***************************************************************************
2 project_def_fields_dlg.h
3 Display dialog for adding new field
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_FIELDS_DLG_H
20#define PROJECT_DEF_FIELDS_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/choicebk.h> // for the choicebook, sort of notebook
31#include <wx/notebook.h>
32#include <wx/spinctrl.h>
33
34#include "../core/prjdefmemmanage.h" // for different project specification.
35#include "../core/textparser.h" // for text parsing during importation
36#include "../core/tmvalidator.h" // for control input validation
37#include "listgenreport.h"
38#include "project_def_layers_dlg.h" // for using the dialog defined there
39#include "wxflatbutton.h"
40
41#define ID_DLGAFD 10011
42#define ID_DLGAFD_FIELD_DEF 10012
43#define ID_DLGAFD_DATA_TYPE 10013
44#define ID_DLGAFD_FIELD_PRECISION 10015
45#define ID_DLGAFD_FIELD_SCALE 10014
46#define ID_DLGAFD_RESULT 10016
47#define ID_DLGAFD_CONSTRAIN_PANEL 10017
48#define ID_DLGAFD_ORIENTATION_FIELD 10118
49#define ID_DLGAFD_CONSTRAIN_VALUES 10050
50#define ID_DLGAFD_CODED_VAL_LIST 10274
51#define ID_DLGAFD_VAL_ADD 10276
52#define ID_DLGAFD_VAL_REMOVE 10277
53#define ID_DLGAFD_VAL_IMPORT 10278
54#define ID_DLGAFD_VAL_EXPORT 10279
55#define SYMBOL_PROJECTDEFFIELDDLG_STYLE wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCLOSE_BOX
56#define SYMBOL_PROJECTDEFFIELDDLG_TITLE _("Edit Object Attribute")
57#define SYMBOL_PROJECTDEFFIELDDLG_IDNAME ID_DLGAFD
58#define SYMBOL_PROJECTDEFFIELDDLG_SIZE wxSize(400, -1)
59#define SYMBOL_PROJECTDEFFIELDDLG_POSITION wxDefaultPosition
60
62 private:
63 ProjectDefMemoryFieldsCodedVal* m_CodedValueObj;
64 PrjDefMemManage* m_pPrjDefinition;
65 int m_ChoiceIndex;
66
67 // void OnMySelectionChange (wxListEvent & event);
68
69 virtual void AfterAdding(bool bRealyAddItem);
70
71 virtual void AfterEditing(bool bRealyEdited);
72
73 virtual void BeforeAdding();
74
75 virtual void BeforeDeleting();
76
77 virtual void BeforeEditing();
78
79 virtual void AddingValueToArray(wxArrayString& myImportedValues);
80
81 public:
82 static const int ID_PARAMLIST;
83
84 ProjectDefFieldList(wxWindow* parent, wxWindowID id, wxSize size);
85
87
88 void PassPrjDefToList(PrjDefMemManage* myPrjMemManage) {
89 m_pPrjDefinition = myPrjMemManage;
90 }
91
92 // int GetParamType (wxString myTextParam);
93 //
94 // wxString GetParamType (int imyType);
95 //
96 // void AddItemToParamList(wxString myValue, wxString myComment, ACOMMENTPOSITION type);
97 // void SetChoiceList (wxChoice * myChoiceList) {m_ChoiceToDefault = myChoiceList;}
98 // DECLARE_EVENT_TABLE();
99};
100
101class ProjectDefFieldDlg : public wxDialog {
102 PRJDEF_FIELD_TYPE m_FieldTypeStatus;
103
104 ProjectDefMemoryFields* m_MemoryField;
105 PrjDefMemManage* m_pPrjDefinition;
106
107 // event functions
108 void OnShowLiveResults(wxCommandEvent& event);
109
110 void OnAddAllowedValue(wxCommandEvent& event);
111
112 void OnImportAllowedValue(wxCommandEvent& event);
113
114 void OnRemoveAllowedValue(wxCommandEvent& event);
115
116 void OnExportAllowedValue(wxCommandEvent& event);
117
118 // void OnFieldNameChange (wxCommandEvent & event);
119 void OnIdleValidateDlg(wxIdleEvent& event);
120
121 // transfering data private function.
122 void TransfertTextValues(bool bSendDataToDlg = FALSE);
123
124 void TransfertIntegerValues(bool bSendDataToDlg = FALSE);
125
126 void TransfertFloatValues(bool bSendDataToDlg = FALSE);
127
128 void TransfertDateValues(bool bSendDataToDlg = FALSE);
129
130 void TransfertEnumValues(bool bSendDataToDlg = FALSE);
131
132 bool m_bIsModeEditing;
133
134 void DisableControlsForEdition();
135
136 void HideUnusedTabs(int iIndexShow);
137
138 void _SetValidator();
139
140 DECLARE_DYNAMIC_CLASS(ProjectDefFieldDlg);
141 DECLARE_EVENT_TABLE();
142
143 public:
146
147 ProjectDefFieldDlg(wxWindow* parent, PrjDefMemManage* myPrjMemManage, bool isEditingMode = FALSE,
148 wxWindowID id = SYMBOL_PROJECTDEFFIELDDLG_IDNAME,
149 const wxString& caption = SYMBOL_PROJECTDEFFIELDDLG_TITLE,
150 const wxPoint& pos = SYMBOL_PROJECTDEFFIELDDLG_POSITION,
151 const wxSize& size = SYMBOL_PROJECTDEFFIELDDLG_SIZE,
152 long style = SYMBOL_PROJECTDEFFIELDDLG_STYLE);
153
155 bool Create(wxWindow* parent, wxWindowID id = SYMBOL_PROJECTDEFFIELDDLG_IDNAME,
156 const wxString& caption = SYMBOL_PROJECTDEFFIELDDLG_TITLE,
157 const wxPoint& pos = SYMBOL_PROJECTDEFFIELDDLG_POSITION,
158 const wxSize& size = SYMBOL_PROJECTDEFFIELDDLG_SIZE, long style = SYMBOL_PROJECTDEFFIELDDLG_STYLE);
159
162
164 void Init();
165
167 void CreateControls();
168
169 void SetMemoryFieldObject(ProjectDefMemoryFields* myMemField) {
170 m_MemoryField = myMemField;
171 }
172
173 ProjectDefMemoryFields* GetMemoryFieldObject() {
174 return m_MemoryField;
175 }
176
179 virtual bool TransferDataFromWindow();
180
181 virtual bool TransferDataToWindow();
182
183 ProjectDefFieldList* m_DlgAFD_Coded_Val_List;
184 wxTextCtrl* m_DlgAFD_Field_Def;
185 wxChoicebook* m_DlgAFD_Choicebook;
186 wxSpinCtrl* m_DlgAFD_Text_Length;
187 // wxCheckBox* m_DlgAFD_Orientation_Integer;
188 wxSpinCtrl* m_DlgAFD_Field_Precision;
189 wxSpinCtrl* m_DlgAFD_Field_Scale;
190 wxTextCtrl* m_DlgAFD_Result;
191 // wxCheckBox* m_DlgAFD_Orientation_Float;
192 wxButton* m_DlgAFD_Button_OK;
193};
194
195#endif
Definition listgenreport.h:319
Definition prjdefmemmanage.h:54
Definition project_def_fields_dlg.h:101
void Init()
Initialises member variables.
Definition project_def_fields_dlg.cpp:284
~ProjectDefFieldDlg()
Destructor.
Definition project_def_fields_dlg.cpp:282
bool Create(wxWindow *parent, wxWindowID id=SYMBOL_PROJECTDEFFIELDDLG_IDNAME, const wxString &caption=SYMBOL_PROJECTDEFFIELDDLG_TITLE, const wxPoint &pos=SYMBOL_PROJECTDEFFIELDDLG_POSITION, const wxSize &size=SYMBOL_PROJECTDEFFIELDDLG_SIZE, long style=SYMBOL_PROJECTDEFFIELDDLG_STYLE)
Creation.
Definition project_def_fields_dlg.cpp:265
virtual bool TransferDataFromWindow()
Definition project_def_fields_dlg.cpp:448
void CreateControls()
Creates the controls and sizers.
Definition project_def_fields_dlg.cpp:526
ProjectDefFieldDlg()
Constructors.
Definition project_def_fields_dlg.cpp:246
Definition project_def_fields_dlg.h:61
Storing coded val linked to a field in memory.
Definition projectdefmemory.h:137
Storing Fields property in memory.
Definition projectdefmemory.h:198