ToolMap
Loading...
Searching...
No Matches
tmsymboldlgpolygon.h
1/***************************************************************************
2 tmsymboldlgpolygon.h
3 Display Polygon Symbology dialog
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 _TM_SYMBOLDLGPOLYGON_H_
20#define _TM_SYMBOLDLGPOLYGON_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/imaglist.h>
31#include <wx/listctrl.h>
32#include <wx/notebook.h>
33#include <wx/spinctrl.h>
34#include <wx/wupdlock.h>
35
36#include "tmsymboldlg.h" // tmSymbolDlg declaration
37#include "tmsymbolrule.h"
38
39const int ID_SYMDLGPLG_PANEL = 10216;
40const int ID_SYMDLGPLG_NOTEBOOK = 10080;
41const int ID_SYMDLGPLG_PANEL2 = 10081;
42const int ID_SYMDLGPLG_BORDER_COLOR = 10082;
43const int ID_SYMDLGPLG_FILL_PATTERN = 10083;
44const int ID_SYMDLGPLG_BORDER_WIDTH = 10084;
45const int ID_SYMDLGPLG_FILL_COLOR = 10087;
46const int ID_SYMDLGPLG_PANEL3 = 10085;
47const int ID_SYMDLGPLG_PANEL4 = 10088;
48const int ID_SYMDLGPLG_TRANSPARENCY = 10086;
49
50const int ID_BTN_CLASSIFY = 10330;
51const int ID_BTN_ADD = 10331;
52const int ID_BTN_REMOVE = 10332;
53const int ID_BTN_REMOVEALL = 10333;
54const int ID_LIST_SYMBOL = 10334;
55const int ID_CONTEXT_MENU_EDIT_POLY = 10335;
56const int ID_CONTEXT_MENU_ENABLE_POLY = 10336;
57const int ID_CONTEXT_MENU_DISABLE_POLY = 10337;
58const int ID_CONTEXT_MENU_BORDER_COLOR_POLY = 10338;
59const int ID_CONTEXT_MENU_BORDER_WIDTH_POLY = 10339;
60const int ID_CONTEXT_MENU_FILL_COLOR_POLY = 10340;
61const int ID_CONTEXT_MENU_FILL_STYLE_POLY = 10341;
62const int ID_CONTEXT_MENU_TRANSPARENCY_POLY = 10342;
63
65
67
69
71 public:
72 int m_PanelNo;
73 wxColour m_bColour;
74 int m_bWidth;
75 wxColour m_fColour;
76 int m_fStyle;
77 int m_GlobalTransparency;
78
80 m_PanelNo = 0;
81 m_bColour = *wxBLACK;
82 m_bWidth = 1;
83 m_fColour = *wxBLACK;
84 m_fStyle = 0;
85 m_GlobalTransparency = 0;
86 }
87};
88
90 private:
91 wxColourPickerCtrl* m_PolygonBorderColourCtrl;
92 wxColourPickerCtrl* m_PolygonFillColourCtrl;
93 wxSpinCtrl* m_PolygonBorderWidthCtrl;
94 wxChoice* m_PolygonFillPattern;
95 tmSliderWithText* m_TransparencySlider;
96
98
99 void _Init();
100
101 void CreateControlsPoly();
102
103 virtual bool TransferDataToWindow();
104
105 virtual bool TransferDataFromWindow();
106
107 DECLARE_DYNAMIC_CLASS(tmSymbolDLGPolygon)
108
109 public:
112
114
115 tmSymbolDLGPolygon(wxWindow* parent, wxWindowID id = SYMBOL_TMSYMBOLDLG_IDNAME,
116 const wxString& caption = SYMBOL_TMSYMBOLDLG_TITLE,
117 const wxPoint& pos = SYMBOL_TMSYMBOLDLG_POSITION, const wxSize& size = SYMBOL_TMSYMBOLDLG_SIZE,
118 long style = SYMBOL_TMSYMBOLDLG_STYLE);
119
120 bool Create(wxWindow* parent, wxWindowID id = SYMBOL_TMSYMBOLDLG_IDNAME,
121 const wxString& caption = SYMBOL_TMSYMBOLDLG_TITLE, const wxPoint& pos = SYMBOL_TMSYMBOLDLG_POSITION,
122 const wxSize& size = SYMBOL_TMSYMBOLDLG_SIZE, long style = SYMBOL_TMSYMBOLDLG_STYLE);
123
124 void SetDialogData(const tmSymbolDataPolygonUnique& data) {
125 m_DlgData = data;
126 }
127
128 tmSymbolDataPolygonUnique GetDialogData() {
129 return m_DlgData;
130 }
131};
132
133/*************************************************************************************/
139 private:
140 wxNotebook* m_SymbologyTypeCtrl;
141 wxChoice* m_CategoryColumnCtrl;
142 DataListReportCtrl* m_SymbolListCtrl;
143 wxButton* m_ClassifyBtn;
144 wxButton* m_AddBtn;
145 wxButton* m_RemoveBtn;
146 wxButton* m_RemoveAllBtn;
147 wxImageList* m_ImgList;
148
149 // unique
150 wxColourPickerCtrl* m_PolygonBorderColourCtrl;
151 wxColourPickerCtrl* m_PolygonFillColourCtrl;
152 wxSpinCtrl* m_PolygonBorderWidthCtrl;
153 wxChoice* m_PolygonFillPattern;
154 tmSliderWithText* m_TransparencySlider;
155
156 tmSymbolRuleArray m_Rules;
157 tmLayerProperties* m_LayerProperties;
158 tmGISDataVectorSHP* m_GISData;
159
160 wxString m_SelectedField;
161 tmSymbolDataPolygonUnique m_PolyUniqueStyle;
162
163 void _CreateControls();
164
165 void _LoadTableData();
166
167 wxBitmap _CreateColorBitmap(const wxBrush& brush, const wxPen& pen);
168
169 void OnBtnClassify(wxCommandEvent& event);
170
171 void OnBtnAdd(wxCommandEvent& event);
172
173 void OnBtnRemove(wxCommandEvent& event);
174
175 void OnBtnRemoveAll(wxCommandEvent& event);
176
177 void OnDoubleClick(wxListEvent& event);
178
179 void OnRightClick(wxListEvent& event);
180
181 void OnMenuEdit(wxCommandEvent& event);
182
183 void OnMenuEndable(wxCommandEvent & event);
184
185 void OnMenuDisable(wxCommandEvent & event);
186
187 void OnMenuSetBorderColour(wxCommandEvent& event);
188
189 void OnMenuSetBorderWidth(wxCommandEvent& event);
190
191 void OnMenuSetFillColour(wxCommandEvent& event);
192
193 void OnMenuSetFillStyle(wxCommandEvent& event);
194
195 void OnMenuSetTransparency(wxCommandEvent& event);
196
197 void OnUpdateUIBtnRemove(wxUpdateUIEvent& event);
198
199 void OnUpdateUIBtnRemoveAll(wxUpdateUIEvent& event);
200
201 virtual bool TransferDataToWindow();
202
203 virtual bool TransferDataFromWindow();
204
205 void _EnableItems(bool enable);
206
207 DECLARE_EVENT_TABLE();
208
209 public:
210 tmSymbolDLGPolyRule(wxWindow* parent, tmLayerProperties* layerproperties = nullptr,
211 wxWindowID id = SYMBOL_TMSYMBOLDLG_IDNAME, const wxString& caption = SYMBOL_TMSYMBOLDLG_TITLE,
212 const wxPoint& pos = SYMBOL_TMSYMBOLDLG_POSITION, const wxSize& size = SYMBOL_TMSYMBOLDLG_SIZE,
213 long style = SYMBOL_TMSYMBOLDLG_STYLE);
214
215 virtual ~tmSymbolDLGPolyRule();
216
217 bool Create(wxWindow* parent, wxWindowID id = SYMBOL_TMSYMBOLDLG_IDNAME,
218 const wxString& caption = SYMBOL_TMSYMBOLDLG_TITLE, const wxPoint& pos = SYMBOL_TMSYMBOLDLG_POSITION,
219 const wxSize& size = SYMBOL_TMSYMBOLDLG_SIZE, long style = SYMBOL_TMSYMBOLDLG_STYLE);
220
221 tmSymbolRuleArray* GetRulesRef() {
222 return &m_Rules;
223 }
224
225 int GetSelectedPanel();
226
227 inline const wxString GetSelectedField() const;
228
229 inline const tmSymbolDataPolygonUnique GetPolyUniqueStyle() const;
230
231 void SetPolyUniqueStyle(tmSymbolDataPolygonUnique value);
232
233 void SetSelectedField(wxString value);
234
235 void SetSelectedPanel(int panelindex);
236
237};
238
239inline const wxString tmSymbolDLGPolyRule::GetSelectedField() const {
240 return m_SelectedField;
241}
242
243inline const tmSymbolDataPolygonUnique tmSymbolDLGPolyRule::GetPolyUniqueStyle() const {
244 return m_PolyUniqueStyle;
245}
246
247#endif
Definition datalistreportctrl.h:30
Definition tmgisdatavectorshp.h:36
Storing object of layer type.
Definition tmlayerproperties.h:47
Definition tmsliderwithtxt.h:47
Symbology dialog supporting rules.
Definition tmsymboldlgpolygon.h:138
Definition tmsymboldlgpolygon.h:89
tmSymbolDLGPolygon()
Constructors.
Definition tmsymboldlgpolygon.cpp:30
Definition tmsymboldlg.h:55
Definition tmsymboldlgpolygon.h:70