ToolMap
Loading...
Searching...
No Matches
shortcut_panel.h
1/***************************************************************************
2 shortcut_panel.h
3 Display the Shortcut panel
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 _TM_SHORTCUT_PANEL_H
18#define _TM_SHORTCUT_PANEL_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 "listgenreport.h"
29#include "managed_aui_wnd.h"
30#include "shortcut_panel_dlg.h" // dialog for adding shortcuts
31#include "wxflatbutton.h"
32
33class DataBaseTM;
34
35#define IDDLG_SHORT_TARGET 21000
36#define IDDLG_SHORT_LIST 21001
37#define IDDLG_SHORT_ADD_BTN 21002
38#define IDDLG_SHORT_DEL_BTN 21003
39// #define IDDLG_SHORT_EDIT_BTN 21004
40#define SHORTCUT_PANEL_TITLE _("Shortcut")
41#define SHORTCUT_PANEL_SIZE wxSize(230, 150)
42
44 private:
45 DataBaseTM* m_pDB;
46 int m_LayerType;
47 int m_OldKey;
48 wxWindow* m_ParentEvt;
49
50 virtual void BeforeAdding();
51
52 virtual void AfterAdding(bool bRealyAddItem);
53
54 virtual void BeforeDeleting();
55
56 virtual void BeforeEditing();
57
58 virtual void AfterEditing(bool bRealyEdited);
59
60 protected:
61 public:
62 ShortcutList(wxWindow* parent, wxWindow* parent_evt, wxWindowID id, wxArrayString* pColsName,
63 wxArrayInt* pColsSize = nullptr, wxSize size = wxDefaultSize);
64
66
67 // setter
68 void SetDataBase(DataBaseTM* database) {
69 m_pDB = database;
70 }
71
72 void SetLayerType(int iLayertype) {
73 m_LayerType = iLayertype;
74 }
75
76 // key function
77 int GetShortcutInt(const wxString& myShortCut);
78
79 wxString GetKeyFromInt(int key) {
80 return wxString::Format(_T("F%d"), key);
81 }
82
83 // send order to attribution manager
84 void RefreshShortcuts();
85};
86
88 private:
89 // Control Member
90 wxChoice* m_TargetChoice;
91 ShortcutList* m_ListShortcuts;
92
93 // other member
94 wxWindow* m_ParentEvt;
95 wxAuiPaneInfo m_PaneInfo;
96 DataBaseTM* m_pDB;
97 bool m_ProjectOpen;
98
99 // event function for panel
100 void OnChangeTarget(wxCommandEvent& event);
101
102 void OnShortcutAdd(wxCommandEvent& event);
103
104 void OnShortcutDel(wxCommandEvent& event);
105 // void OnShortcutEdit( wxCommandEvent& event ){ event.Skip(); }
106
108 wxSizer* CreateControls(wxWindow* parent, bool call_fit = true, bool set_sizer = true);
109
110 void InitMemberValues();
111
112 DECLARE_EVENT_TABLE()
113
114 public:
115 Shortcuts_PANEL(wxWindow* parent, wxWindowID id, wxAuiManager* auimanager);
116
118
119 int LoadShortcutList(bool bStoreShortcutinmemory = false);
120
121 // setter
122 void SetProjectOpen(bool bStatus = true) {
123 m_ProjectOpen = bStatus;
124 }
125
126 void SetDataBase(DataBaseTM* database);
127};
128
129#endif
Definition database_tm.h:80
Definition listgenreport.h:319
Definition managed_aui_wnd.h:32
Definition shortcut_panel.h:43
void RefreshShortcuts()
Send order to refresh shortcuts.
Definition shortcut_panel.cpp:375
~ShortcutList()
Destructor.
Definition shortcut_panel.cpp:250
int GetShortcutInt(const wxString &myShortCut)
Convert shortcut key displayed as string into integer.
Definition shortcut_panel.cpp:260
Definition shortcut_panel.h:87
int LoadShortcutList(bool bStoreShortcutinmemory=false)
Load Shortcut into the Shortcut list.
Definition shortcut_panel.cpp:155
void SetDataBase(DataBaseTM *database)
Setter for the Database.
Definition shortcut_panel.cpp:80