Game Develop C++ Platform: ResourcesEditor.h Source File

| Game Develop C++ Platform Platform for developing native games based on OpenGL and SFML with Game Develop

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
ResourcesEditor.h
Go to the documentation of this file.
1
5 #if defined(GD_IDE_ONLY)
6
7 #ifndef RESOURCESEDITOR_H
8 #define RESOURCESEDITOR_H
9
10 //(*Headers(ResourcesEditor)
11 #include <wx/treectrl.h>
12 #include <wx/sizer.h>
13 #include <wx/menu.h>
14 #include <wx/textctrl.h>
15 #include <wx/aui/aui.h>
16 #include <wx/propgrid/manager.h>
17 #include <wx/panel.h>
18 //*)
19 #include <wx/srchctrl.h>
20 #include <wx/aui/aui.h>
21 #include <boost/weak_ptr.hpp>
22 #include "GDCore/IDE/Dialogs/MainFrameWrapper.h"
23 namespace gd { class ResourceLibraryDialog; }
24 namespace gd { class Project; }
25 namespace gd { class Resource; }
26
27 class GD_API ResourcesEditor: public wxPanel
28 {
29 public:
30
31 ResourcesEditor(wxWindow* parent, gd::Project & project, gd::MainFrameWrapper & mainFrameWrapper_, bool useRibbon_ = false );
32 virtual ~ResourcesEditor();
33
34 gd::Project & project;
35
36 void Refresh();
37
41 void AddResources(const std::vector<std::string> & filenames);
42
48 void CopyAndAddResources(std::vector<std::string> filenames, const std::string & destinationDir);
49
53 void TriggerDrop(wxCoord x, wxCoord y);
54
55 //Item sélectionné dans la liste
56 wxTreeItemId m_itemSelected;
57
58 //(*Declarations(ResourcesEditor)
59 wxAuiManager* AuiManager1;
60 wxMenuItem* MenuItem8;
61 wxAuiToolBar* toolbar;
62 wxMenuItem* MenuItem7;
63 wxSearchCtrl* searchCtrl;
64 wxPropertyGridManager* propertyGrid;
65 wxMenu emptyMenu;
66 wxMenuItem* MenuItem5;
67 wxMenuItem* MenuItem2;
68 wxTreeCtrl* resourcesTree;
69 wxMenuItem* MenuItem14;
70 wxMenuItem* MenuItem11;
71 wxMenuItem* MenuItem13;
72 wxMenu ContextMenu;
73 wxMenuItem* MenuItem10;
74 wxMenuItem* MenuItem12;
75 wxPanel* corePanel;
76 wxMenuItem* MenuItem6;
77 wxPanel* previewPanel;
78 wxPanel* propertiesPanel;
79 wxMenuItem* MenuItem9;
80 wxMenu folderMenu;
81 //*)
82
83 //static void CreateRibbonPage(wxRibbonPage * page); //Creation is made inside MainFrame.
84
88 void ForceRefreshRibbonAndConnect();
89
90 static const long idRibbonAdd;
91 static const long idRibbonAddFromLibrary;
92 static const long idRibbonDel;
93 static const long idRibbonAddDossier;
94 static const long idRibbonRemoveDossier;
95 static const long idRibbonUp;
96 static const long idRibbonDown;
97 static const long idRibbonShowPreview;
98 static const long idRibbonShowPropertyGrid;
99 static const long idRibbonExternalProgram;
100 static const long idRibbonHelp;
101 static const long idRibbonRefresh;
102 static const long idRibbonDeleteUnused;
103
104 protected:
105
106 //(*Identifiers(ResourcesEditor)
107 static const long ID_AUITOOLBARITEM1;
108 static const long ID_AUITOOLBARITEM2;
109 static const long ID_AUITOOLBARITEM5;
110 static const long ID_AUITOOLBAR1;
111 static const long ID_TREECTRL1;
112 static const long ID_TEXTCTRL1;
113 static const long ID_PANEL1;
114 static const long ID_PANEL3;
115 static const long ID_PROPGRID;
116 static const long ID_PANEL2;
117 static const long idMenuMod;
118 static const long idMenuAjouter;
119 static const long idMenuDel;
120 static const long ID_MENUITEM9;
121 static const long idMoveUp;
122 static const long idMoveDown;
123 static const long ID_MENUITEM1;
124 static const long ID_MENUITEM2;
125 static const long ID_MENUITEM3;
126 static const long ID_MENUITEM5;
127 static const long ID_MENUITEM6;
128 static const long ID_MENUITEM4;
129 static const long ID_MENUITEM7;
130 static const long ID_MENUITEM8;
131 //*)
132 static const long ID_BITMAPBUTTON1;
133 static const long ID_BITMAPBUTTON5;
134 static const long ID_BITMAPBUTTON3;
135 static const long ID_BITMAPBUTTON6;
136 static const long idMenuResourcesLibrary;
137
138
139 private:
140
141 //(*Handlers(ResourcesEditor)
142 void OnHautImageBtClick(wxCommandEvent& event);
143 void OnDelImageBtClick(wxCommandEvent& event);
144 void OnModNameImageBtClick(wxCommandEvent& event);
145 void OnAddImageBtClick(wxCommandEvent& event);
146 void OnPaint(wxPaintEvent& event);
147 void OnBanqueImageListItemMenu(wxTreeEvent& event);
148 void OnRefreshBtClick(wxCommandEvent& event);
149 void OnBanqueImageListItemActivated(wxTreeEvent& event);
150 void OnBanqueImageListSelectionChanged(wxTreeEvent& event);
151 void OnBanqueImageListDeleteItem(wxTreeEvent& event);
152 void OnBanqueImageListEndLabelEdit(wxTreeEvent& event);
153 void OnBanqueImageListBeginLabelEdit(wxTreeEvent& event);
154 void OnBanqueImageListBeginDrag(wxTreeEvent& event);
155 void OnModFileImage(wxCommandEvent& event);
156 void OnChercherBtClick(wxCommandEvent& event);
157 void OnAideBtClick(wxCommandEvent& event);
158 void DossierBt(wxCommandEvent& event);
159 void OnMenuItem5Selected(wxCommandEvent& event);
160 void OnMenuItem6Selected(wxCommandEvent& event);
161 void OnModPropSelected(wxCommandEvent& event);
162 void OnOpenPaintProgramClick(wxCommandEvent& event);
163 void OnBanqueImageListItemActivated1(wxTreeEvent& event);
164 void OntoolbarPanelResize(wxSizeEvent& event);
165 void OnapercuPanelPaint(wxPaintEvent& event);
166 void OnMoveUpSelected(wxCommandEvent& event);
167 void OnMoveDownSelected(wxCommandEvent& event);
168 void OnSetFocus(wxFocusEvent& event);
169 void OnResize(wxSizeEvent& event);
170 void OnAddFolderSelected(wxCommandEvent& event);
171 void OnRemoveFolderSelected(wxCommandEvent& event);
172 void OnremoveFolderOnlySelected(wxCommandEvent& event);
173 void OnsearchCtrlText(wxCommandEvent& event);
174 void OnresourcesTreeBeginLabelEdit(wxTreeEvent& event);
175 void OnresourcesTreeEndLabelEdit(wxTreeEvent& event);
176 void OnresourcesTreeItemActivated(wxTreeEvent& event);
177 void OnresourcesTreeSelectionChanged(wxTreeEvent& event);
178 void OnresourcesTreeItemMenu(wxTreeEvent& event);
179 void OnapercuPanelResize(wxSizeEvent& event);
180 void OnresourcesTreeBeginDrag(wxTreeEvent& event);
181 void OnpreviewPanelPaint(wxPaintEvent& event);
182 void OnpreviewPanelResize(wxSizeEvent& event);
183 void OnresourcesTreeKeyDown(wxTreeEvent& event);
184 void OnresourcesTreeEndDrag(wxTreeEvent& event);
185 void OnAddFromLibraryToolbarBtClick(wxCommandEvent& event);
186 //*)
187 void OnMoreOptions( wxCommandEvent& event );
188 void OnAddFromLibraryBtClick(wxCommandEvent& event);
189 void OnDeleteUnusedFiles( wxCommandEvent& event );
190 void OnShowPreviewBtClick( wxCommandEvent& event );
191 void OnShowPropertyGridBtClick( wxCommandEvent& event );
192 void ConnectEvents();
193 void OnPropertyChanged(wxPropertyGridEvent& event);
194 void OnPropertyChanging(wxPropertyGridEvent& event);
195
196
197 void UpdatePropertyGrid();
198 void RemoveImageFromTree(wxTreeItemId parent, std::string imageName);
199 void RenameInTree(wxTreeItemId parent, std::string oldName, std::string newName, std::string type);
200 wxTreeItemId GetSelectedFolderItem();
201 void ShiftUpElementOfTree();
202 void ShiftDownElementOfTree();
203
204 wxTreeItemId allImagesItem;
205
206 gd::MainFrameWrapper mainFrameWrapper;
207 bool useRibbon;
208 bool editorJustConstructed;
209
210 std::string selectedResource;
211 std::string renamedItemOldName;
212
213 gd::ResourceLibraryDialog * resourceLibraryDialog;
214
215 DECLARE_EVENT_TABLE()
216 };
217
218 #endif
219 #endif
220