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
- Modules
- 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) && !defined(GD_NO_WX_GUI)
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
42 std::vector<std::string> AddResources(const std::vector<std::string> & filenames);
43
50 std::vector<std::string> CopyAndAddResources(std::vector<std::string> filenames, const std::string & destinationDir);
51
55 void TriggerDrop(wxCoord x, wxCoord y);
56
57 //Item sélectionné dans la liste
58 wxTreeItemId m_itemSelected;
59
60 //(*Declarations(ResourcesEditor)
61 wxAuiManager* AuiManager1;
62 wxMenuItem* MenuItem8;
63 wxAuiToolBar* toolbar;
64 wxMenuItem* MenuItem7;
65 wxSearchCtrl* searchCtrl;
66 wxPropertyGridManager* propertyGrid;
67 wxMenu emptyMenu;
68 wxMenuItem* MenuItem5;
69 wxMenuItem* MenuItem2;
70 wxTreeCtrl* resourcesTree;
71 wxMenuItem* MenuItem14;
72 wxMenuItem* MenuItem11;
73 wxMenuItem* MenuItem13;
74 wxMenu ContextMenu;
75 wxMenuItem* MenuItem10;
76 wxMenuItem* MenuItem12;
77 wxPanel* corePanel;
78 wxMenuItem* MenuItem6;
79 wxPanel* previewPanel;
80 wxPanel* propertiesPanel;
81 wxMenuItem* MenuItem9;
82 wxMenu folderMenu;
83 //*)
84
85 //static void CreateRibbonPage(wxRibbonPage * page); //Creation is made inside MainFrame.
86
90 void ForceRefreshRibbonAndConnect();
91
92 static const long idRibbonAdd;
93 static const long idRibbonAddFromLibrary;
94 static const long idRibbonDel;
95 static const long idRibbonAddDossier;
96 static const long idRibbonRemoveDossier;
97 static const long idRibbonUp;
98 static const long idRibbonDown;
99 static const long idRibbonShowPreview;
100 static const long idRibbonShowPropertyGrid;
101 static const long idRibbonExternalProgram;
102 static const long idRibbonHelp;
103 static const long idRibbonRefresh;
104 static const long idRibbonDeleteUnused;
105
106 protected:
107
108 //(*Identifiers(ResourcesEditor)
109 static const long ID_AUITOOLBARITEM1;
110 static const long ID_AUITOOLBARITEM2;
111 static const long ID_AUITOOLBARITEM5;
112 static const long ID_AUITOOLBAR1;
113 static const long ID_TREECTRL1;
114 static const long ID_TEXTCTRL1;
115 static const long ID_PANEL1;
116 static const long ID_PANEL3;
117 static const long ID_PROPGRID;
118 static const long ID_PANEL2;
119 static const long idMenuMod;
120 static const long idMenuAjouter;
121 static const long idMenuDel;
122 static const long ID_MENUITEM9;
123 static const long idMoveUp;
124 static const long idMoveDown;
125 static const long ID_MENUITEM1;
126 static const long ID_MENUITEM2;
127 static const long ID_MENUITEM3;
128 static const long ID_MENUITEM5;
129 static const long ID_MENUITEM6;
130 static const long ID_MENUITEM4;
131 static const long ID_MENUITEM7;
132 static const long ID_MENUITEM8;
133 //*)
134 static const long ID_BITMAPBUTTON1;
135 static const long ID_BITMAPBUTTON5;
136 static const long ID_BITMAPBUTTON3;
137 static const long ID_BITMAPBUTTON6;
138 static const long idMenuResourcesLibrary;
139
140
141 private:
142
143 //(*Handlers(ResourcesEditor)
144 void OnHautImageBtClick(wxCommandEvent& event);
145 void OnDelImageBtClick(wxCommandEvent& event);
146 void OnModNameImageBtClick(wxCommandEvent& event);
147 void OnAddImageBtClick(wxCommandEvent& event);
148 void OnPaint(wxPaintEvent& event);
149 void OnBanqueImageListItemMenu(wxTreeEvent& event);
150 void OnRefreshBtClick(wxCommandEvent& event);
151 void OnBanqueImageListItemActivated(wxTreeEvent& event);
152 void OnBanqueImageListSelectionChanged(wxTreeEvent& event);
153 void OnBanqueImageListDeleteItem(wxTreeEvent& event);
154 void OnBanqueImageListEndLabelEdit(wxTreeEvent& event);
155 void OnBanqueImageListBeginLabelEdit(wxTreeEvent& event);
156 void OnBanqueImageListBeginDrag(wxTreeEvent& event);
157 void OnModFileImage(wxCommandEvent& event);
158 void OnChercherBtClick(wxCommandEvent& event);
159 void OnAideBtClick(wxCommandEvent& event);
160 void DossierBt(wxCommandEvent& event);
161 void OnMenuItem5Selected(wxCommandEvent& event);
162 void OnMenuItem6Selected(wxCommandEvent& event);
163 void OnModPropSelected(wxCommandEvent& event);
164 void OnOpenPaintProgramClick(wxCommandEvent& event);
165 void OnBanqueImageListItemActivated1(wxTreeEvent& event);
166 void OntoolbarPanelResize(wxSizeEvent& event);
167 void OnapercuPanelPaint(wxPaintEvent& event);
168 void OnMoveUpSelected(wxCommandEvent& event);
169 void OnMoveDownSelected(wxCommandEvent& event);
170 void OnSetFocus(wxFocusEvent& event);
171 void OnResize(wxSizeEvent& event);
172 void OnAddFolderSelected(wxCommandEvent& event);
173 void OnRemoveFolderSelected(wxCommandEvent& event);
174 void OnremoveFolderOnlySelected(wxCommandEvent& event);
175 void OnsearchCtrlText(wxCommandEvent& event);
176 void OnresourcesTreeBeginLabelEdit(wxTreeEvent& event);
177 void OnresourcesTreeEndLabelEdit(wxTreeEvent& event);
178 void OnresourcesTreeItemActivated(wxTreeEvent& event);
179 void OnresourcesTreeSelectionChanged(wxTreeEvent& event);
180 void OnresourcesTreeItemMenu(wxTreeEvent& event);
181 void OnapercuPanelResize(wxSizeEvent& event);
182 void OnresourcesTreeBeginDrag(wxTreeEvent& event);
183 void OnpreviewPanelPaint(wxPaintEvent& event);
184 void OnpreviewPanelResize(wxSizeEvent& event);
185 void OnresourcesTreeKeyDown(wxTreeEvent& event);
186 void OnresourcesTreeEndDrag(wxTreeEvent& event);
187 void OnAddFromLibraryToolbarBtClick(wxCommandEvent& event);
188 //*)
189 void OnMoreOptions( wxCommandEvent& event );
190 void OnAddFromLibraryBtClick(wxCommandEvent& event);
191 void OnDeleteUnusedFiles( wxCommandEvent& event );
192 void OnShowPreviewBtClick( wxCommandEvent& event );
193 void OnShowPropertyGridBtClick( wxCommandEvent& event );
194 void ConnectEvents();
195 void OnPropertyChanged(wxPropertyGridEvent& event);
196 void OnPropertyChanging(wxPropertyGridEvent& event);
197
198
199 void UpdatePropertyGrid();
200 void RemoveImageFromTree(wxTreeItemId parent, std::string imageName);
201 void RenameInTree(wxTreeItemId parent, std::string oldName, std::string newName, std::string type);
202 wxTreeItemId GetSelectedFolderItem();
203 void ShiftUpElementOfTree();
204 void ShiftDownElementOfTree();
205
206 wxTreeItemId allImagesItem;
207
208 gd::MainFrameWrapper mainFrameWrapper;
209 bool useRibbon;
210 bool editorJustConstructed;
211
212 std::string selectedResource;
213 std::string renamedItemOldName;
214
215 gd::ResourceLibraryDialog * resourceLibraryDialog;
216
217 DECLARE_EVENT_TABLE()
218 };
219
220 #endif
221 #endif
222