Cafu Engine
MaterialTree.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_MATERIAL_TREE_HPP_INCLUDED
8 #define CAFU_MATERIAL_TREE_HPP_INCLUDED
9 
10 #include "wx/treectrl.h"
11 
12 #include "Templates/Array.hpp"
13 
14 
15 class EditorMaterialI;
16 
17 
18 namespace MaterialBrowser
19 {
20  class DialogT;
21 
22 
23  class MaterialTreeT : public wxTreeCtrl
24  {
25  public:
26 
27  MaterialTreeT(DialogT* Parent, const ArrayT<EditorMaterialI*>& Materials);
28 
29  void SelectMaterial(const EditorMaterialI* Material);
30  void ShowEditorOnly(bool EditorOnly=true);
31 
32 
33  private:
34 
35  DialogT* m_Parent;
36 
37  bool m_IsRecursiveSelfNotify;
38 
39  // Helper methods.
40  wxTreeItemId GetChildByName(const wxTreeItemId& Parent, const wxString& Name, bool OnlyCategories, bool Recursive);
41  wxTreeItemId GetItemByMaterial(const EditorMaterialI* Material);
42 
43  void OnSelectionChanged(wxTreeEvent& TE);
44 
45  DECLARE_EVENT_TABLE()
46  };
47 }
48 
49 #endif
Definition: MaterialBrowserDialog.hpp:60
Definition: EditorMaterial.hpp:21
Definition: MaterialTree.hpp:23