ToolMap
Loading...
Searching...
No Matches
snapping_panel.h
1/***************************************************************************
2 snapping_panel.h
3 Deals with the snapping panel, used for setting the
4 snapping for layers
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 _SNAPPING_PANEL_H_
19#define _SNAPPING_PANEL_H_
20
21#include <wx/wxprec.h>
22
23#ifndef WX_PRECOMP
24#include <wx/wx.h>
25#endif
26
27#include <wx/spinctrl.h>
28
29#include "../core/tmsnappingmemory.h" // store snapping status into memory
30#include "listgenreport.h" // listgenreport support
31#include "managed_aui_wnd.h"
32#include "wxflatbutton.h" // for flat button
33
34class DataBaseTM;
35
37
38#define ID_SNAP_TOLERENCE_TXT 22000
39#define ID_SNAP_LIST 22001
40#define ID_SNAP_ADD 22002
41#define ID_SNAP_REMOVE 22003
42#define ID_SNAP_CLEAR 22004
43#define SNAPPING_PANEL_TITLE _("Snapping")
44#define SNAPPING_PANEL_SIZE wxSize(230, 150)
45
46class tmRenderer;
47
48class tmSnapping_DLG : public wxDialog {
49 public:
50 tmSnapping_DLG(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString,
51 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
52 long style = wxDEFAULT_DIALOG_STYLE);
53
55
56 virtual bool TransferDataToWindow();
57
58 virtual bool TransferDataFromWindow();
59
60 int m_SnapStatus;
61 wxString m_LayerName;
62
63 private:
64 wxStaticText* m_LayerNameCtrl;
65 wxRadioButton* m_SnapNoneCtrl;
66 wxRadioButton* m_SnapBeginEndCtrl;
67 wxRadioButton* m_SnapAllCtrl;
68};
69
70/***************************************************************************/
76 private:
77 wxSpinCtrl* m_TolerenceCtrl;
78 DataListReportCtrl* m_ListCtrl;
79 DataBaseTM* m_pDB;
80 tmRenderer* m_Renderer;
81 wxWindow* m_ParentEvt;
82 wxAuiPaneInfo m_PaneInfo;
83 tmSnappingMemory m_SnappingMemory;
84
85 wxPanel* _CreateControls();
86
87 void OnUpdateTolerence(wxSpinEvent& event);
88
89 void OnContextualMenu(wxContextMenuEvent& event);
90
91 void OnDClickList(wxListEvent& event);
92
93 DECLARE_EVENT_TABLE()
94
95 public:
96 Snapping_PANEL(wxWindow* parent, wxWindowID id, wxAuiManager* auimanager);
97
99
100 void SetDataBase(DataBaseTM* database) {
101 m_pDB = database;
102 }
103
104 void SetRendererRef(tmRenderer* renderer) {
105 m_Renderer = renderer;
106 }
107
108 void LoadSnappingStatus();
109
110 bool SaveSnappingStatus();
111
112 void OnAddSnapping(wxCommandEvent& event);
113
114 void OnRemoveSnapping(wxCommandEvent& event);
115
116 void OnUpdateUIContextualMenuAdd(wxUpdateUIEvent& event);
117
118 void OnUpdateUIContextualMenuRemove(wxUpdateUIEvent& event);
119
120 tmSnappingMemory* GetSnappingMemoryRef() {
121 return &m_SnappingMemory;
122 }
123};
124
125#endif
Definition database_tm.h:80
Definition datalistreportctrl.h:30
Definition managed_aui_wnd.h:32
The panel used for setting the snapping.
Definition snapping_panel.h:75
bool SaveSnappingStatus()
Save snapping status to the database.
Definition snapping_panel.cpp:251
void OnAddSnapping(wxCommandEvent &event)
Called when user press add snapping.
Definition snapping_panel.cpp:268
void OnRemoveSnapping(wxCommandEvent &event)
Called when user press remove snapping.
Definition snapping_panel.cpp:320
void LoadSnappingStatus()
Load the snapping from database.
Definition snapping_panel.cpp:206
Definition tmrenderer.h:99
Store snapping status into memory.
Definition tmsnappingmemory.h:59
Definition snapping_panel.h:48