ToolMap
Loading...
Searching...
No Matches
queriespages.h
1/***************************************************************************
2 queriespages.h
3 Pages definition for the QueryWizard
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#ifndef _QUERIESPAGES_H
18#define _QUERIESPAGES_H
19
20// For compilers that support precompilation, includes "wx/wx.h".
21#include <wx/wxprec.h>
22// Include wxWidgets' headers
23#ifndef WX_PRECOMP
24#include <wx/wx.h>
25#endif
26
27#include <wx/spinctrl.h>
28
29#include "../core/prjdefmemmanage.h"
30#include "listgenreport.h"
31#include "querieswizard.h"
32
33class QueriesWizard;
34
36
37class QueriesPageName;
38
40
42
44
46
48
49class QueriesPageSQL;
50
52
54
56
58
59class DataBaseTM;
60
61class wxFlatButton;
62
63const int QUERIES_MARGIN_SIZE = 20;
64
66 private:
67 wxString m_Name;
68
69 wxString m_SQL;
70};
71
72WX_DECLARE_OBJARRAY(wxRadioButton*, wxArrayRadioButton);
73
74class QueriesPageIntro : public wxWizardPage {
75 private:
76 QueriesWizard* m_Parent;
77 wxArrayRadioButton m_RadioBtn;
78 DataBaseTM* m_pDB;
79
80 QueriesPageLayer* m_PageLayer;
81 QueriesPageName* m_PageName;
82 QueriesPageGeneric* m_PageGeneric;
83 QueriesPageSelection* m_PageSelection;
84 QueriesPageAttribut1* m_PageSelectionAttribut1;
85 QueriesPageExpert* m_PageExpert;
86 QueriesPageSQL* m_PageExpertSQL;
87 QueriesPageObject* m_PageObject;
88 QueriesPageObjectType* m_PageObjectType;
89 QueriesPageGeomLine* m_PageGeomLine;
90 QueriesPageGeomNodes* m_PageGeomNode;
91
92 int _GetRadioBoxSelection() const;
93
94 // event function
95 // void OnPageChanging(wxWizardEvent & event);
96 // void OnRadioButtonChange( wxCommandEvent& event );
97 // DECLARE_EVENT_TABLE();
98
99 public:
100 QueriesPageIntro(QueriesWizard* parent, DataBaseTM* database);
101
103
104 virtual wxWizardPage* GetPrev() const;
105
106 virtual wxWizardPage* GetNext() const;
107
108 void CreateControls();
109
110 virtual bool TransferDataToWindow();
111
112 virtual bool TransferDataFromWindow();
113};
114
116 public:
117 QueriesLayerList(wxWindow* parent, wxWindowID id, wxSize size = wxDefaultSize);
118
119 virtual ~QueriesLayerList();
120
121 void SetSelection(long index, bool selected = true);
122};
123
124class QueriesPageLayer : public wxWizardPageSimple {
125 private:
126 QueriesWizard* m_Parent;
127 QueriesLayerList* m_ListLayers;
128 DataBaseTM* m_pDB;
129
130 PrjMemLayersArray m_Layers;
131
132 void _CreateControls();
133
134 public:
135 QueriesPageLayer(QueriesWizard* parent, DataBaseTM* database, wxWizardPage* prev, wxWizardPage* next);
136
138
139 virtual bool TransferDataToWindow();
140
141 virtual bool TransferDataFromWindow();
142};
143
144/***************************************************************************/
149class QueriesPageObjectType : public wxWizardPageSimple {
150 private:
151 QueriesWizard* m_Parent;
152 DataBaseTM* m_pDB;
153 wxRadioBox* m_LayerType;
154
155 void _CreateControls();
156
157 public:
158 QueriesPageObjectType(QueriesWizard* parent, DataBaseTM* database, wxWizardPage* prev, wxWizardPage* next);
159
161
162 virtual bool TransferDataToWindow();
163
164 virtual bool TransferDataFromWindow();
165};
166
167/***************************************************************************/
172class QueriesPageObject : public wxWizardPageSimple {
173 private:
174 QueriesWizard* m_Parent;
175 DataBaseTM* m_pDB;
176 wxListBox* m_ListType;
177
178 PrjMemObjectsArray m_Objects;
179
180 void _CreateControls();
181
182 public:
183 QueriesPageObject(QueriesWizard* parent, DataBaseTM* database, wxWizardPage* prev, wxWizardPage* next);
184
186
187 virtual bool TransferDataToWindow();
188
189 virtual bool TransferDataFromWindow();
190};
191
192class QueriesPageSelection : public wxWizardPageSimple {
193 private:
194 QueriesWizard* m_Parent;
195 wxChoice* m_SelTypeList;
196 DataBaseTM* m_pDB;
197 PrjMemObjectsArray m_Types;
198
199 void _CreateControls();
200
201 public:
202 QueriesPageSelection(QueriesWizard* parent, DataBaseTM* database, wxWizardPage* prev, wxWizardPageSimple* next);
203
205
206 virtual bool TransferDataToWindow();
207
208 virtual bool TransferDataFromWindow();
209};
210
211/***************************************************************************/
216class QueriesPageAttribut1 : public wxWizardPageSimple {
217 private:
218 QueriesWizard* m_Parent;
219 DataBaseTM* m_pDB;
220 wxWizardPageSimple* m_PageName;
221 wxRadioBox* m_AdvAttribRadio;
222
223 QueriesPageAttribut2* m_QueryPageAttribut2;
224
225 void _CreateControls();
226
227 public:
228 QueriesPageAttribut1(QueriesWizard* parent, DataBaseTM* database, wxWizardPage* prev, wxWizardPage* next);
229
231
232 virtual bool TransferDataToWindow();
233
234 virtual bool TransferDataFromWindow();
235};
236
237class QueriesPageAttribut2 : public wxWizardPageSimple {
238 private:
239 QueriesWizard* m_Parent;
240 DataBaseTM* m_pDB;
241 wxListBox* m_AdvAttributs;
242 wxFlatButton* m_ReloadButton;
243
244 void _CreateControls();
245
246 void _LoadAttributs();
247
248 void OnReloadAttributs(wxCommandEvent& event);
249
250 void OnDeleteAttribut(wxKeyEvent& event);
251
252 public:
253 QueriesPageAttribut2(QueriesWizard* parent, DataBaseTM* database, wxWizardPageSimple* prev,
254 wxWizardPageSimple* next);
255
257
258 virtual bool TransferDataToWindow();
259
260 virtual bool TransferDataFromWindow();
261};
262
264 private:
265 wxArrayInt m_TargetLayer;
266
267 wxArrayString m_Description;
268
269 wxArrayString m_SQL;
270
271 void _Add(int layertarger, const wxString& description, const wxString& sql);
272
273 public:
275
277
278 void GetData(int index, int& layertarget, wxString& description, wxString& sql);
279
280 wxArrayString GetDescription();
281};
282
283class QueriesPageGeneric : public wxWizardPageSimple {
284 private:
285 QueriesWizard* m_Parent;
286 wxListBox* m_ListGeneric;
287 QueriesPageGenericData* m_GenericData;
288
289 protected:
290 void _CreateControls();
291
292 public:
293 QueriesPageGeneric(QueriesWizard* parent, wxWizardPage* prev = nullptr, wxWizardPage* next = nullptr);
294
296
297 virtual bool TransferDataToWindow();
298
299 virtual bool TransferDataFromWindow();
300};
301
302class QueriesPageExpert : public wxWizardPageSimple {
303 private:
304 QueriesWizard* m_Parent;
305 wxRadioBox* m_LayerType;
306
307 void _CreateControls();
308
309 public:
310 QueriesPageExpert(QueriesWizard* parent, wxWizardPage* prev, wxWizardPageSimple* next);
311
313
314 virtual bool TransferDataToWindow();
315
316 virtual bool TransferDataFromWindow();
317};
318
319class QueriesPageSQL : public wxWizardPageSimple {
320 private:
321 QueriesWizard* m_Parent;
322 wxTextCtrl* m_SQLText;
323
324 void _CreateControls();
325
326 public:
327 QueriesPageSQL(QueriesWizard* parent, wxWizardPageSimple* prev = nullptr, wxWizardPageSimple* next = nullptr);
328
330
331 virtual bool TransferDataToWindow();
332
333 virtual bool TransferDataFromWindow();
334};
335
336/***************************************************************************/
341class QueriesPageGeomLine : public wxWizardPageSimple {
342 private:
343 QueriesWizard* m_Parent;
344 wxSpinCtrl* m_SpinLineSize;
345 DataBaseTM* m_pDB;
346
347 void _CreateControls();
348
349 public:
350 QueriesPageGeomLine(QueriesWizard* parent, DataBaseTM* database, wxWizardPage* prev, wxWizardPage* next);
351
353
354 virtual bool TransferDataToWindow();
355
356 virtual bool TransferDataFromWindow();
357};
358
359/***************************************************************************/
364class QueriesPageGeomNodes : public wxWizardPageSimple {
365 private:
366 QueriesWizard* m_Parent;
367 wxSpinCtrl* m_SpinFewNodes;
368 DataBaseTM* m_pDB;
369
370 void _CreateControls();
371
372 public:
373 QueriesPageGeomNodes(QueriesWizard* parent, DataBaseTM* database, wxWizardPage* prev, wxWizardPage* next);
374
376
377 virtual bool TransferDataToWindow();
378
379 virtual bool TransferDataFromWindow();
380};
381
382class QueriesPageName : public wxWizardPageSimple {
383 private:
384 wxTextCtrl* m_TextName;
385 wxCheckBox* m_RunQueryBox;
386 QueriesWizard* m_Parent;
387
388 void _CreateControls();
389
390 public:
391 QueriesPageName(QueriesWizard* parent, wxWizardPage* prev, wxWizardPage* next);
392
394
395 virtual bool TransferDataToWindow();
396
397 virtual bool TransferDataFromWindow();
398};
399
400#endif
Definition database_tm.h:80
Manage a report list.
Definition listgenreport.h:63
Definition queriespages.h:65
Definition queriespages.h:115
Definition queriespages.h:216
Definition queriespages.h:237
Definition queriespages.h:302
Definition queriespages.h:263
Definition queriespages.h:283
Definition queriespages.h:341
Definition queriespages.h:364
Definition queriespages.h:74
Definition queriespages.h:124
Definition queriespages.h:382
Definition queriespages.h:149
Definition queriespages.h:172
Definition queriespages.h:319
Definition queriespages.h:192
Definition querieswizard.h:40
Definition wxflatbutton.h:61