Game Develop Core: EditStrExpressionDialog.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
EditStrExpressionDialog.h
Go to the documentation of this file.
1
5 #if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
6 #ifndef EDITTEXTE_H
7 #define EDITTEXTE_H
8
9 //(*Headers(EditStrExpressionDialog)
10 #include <wx/treectrl.h>
11 #include <wx/sizer.h>
12 #include <wx/aui/aui.h>
13 #include <wx/panel.h>
14 #include <wx/hyperlink.h>
15 #include <wx/statbmp.h>
16 #include <wx/button.h>
17 #include <wx/dialog.h>
18 #include <wx/stc/stc.h>
19 //*)
20 #include <string>
21 #include <vector>
22 #include "GDCore/Events/ExpressionMetadata.h"
23 namespace gd { class Project; }
24 namespace gd { class Layout; }
25 namespace gd { class ParameterMetadata; }
26
27 namespace gd
28 {
29
35 class GD_CORE_API EditStrExpressionDialog: public wxDialog
36 {
37 public:
38
46 EditStrExpressionDialog(wxWindow* parent, std::string expression, gd::Project & project_, gd::Layout & layout_);
47 virtual ~EditStrExpressionDialog();
48
52 const std::string & GetExpression() const {return returnedExpression;}
53
54 //(*Declarations(EditStrExpressionDialog)
55 wxPanel* objectsFunctionsPanel;
56 wxButton* OkBt;
57 wxStaticBitmap* StaticBitmap2;
58 wxAuiManager* mgr;
59 wxButton* AddFunctionBt;
60 wxPanel* centerPanel;
61 wxTreeCtrl* ValList;
62 wxHyperlinkCtrl* errorTxt;
63 wxStyledTextCtrl* TexteEdit;
64 wxHyperlinkCtrl* HyperlinkCtrl1;
65 wxPanel* freeFunctionsPanel;
66 wxTreeCtrl* ObjList;
67 wxButton* AddPropBt;
68 //*)
69
70 protected:
71
72 //(*Identifiers(EditStrExpressionDialog)
73 static const long ID_CUSTOM1;
74 static const long ID_BUTTON2;
75 static const long ID_HYPERLINKCTRL1;
76 static const long ID_STATICBITMAP5;
77 static const long ID_HYPERLINKCTRL2;
78 static const long ID_PANEL1;
79 static const long ID_TREECTRL1;
80 static const long ID_BUTTON10;
81 static const long ID_PANEL2;
82 static const long ID_TREECTRL2;
83 static const long ID_BUTTON7;
84 static const long ID_PANEL3;
85 //*)
86
87 private:
88
89 //(*Handlers(EditStrExpressionDialog)
90 void OnAnnulerBtClick(wxCommandEvent& event);
91 void OnOkBtClick(wxCommandEvent& event);
92 void OnInsertBtClick(wxCommandEvent& event);
93 void OnExpressionTxtEditClick(wxCommandEvent& event);
94 void OnVarGlobalTxtEditClick(wxCommandEvent& event);
95 void OnVarSceneTxtEditClick(wxCommandEvent& event);
96 void OnTexteEditText(wxCommandEvent& event);
97 void OnAddPropBtClick(wxCommandEvent& event);
98 void OnAddFunctionBtClick(wxCommandEvent& event);
99 void OnTreeCtrl1ItemActivated(wxTreeEvent& event);
100 void OnObjListItemActivated(wxTreeEvent& event);
101 void OnObjListSelectionChanged(wxTreeEvent& event);
102 void OnTreeCtrl1SelectionChanged(wxTreeEvent& event);
103 void OnerrorTxtClick(wxCommandEvent& event);
104 void OnhelpBtClick(wxCommandEvent& event);
105 //*)
106 void TextModified(wxStyledTextEvent& event);
107 void UpdateTextCtrl(wxStyledTextEvent& event);
108
109 std::string ShowParameterDialog(const gd::ParameterMetadata & ParameterMetadata, bool & userCancelled, std::string object = "");
110
111 std::string returnedExpression;
112
113 //Items selected
114 wxTreeItemId itemObj;
115 wxTreeItemId itemVal;
116
117 wxImageList * imageListObj;
118 wxImageList * imageListVal;
119
120 //Utile pour selectionner un objet
121 //( quand on souhaite accéder aux propriétés d'un objet )
122 gd::Project & project;
123 gd::Layout & layout;
124
125 size_t lastErrorPos;
126
127 DECLARE_EVENT_TABLE()
128 };
129
135 class GD_CORE_API TreeItemStrExpressionInfoData : public wxTreeItemData
136 {
137 public:
138 TreeItemStrExpressionInfoData(const std::string & name_, const gd::StrExpressionMetadata & info_) : name(name_), info(info_) { };
139 virtual ~TreeItemStrExpressionInfoData() {};
140
141 const std::string & GetName() const { return name; }
142 const gd::StrExpressionMetadata & GetStrExpressionMetadata() const { return info; }
143
144 private:
145 std::string name;
146 gd::StrExpressionMetadata info;
147 };
148
149 }
150 #endif
151 #endif