ToolMap
Loading...
Searching...
No Matches
tmsymboldlgline.h
1/***************************************************************************
2 tmsymboldlgline.h
3 Display Line 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#ifndef _TM_SYMBOLDLGLINE_H_
17#define _TM_SYMBOLDLGLINE_H_
18
19// For compilers that support precompilation, includes "wx/wx.h".
20#include <wx/wxprec.h>
21
22// Include wxWidgets' headers
23#ifndef WX_PRECOMP
24#include <wx/wx.h>
25#endif
26
27#include <wx/imaglist.h>
28#include <wx/listctrl.h>
29#include <wx/notebook.h>
30#include <wx/spinctrl.h>
31#include <wx/wupdlock.h>
32
33#include "tmsymboldlg.h" // tmSymbolDlg declaration
34#include "tmsymbolrule.h"
35
36const int ID_SYMDLGL_PANEL = 10216;
37const int ID_SYMDLGL_NOTEBOOK = 10080;
38const int ID_SYMDLGL_PANEL2 = 10081;
39const int ID_SYMDLGL_COLOR = 10082;
40const int ID_SYMDLGL_PATTERN = 10083;
41const int ID_SYMDLGL_WIDTH = 10084;
42const int ID_SYMDLGL_PANEL3 = 10085;
43const int ID_SYMDLGL_PANEL4 = 10088;
44const int ID_SYMDLGL_TRANSPARENCY = 10086;
45
46const int ID_BTN_CLASSIFY_LINE = 10330;
47const int ID_BTN_ADD_LINE = 10331;
48const int ID_BTN_REMOVE_LINE = 10332;
49const int ID_BTN_REMOVEALL_LINE = 10333;
50const int ID_LIST_SYMBOL_LINE = 10334;
51
52const int ID_CONTEXT_MENU_EDIT_LINE = 10343;
53const int ID_CONTEXT_MENU_ENABLE_LINE = 10344;
54const int ID_CONTEXT_MENU_DISABLE_LINE = 10345;
55const int ID_CONTEXT_MENU_LINE_COLOR_LINE = 10346;
56const int ID_CONTEXT_MENU_LINE_STYLE_LINE = 10347;
57const int ID_CONTEXT_MENU_LINE_WIDTH_LINE = 10348;
58const int ID_CONTEXT_MENU_TRANSPARENCY_LINE = 10349;
59
61
63
65
67 public:
68 int m_PanelNo;
69 wxColour m_Colour;
70 int m_Shape;
71 int m_Width;
72 int m_GlobalTransparency;
73
75 m_PanelNo = 0;
76 m_Colour = *wxBLACK;
77 m_Shape = 0;
78 m_Width = 1;
79 m_GlobalTransparency = 0;
80 }
81};
82
84 private:
85 wxColourPickerCtrl* m_LineColourCtrl;
86 wxSpinCtrl* m_LineWidthCtrl;
87 wxChoice* m_LinePatternCtrl;
88 tmSliderWithText* m_TransparencySlider;
89
90 tmSymbolDataLineUnique m_DlgData;
91
92 void _Init();
93
94 void CreateControlsLine();
95
96 virtual bool TransferDataToWindow();
97
98 virtual bool TransferDataFromWindow();
99
100 DECLARE_DYNAMIC_CLASS(tmSymbolDLGLine)
101
102 DECLARE_EVENT_TABLE()
103
104 public:
107
109
110 tmSymbolDLGLine(wxWindow* parent, wxWindowID id = SYMBOL_TMSYMBOLDLG_IDNAME,
111 const wxString& caption = SYMBOL_TMSYMBOLDLG_TITLE,
112 const wxPoint& pos = SYMBOL_TMSYMBOLDLG_POSITION, const wxSize& size = SYMBOL_TMSYMBOLDLG_SIZE,
113 long style = SYMBOL_TMSYMBOLDLG_STYLE);
114
115 bool Create(wxWindow* parent, wxWindowID id = SYMBOL_TMSYMBOLDLG_IDNAME,
116 const wxString& caption = SYMBOL_TMSYMBOLDLG_TITLE, const wxPoint& pos = SYMBOL_TMSYMBOLDLG_POSITION,
117 const wxSize& size = SYMBOL_TMSYMBOLDLG_SIZE, long style = SYMBOL_TMSYMBOLDLG_STYLE);
118
119 void SetDialogData(const tmSymbolDataLineUnique& data) {
120 m_DlgData = data;
121 }
122
123 tmSymbolDataLineUnique GetDialogData() {
124 return m_DlgData;
125 }
126};
127
128/*************************************************************************************/
134 private:
135 wxNotebook* m_SymbologyTypeCtrl;
136 wxChoice* m_CategoryColumnCtrl;
137 DataListReportCtrl* m_SymbolListCtrl;
138 wxButton* m_ClassifyBtn;
139 wxButton* m_AddBtn;
140 wxButton* m_RemoveBtn;
141 wxButton* m_RemoveAllBtn;
142 wxImageList* m_ImgList;
143
144 // unique
145 wxColourPickerCtrl* m_LineColourCtrl;
146 wxSpinCtrl* m_LineWidthCtrl;
147 wxChoice* m_LinePatternCtrl;
148 tmSliderWithText* m_TransparencySlider;
149
150 tmSymbolRuleArray m_Rules;
151 tmLayerProperties* m_LayerProperties;
152
153 tmGISDataVectorSHP* m_GISData;
154 wxString m_SelectedField;
155 tmSymbolDataLineUnique m_LineUniqueStyle;
156
157 void _CreateControls();
158
159 void _LoadTableData();
160
161 wxBitmap _CreateColorBitmap(const wxBrush& brush, const wxPen& pen);
162
163 void OnBtnClassify(wxCommandEvent& event);
164
165 void OnBtnAdd(wxCommandEvent& event);
166
167 void OnBtnRemove(wxCommandEvent& event);
168
169 void OnBtnRemoveAll(wxCommandEvent& event);
170
171 void OnDoubleClick(wxListEvent& event);
172
173 void OnRightClick(wxListEvent& event);
174
175 void OnMenuEdit(wxCommandEvent& event);
176
177 void OnMenuDisable(wxCommandEvent& event);
178
179 void OnMenuEnable(wxCommandEvent& event);
180
181 void OnMenuLineColor(wxCommandEvent& event);
182
183 void OnMenuLineStyle(wxCommandEvent& event);
184
185 void OnMenuLineWidth(wxCommandEvent& event);
186
187 void OnMenuTransparency(wxCommandEvent& event);
188
189 void OnUpdateUIBtnRemove(wxUpdateUIEvent& event);
190
191 void OnUpdateUIBtnRemoveAll(wxUpdateUIEvent& event);
192
193 void _EnableItems(bool enable);
194
195 virtual bool TransferDataToWindow();
196
197 virtual bool TransferDataFromWindow();
198
199 DECLARE_EVENT_TABLE();
200
201 public:
202 tmSymbolDLGLineRule(wxWindow* parent, tmLayerProperties* layerproperties = nullptr,
203 wxWindowID id = SYMBOL_TMSYMBOLDLG_IDNAME, const wxString& caption = SYMBOL_TMSYMBOLDLG_TITLE,
204 const wxPoint& pos = SYMBOL_TMSYMBOLDLG_POSITION, const wxSize& size = SYMBOL_TMSYMBOLDLG_SIZE,
205 long style = SYMBOL_TMSYMBOLDLG_STYLE);
206
207 virtual ~tmSymbolDLGLineRule();
208
209 bool Create(wxWindow* parent, wxWindowID id = SYMBOL_TMSYMBOLDLG_IDNAME,
210 const wxString& caption = SYMBOL_TMSYMBOLDLG_TITLE, const wxPoint& pos = SYMBOL_TMSYMBOLDLG_POSITION,
211 const wxSize& size = SYMBOL_TMSYMBOLDLG_SIZE, long style = SYMBOL_TMSYMBOLDLG_STYLE);
212
213 inline tmSymbolRuleArray* GetRulesRef() {
214 return &m_Rules;
215 };
216
217 int GetSelectedPanel();
218
219 inline const wxString GetSelectedField() const;
220
221 inline const tmSymbolDataLineUnique GetLineUniqueStyle() const;
222
223 void SetLineUniqueStyle(tmSymbolDataLineUnique value);
224
225 void SetSelectedField(wxString value);
226
227 void SetSelectedPanel(int panelindex);
228};
229
230inline const wxString tmSymbolDLGLineRule::GetSelectedField() const {
231 return m_SelectedField;
232}
233
234inline const tmSymbolDataLineUnique tmSymbolDLGLineRule::GetLineUniqueStyle() const {
235 return m_LineUniqueStyle;
236}
237
238#endif
Definition datalistreportctrl.h:30
Definition tmgisdatavectorshp.h:36
Storing object of layer type.
Definition tmlayerproperties.h:47
Definition tmsliderwithtxt.h:47
Symbology dialog for lines supporting rules.
Definition tmsymboldlgline.h:133
Definition tmsymboldlgline.h:83
tmSymbolDLGLine()
Constructors.
Definition tmsymboldlgline.cpp:29
Definition tmsymboldlg.h:55
Definition tmsymboldlgline.h:66