Game Develop Core: ChooseVariableDialog.h Source File

| Game Develop Core Core library for developing platforms and tools compatible with Game Develop.

- Main Page
- Modules
- Classes

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Macros Groups Pages
ChooseVariableDialog.h
Go to the documentation of this file.
1
6 #if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
7 #ifndef GDCORE_CHOOSEVARIABLEDIALOG_H
8 #define GDCORE_CHOOSEVARIABLEDIALOG_H
9
10 //(*Headers(ChooseVariableDialog)
11 #include <wx/sizer.h>
12 #include <wx/menu.h>
13 #include <wx/treelist.h>
14 #include <wx/aui/aui.h>
15 #include <wx/statline.h>
16 #include <wx/panel.h>
17 #include <wx/hyperlink.h>
18 #include <wx/statbmp.h>
19 #include <wx/button.h>
20 #include <wx/dialog.h>
21 //*)
22 namespace gd { class VariablesContainer; }
23 namespace gd { class Project; }
24 namespace gd { class Layout; }
25 namespace gd { class Variable; }
26 #include <wx/toolbar.h>
27 #include <boost/shared_ptr.hpp>
28 #include <string>
29
30 namespace gd
31 {
32
41 class GD_CORE_API ChooseVariableDialog: public wxDialog
42 {
43 public:
44
52 ChooseVariableDialog(wxWindow* parent, gd::VariablesContainer & variablesContainer, bool editingOnly=false);
53
58 void SetAssociatedProject(const gd::Project * project);
59
65 void SetAssociatedLayout(const gd::Project * project, const gd::Layout * layout);
66
70 std::string GetSelectedVariable() const { return selectedVariableFullName; };
71
75 virtual ~ChooseVariableDialog();
76
77 //(*Declarations(ChooseVariableDialog)
78 wxAuiManager* AuiManager1;
79 wxStaticBitmap* StaticBitmap2;
80 wxPanel* toolbarPanel;
81 wxAuiToolBar* toolbar;
82 wxMenuItem* MenuItem2;
83 wxMenuItem* MenuItem1;
84 wxMenuItem* MenuItem4;
85 wxHyperlinkCtrl* HyperlinkCtrl1;
86 wxButton* cancelBt;
87 wxTreeListCtrl* variablesList;
88 wxStaticLine* StaticLine2;
89 wxMenuItem* MenuItem3;
90 wxMenu contextMenu;
91 wxButton* okBt;
92 //*)
93
94 protected:
95
96 //(*Identifiers(ChooseVariableDialog)
97 static const long ID_AUITOOLBAR1;
98 static const long ID_PANEL1;
99 static const long ID_TREELISTCTRL1;
100 static const long ID_STATICLINE2;
101 static const long ID_STATICBITMAP2;
102 static const long ID_HYPERLINKCTRL1;
103 static const long ID_BUTTON1;
104 static const long ID_BUTTON3;
105 static const long ID_MENUITEM1;
106 static const long ID_MENUITEM2;
107 static const long ID_MENUITEM3;
108 static const long ID_MENUITEM4;
109 //*)
110 static const long idAddVar;
111 static const long idEditVar;
112 static const long idDelVar;
113 static const long idMoveUpVar;
114 static const long idRenameVar;
115 static const long idMoveDownVar;
116 static const long ID_Help;
117 static const long idFindUndeclared;
118
119 private:
120
121 //(*Handlers(ChooseVariableDialog)
122 void OnokBtClick(wxCommandEvent& event);
123 void OncancelBtClick(wxCommandEvent& event);
124 void OnhelpBtClick(wxCommandEvent& event);
125 void OntoolbarPanelResize(wxSizeEvent& event);
126 void OnResize(wxSizeEvent& event);
127 void OnvariablesListKeyDown1(wxKeyEvent& event);
128 void OnEditValueSelected(wxCommandEvent& event);
129 void OnRenameSelected(wxCommandEvent& event);
130 void OnAddChildSelected(wxCommandEvent& event);
131 void OnRemoveSelected(wxCommandEvent& event);
132 //*)
133 void OnItemActivated(wxTreeListEvent& event);
134 void OnRightClick(wxTreeListEvent& event);
135 void OnItemSelectionChanged(wxTreeListEvent& event);
136 void OnAddVarSelected(wxCommandEvent& event);
137 void OnDelVarSelected(wxCommandEvent& event);
138 void OnMoveUpVarSelected(wxCommandEvent& event);
139 void OnMoveDownVarSelected(wxCommandEvent& event);
140 void OnFindUndeclaredSelected(wxCommandEvent& event);
141 void RefreshAll();
142 void UpdateSelectedAndParentVariable();
143 void RefreshVariable(wxTreeListItem item, const std::string & name, const gd::Variable & variable);
144 wxTreeListItem GetPreviousSibling(wxTreeListCtrl * ctrl, wxTreeListItem item);
145
146 gd::VariablesContainer & variablesContainer;
147 boost::shared_ptr<gd::VariablesContainer> temporaryContainer;
148 bool editingOnly;
149 const gd::Project * associatedProject;
150 const gd::Layout * associatedLayout;
151
152 std::string selectedVariableName;
153 std::string selectedVariableFullName;
154 gd::Variable * selectedVariable;
155 gd::Variable * parentVariable;
156
157 std::string oldName;
158 unsigned int modificationCount;
159
160 DECLARE_EVENT_TABLE()
161 };
162
163 }
164
165 #endif
166 #endif