ToolMap
Loading...
Searching...
No Matches
attribution_obj_type.h
1/***************************************************************************
2 attribution_obj_type.h
3 Display wxAui panel for attribution
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#ifndef ATTRIBUTION_OBJ_TYPE_H
18#define ATTRIBUTION_OBJ_TYPE_H
19
20// For compilers that support precompilation, includes "wx/wx.h".
21#include <wx/wxprec.h>
22
23// Include wxWidgets' headers
24#ifndef WX_PRECOMP
25#include <wx/wx.h>
26#endif
27
28#include <wx/choicebk.h> // for choicebook
29#include <wx/datectrl.h>
30#include <wx/dateevt.h>
31#include <wx/notebook.h>
32#include <wx/srchctrl.h>
33
34#include "../core/projectdefmemory.h" // for item type (LINE, POINT, ...)
35#include "managed_aui_wnd.h"
36#include "tmchecklistboxrank.h" // for advanced checklistbox
37
38class DataBaseTM;
39
40class wxFlatButton;
41
42// EVENT DECLARATION FOR COMMUNICATION WITH tmAttributionManager
43// DECLARE_EVENT_TYPE(tmEVT_ATTRIBUTION_BTN_PRESSED, -1)
44DECLARE_EVENT_TYPE(tmEVT_INFO_BTN_PRESSED, -1)
45DECLARE_EVENT_TYPE(tmEVT_ADD_BTN_PRESSED, -1)
46DECLARE_EVENT_TYPE(tmEVT_REMOVE_BTN_PRESSED, -1)
47
48#define ID_DLG_OBJ_ATTRIBUTION 10039
49#define ID_PANEL8 10058
50#define ID_CHECKLISTBOX1 10059
51#define ID_PANEL23 10139
52#define ID_CHOICE13 10203
53#define ID_TEXTCTRL19 10204
54#define ID_CHOICE14 10205
55#define ID_DATEPICKERCTRL 10214
56#define ID_TEXTCTRL21 10206
57#define ID_CHECKBOX7 10209
58#define ID_SEARCHCTRL1 10053
59#define ID_CHECKBOX9 10054
60#define ID_DLG_OBJ_ATTRIBUTION_BTN_INFO 10055
61#define ID_DLG_OBJ_ATTRIBUTION_BTN_ATTRIBUTE 10056
62#define ID_CHECKBOX5 10136
63#define SYMBOL_ATTRIBOBJTYPE_PANEL_STYLE wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCLOSE_BOX
64#define SYMBOL_ATTRIBOBJTYPE_PANEL_TITLE _("Object Kind")
65#define SYMBOL_ATTRIBOBJTYPE_PANEL_IDNAME ID_DLG_OBJ_ATTRIBUTION
66#define SYMBOL_ATTRIBOBJTYPE_PANEL_SIZE wxSize(230, 150)
67#define SYMBOL_ATTRIBOBJTYPE_PANEL_POSITION wxDefaultPosition
68const int ID_DLG_OBJ_ATTRIBUTION_BTN_ADD = wxWindow::NewControlId();
69const int ID_DLG_OBJ_ATTRIBUTION_BTN_REMOVE = wxWindow::NewControlId();
70
72 wxSizer* CreateControls(wxWindow* parent, bool call_fit = TRUE, bool set_sizer = TRUE);
73
74 wxAuiPaneInfo mPaneInfo;
75
76 bool UpdateObjectList(DataBaseTM* pDB, tmCheckListBox* pList, int type, short frequency);
77
78 wxWindow* m_ParentEvt;
79 int m_NbFeaturesSelected;
80
81 wxFlatButton* m_AttribBtn;
82 wxFlatButton* m_AddBtnCtrl;
83 wxFlatButton* m_InfoBtn;
84 wxChoicebook* m_AttribNotebook;
85 wxStaticText* m_WarningMultiFeatureCtrl;
86 bool m_AutoDisplayAttributes;
87 bool m_EmptyListAfterAttributes;
88 bool m_EnableFullAttribution;
89 wxBoxSizer* m_ButtonSizer;
90 wxBoxSizer* m_AttribSizer;
91 wxSearchCtrl* m_textCtrlLines;
92 wxSearchCtrl* m_textCtrlPoints;
93 wxSearchCtrl* m_textCtrlPoly;
94
95 // event function
96 // void OnAttributeBtn (wxCommandEvent & event);
97 void OnAddBtn(wxCommandEvent& event);
98
99 void OnRemoveBtn(wxCommandEvent& event);
100
101 void OnInfoBtn(wxCommandEvent& event);
102
103 void OnEditStart(wxCommandEvent& event);
104
105 void OnEditStop(wxCommandEvent& event);
106
107 void SetFocusTextCtrl(wxFocusEvent& event);
108
109 void KillFocusTextCtrl(wxFocusEvent& event);
110
111 void FilterPointList(wxCommandEvent& event);
112
113 void FilterPolyList(wxCommandEvent& event);
114
115 void FilterLineList(wxCommandEvent& event);
116
117 DECLARE_EVENT_TABLE()
118
119 public:
120 AttribObjType_PANEL(wxWindow* parent, wxAuiManager* AuiManager);
121
123
125
127
129
130 // init list with databasae
131 void SetDataBaseToList(DataBaseTM* pDB);
132
133 // update btn
134 void SetAttributeBtn(int nbfeatures, bool editmode);
135
136 void SetInfoBtn(int nbfeatures);
137
138 // select correct panel
139 void SetVisibleNotebook(TOC_GENERIC_NAME notebooktype);
140
141 TOC_GENERIC_NAME GetVisibleNotebook();
142
143 // get selected values
144 int GetSelectedValues(TOC_GENERIC_NAME panel_name, wxArrayLong& values, bool panel_freq = false);
145
146 void SetSelectedValues(TOC_GENERIC_NAME panel_name, const wxArrayLong& values, bool panel_freq = false);
147
149
150 bool IsEmptyListValuesRequired() {
151 return m_EmptyListAfterAttributes;
152 }
153
154 bool IsFullAttributionEnabled() {
155 return m_EnableFullAttribution;
156 }
157
158 void EmptyListValues();
159
160 void ResetFilterFields();
161
162 // menu event function
163 void OnDisplayAttributesAuto(wxCommandEvent& event);
164
165 void OnEmptyListAffterAttributes(wxCommandEvent& event);
166
167 void OnFullAttribution(wxCommandEvent& event);
168
169 // controls
170 tmCheckListBoxRank* m_pObjList_PT_Freq;
171 tmCheckListBoxRank* m_pObjList_PT_NoFreq;
172 tmCheckListBoxRank* m_pObjList_PLG_Freq;
173 tmCheckListBoxRank* m_pObjList_PLG_NoFreq;
174 tmCheckListBoxRank* m_pObjList_L_Freq;
175 tmCheckListBoxRank* m_pObjList_L_NoFreq;
176};
177
178#endif
Definition attribution_obj_type.h:71
void SetVisibleNotebook(TOC_GENERIC_NAME notebooktype)
Set visible notebook.
Definition attribution_obj_type.cpp:604
bool UpdateObjectLineList(DataBaseTM *pDB)
Update items in the object line list.
Definition attribution_obj_type.cpp:468
void OnDisplayAttributesAuto(wxCommandEvent &event)
Called when Auto Display Attributes is enabled.
Definition attribution_obj_type.cpp:330
void SetDataBaseToList(DataBaseTM *pDB)
Pass database to check box list.
Definition attribution_obj_type.cpp:532
TOC_GENERIC_NAME GetVisibleNotebook()
Get visible notebook page.
Definition attribution_obj_type.cpp:639
bool UpdateObjectPointList(DataBaseTM *pDB)
Update items in the object point list.
Definition attribution_obj_type.cpp:427
bool IsAutoDisplayAttributeChecked()
Get Status of Auto display attributes checkbox.
Definition attribution_obj_type.cpp:827
void SetInfoBtn(int nbfeatures)
Enable or disable the Info button.
Definition attribution_obj_type.cpp:583
void SetSelectedValues(TOC_GENERIC_NAME panel_name, const wxArrayLong &values, bool panel_freq=false)
Set checked values to the lists.
Definition attribution_obj_type.cpp:770
bool UpdateObjectPolyList(DataBaseTM *pDB)
Update items in the object polygon list.
Definition attribution_obj_type.cpp:448
int GetSelectedValues(TOC_GENERIC_NAME panel_name, wxArrayLong &values, bool panel_freq=false)
Get checked values from lists.
Definition attribution_obj_type.cpp:713
void SetAttributeBtn(int nbfeatures, bool editmode)
Set the text for the button.
Definition attribution_obj_type.cpp:556
void EmptyListValues()
Clear all attributes set when called.
Definition attribution_obj_type.cpp:408
void OnEmptyListAffterAttributes(wxCommandEvent &event)
Switch status of cleaning attribution each time called.
Definition attribution_obj_type.cpp:342
Definition database_tm.h:80
Definition managed_aui_wnd.h:32
Enhance the tmCheckListBox class.
Definition tmchecklistboxrank.h:45
Deals with checkbox list.
Definition tmchecklistbox.h:56
Definition wxflatbutton.h:61