ToolMap
Loading...
Searching...
No Matches
projectproperties_dlg.h
1/***************************************************************************
2 projectproperties_dlg.h
3 Contain description of class used for ProjectPropertiesDLG called
4 when user press Project->Edit->Project Settings menu
5 -------------------
6 copyright : (C) 2007 CREALP Lucien Schreiber
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef _PROJECTPROPERTIES_DLG_H_
19#define _PROJECTPROPERTIES_DLG_H_
20
21class ScaleList;
22
23class DataBaseTM;
24
25#include <wx/notebook.h>
26#include <wx/numdlg.h> // for Number entry dialog
27#include <wx/statline.h>
28#include <wx/tglbtn.h>
29
30#include "../core/prjdefmemmanage.h"
31#include "../core/scale.h" // for scale static conversion
32#include "../core/wxdirpickerctrlbest.h" // directory picker (best version)
33#include "listgenreport.h" // for base listgenreport definition
34#include "wxflatbutton.h"
35
36// class wxNotebook;
37class DataBaseTM;
38
39#define ID_PROJECTPROPERTIES 10132
40#define ID_DLGPS_NOTEBOOK 10141
41#define ID_DLGPS_PANEL_SETTINGS 10142
42#define ID_DLGPS_EXPORT_TYPE_CHOICE 10000
43#define ID_DLGPS_EXPORT_PATH 10001
44#define ID_DLGPS_BACKUP_PATH 10003
45#define ID_DLGPS_PANEL_SCALE 10133
46#define ID_DLGPS_SCALE_LIST 10134
47#define ID_DLGPS_BTN_SCALE_ADD 10239
48#define ID_DLGPS_BTN_SCALE_DEL 10240
49#define ID_DLGPS_SCALE_ORDER_CHOICE 10135
50#define SYMBOL_PROJECTPROPERTIESDLG_STYLE wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCLOSE_BOX
51#define SYMBOL_PROJECTPROPERTIESDLG_TITLE _("Project settings")
52#define SYMBOL_PROJECTPROPERTIESDLG_IDNAME ID_PROJECTPROPERTIES
53#define SYMBOL_PROJECTPROPERTIESDLG_SIZE wxSize(400, 300)
54#define SYMBOL_PROJECTPROPERTIESDLG_POSITION wxDefaultPosition
55
56/********************* ENUMERATION FOR ORDER OPTIONS ************************/
57// this is used in the wxChoice
58enum PRJPROPERTIES_SCALE_ORDER {
59 SCALE_ORDER_USER = 0,
60 SCALE_ORDER_ASCENDING,
61 SCALE_ORDER_DESCENDING
62};
63
64const wxString PRJPROPERTIES_SCALE_ORDER_STRING[] = {wxTRANSLATE("User defined"), wxTRANSLATE("Sort ascending"),
65 wxTRANSLATE("Sort descending")};
66
67class ProjectPropertiesDLG : public wxDialog {
68 DataBaseTM* m_DBHandler;
69 PrjDefMemManage m_PrjDefinition;
70
71 // event function
72 void OnSaveButton(wxCommandEvent& event);
73
74 void OnAddScaleButton(wxCommandEvent& event);
75
76 void OnRemoveScaleButton(wxCommandEvent& event);
77
78 void OnChooseScaleOrder(wxCommandEvent& event);
79
80 // controls
81 wxNotebook* m_DLGPS_Notebook;
82 wxChoice* m_DLGPS_Export_Type_Choice;
83 wxDirPickerCtrlBest* m_DLGPS_Export_Path;
84 wxDirPickerCtrlBest* m_DLGPS_Backup_Path;
85 ScaleList* m_DLGPS_Scale_List;
86 wxChoice* m_DLGPS_Scale_Order_Choice;
87
88 void _Init();
89
90 void _CreateControls();
91
92 DECLARE_DYNAMIC_CLASS(ProjectPropertiesDLG);
93 DECLARE_EVENT_TABLE();
94
95 public:
98
99 ProjectPropertiesDLG(wxWindow* parent, DataBaseTM* database, wxWindowID id = SYMBOL_PROJECTPROPERTIESDLG_IDNAME,
100 const wxString& caption = SYMBOL_PROJECTPROPERTIESDLG_TITLE,
101 const wxPoint& pos = SYMBOL_PROJECTPROPERTIESDLG_POSITION,
102 const wxSize& size = SYMBOL_PROJECTPROPERTIESDLG_SIZE,
103 long style = SYMBOL_PROJECTPROPERTIESDLG_STYLE);
104
105 bool Create(wxWindow* parent, wxWindowID id = SYMBOL_PROJECTPROPERTIESDLG_IDNAME,
106 const wxString& caption = SYMBOL_PROJECTPROPERTIESDLG_TITLE,
107 const wxPoint& pos = SYMBOL_PROJECTPROPERTIESDLG_POSITION,
108 const wxSize& size = SYMBOL_PROJECTPROPERTIESDLG_SIZE, long style = SYMBOL_PROJECTPROPERTIESDLG_STYLE);
109
111
112 virtual bool TransferDataToWindow();
113
114 void SetScaleListFocus();
115};
116
118 private:
119 DataBaseTM* m_DBHandler;
120 wxChoice* m_ChoiceOrder;
121 PrjDefMemManage* m_pPrjDefinition;
122 long m_ActualScale;
123
124 // init values into the list
125 void LoadValueIntoList();
126
127 // derived functions to implement
128 virtual void BeforeAdding();
129
130 virtual void AfterAdding(bool bRealyAddItem);
131
132 virtual void BeforeDeleting();
133
134 virtual void BeforeEditing();
135
136 virtual void AfterEditing(bool bRealyEdited);
137
138 DECLARE_EVENT_TABLE();
139
140 public:
142 ScaleList(wxWindow* parent, wxWindowID id, DataBaseTM* database, PrjDefMemManage* pProjectMem,
143 wxSize size = wxDefaultSize);
144
146 ~ScaleList();
147
148 // specific compare function for dealing with scales
149 virtual int Compare(int iColumnCompareType, const wxString& x_strValue1, const wxString& x_strValue2,
150 bool bAsending);
151
152 // pass pointer to ctrls to the list
153 void SetListCtrls(wxChoice* orderchoice = nullptr) {
154 m_ChoiceOrder = orderchoice;
155 }
156
157 void SetScaleToList(long lscale, int index = -1);
158
159 long GetScaleFromList(int index);
160};
161
162#endif
Definition database_tm.h:80
Definition listgenreport.h:319
Definition prjdefmemmanage.h:54
Definition projectproperties_dlg.h:67
void SetScaleListFocus()
Set focus to the scale list.
Definition projectproperties_dlg.cpp:289
ProjectPropertiesDLG()
Constructors.
Definition projectproperties_dlg.cpp:109
virtual bool TransferDataToWindow()
Transfert data to dialog.
Definition projectproperties_dlg.cpp:263
Definition projectproperties_dlg.h:117
virtual int Compare(int iColumnCompareType, const wxString &x_strValue1, const wxString &x_strValue2, bool bAsending)
Compare two values for sorting data.
Definition objectdefinitionlistdlg.cpp:307
~ScaleList()
Destructor.
Definition projectproperties_dlg.cpp:315
void SetScaleToList(long lscale, int index=-1)
Set the scale value.
Definition projectproperties_dlg.cpp:429
long GetScaleFromList(int index)
Get the scale value.
Definition projectproperties_dlg.cpp:451
Definition wxdirpickerctrlbest.h:40