ToolMap
Loading...
Searching...
No Matches
tocctrl.h
1#ifndef FEATURE_TOC_TOCCTRL_H
2#define FEATURE_TOC_TOCCTRL_H
3
4#include "wx/wxprec.h"
5
6#ifndef WX_PRECOMP
7
8#include "wx/wx.h"
9
10#endif
11
12#include <wx/dataview.h>
13#include <wx/textfile.h>
14
15#include "tocctrlmodel.h"
16#include "tmlayerproperties.h"
17
18// EVENT FOR TOC CTRL
19DECLARE_EVENT_TYPE(tmEVT_LM_REMOVE, -1)
20DECLARE_EVENT_TYPE(tmEVT_LM_ADD, -1)
21DECLARE_EVENT_TYPE(tmEVT_LM_GROUP_ADD, -1)
22DECLARE_EVENT_TYPE(tmEVT_LM_UPDATE, -1)
23DECLARE_EVENT_TYPE(tmEVT_LM_SHOW_PROPERTIES, -1)
24DECLARE_EVENT_TYPE(tmEVT_LM_SHOW_LABELS, -1);
25DECLARE_EVENT_TYPE(tmEVT_LM_TOC_EDITED, -1)
26DECLARE_EVENT_TYPE(tmEVT_EM_EDIT_START, -1)
27DECLARE_EVENT_TYPE(tmEVT_EM_EDIT_STOP, -1)
28DECLARE_EVENT_TYPE(tmEVT_TOC_SELECTION_CHANGED, -1)
29
30class TocCtrl : public wxDataViewCtrl {
31 public:
32 TocCtrl(wxWindow* parent, wxWindowID id);
33
34 // void add_test_data();
35
36 void ExpandAll();
37
38 TocCtrlModel* GetTocModel();
39
40 // toc ctrl function for toolmap
41 tmLayerProperties* GetSelectionLayer();
42 void SelectLayerByID(int layerID);
43 tmLayerProperties* GetLayerByPath(const wxString& layerPath);
44 tmLayerProperties* GetLayerByName(
45 const wxString& layerName); // TODO: Is this function really needed, duplicate of GetLayerByPath
46 tmLayerProperties* GetLayerById(long layer_id);
47 tmLayerProperties* IterateLayers(bool ResetToLast);
48 tmLayerProperties* GetEditLayer();
49 void SetEditLayer(tmLayerProperties* mEditingLayer);
50 void SetProjectName(const wxString& project_name);
51 bool InsertLayer(tmLayerProperties* item);
52 unsigned int GetCountLayers();
53 bool UpdateLayerName(tmLayerProperties* item, const wxString& newName);
54 bool RemoveLayer(int database_layer_id);
55 bool IsAllParentLayerVisible(long layer_id);
56
57 private:
58 // dnd actions
59 void OnDragndropBegin(wxDataViewEvent& event);
60 void OnDragndropPossible(wxDataViewEvent& event);
61 void OnDragndropDrop(wxDataViewEvent& event);
62
63 // control actions
64 void OnMouseClick(wxDataViewEvent& event);
65 void OnMouseRightClick(wxDataViewEvent& event);
66 void OnLayerSelectionChanged(wxDataViewEvent& event);
67
68 // contextual menu actions
69 void OnMenuRemoveItem(wxCommandEvent& event);
70 void OnMenuAddGroup(wxCommandEvent& event);
71 void OnMenuRenameGroup(wxCommandEvent& event);
72 void OnMenuShowProperties(wxCommandEvent& event);
73 void OnMenuPropertiesSave(wxCommandEvent& event);
74 void OnMenuPropertiesLoad(wxCommandEvent& event);
75 void OnMenuVertex(wxCommandEvent& event);
76 void OnMenuShowLabels(wxCommandEvent& event);
77 void OnMenuEditing(wxCommandEvent& event);
78
79 int m_IterateNodeIndex = wxNOT_FOUND;
80 TocCtrlModelNodePtrArray m_IterateNodeArray;
81 tmLayerProperties* m_EditingLayer;
82 TocCtrlModelNode* GetNodeFromLayerID(long layer_id);
83 void StopEditing(bool send_message);
84};
85
86#endif // FEATURE_TOC_TOCCTRL_H
Node for TocCtrlModel.
Definition tocctrlmodel.h:20
Model for TocCtrl.
Definition tocctrlmodel.h:53
Definition tocctrl.h:30
Storing object of layer type.
Definition tmlayerproperties.h:47