BsGUISceneTreeView.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsGUITreeView.h"
  4. #include <boost/signal.hpp>
  5. namespace BansheeEditor
  6. {
  7. class GUISceneTreeView : public GUITreeView
  8. {
  9. struct SceneTreeElement : public GUITreeView::TreeElement
  10. {
  11. SceneTreeElement()
  12. :mId(0)
  13. { }
  14. CM::HSceneObject mSceneObject;
  15. CM::UINT32 mId;
  16. };
  17. struct DraggedSceneObjects
  18. {
  19. DraggedSceneObjects(CM::UINT32 numObjects);
  20. ~DraggedSceneObjects();
  21. CM::UINT32 numObjects;
  22. CM::HSceneObject* objects;
  23. };
  24. public:
  25. static const CM::String& getGUITypeName();
  26. static GUISceneTreeView* create(BS::GUIWidget& parent,
  27. BS::GUIElementStyle* backgroundStyle = nullptr, BS::GUIElementStyle* elementBtnStyle = nullptr,
  28. BS::GUIElementStyle* foldoutBtnStyle = nullptr, BS::GUIElementStyle* selectionBackgroundStyle = nullptr,
  29. BS::GUIElementStyle* editBoxStyle = nullptr, BS::GUIElementStyle* dragHighlightStyle = nullptr,
  30. BS::GUIElementStyle* dragSepHighlightStyle = nullptr);
  31. static GUISceneTreeView* create(BS::GUIWidget& parent, const BS::GUIOptions& options,
  32. BS::GUIElementStyle* backgroundStyle = nullptr, BS::GUIElementStyle* elementBtnStyle = nullptr,
  33. BS::GUIElementStyle* foldoutBtnStyle = nullptr, BS::GUIElementStyle* selectionBackgroundStyle = nullptr,
  34. BS::GUIElementStyle* editBoxStyle = nullptr, BS::GUIElementStyle* dragHighlightStyle = nullptr,
  35. BS::GUIElementStyle* dragSepHighlightStyle = nullptr);
  36. protected:
  37. virtual ~GUISceneTreeView();
  38. protected:
  39. SceneTreeElement mRootElement;
  40. GUISceneTreeView(BS::GUIWidget& parent, BS::GUIElementStyle* backgroundStyle, BS::GUIElementStyle* elementBtnStyle,
  41. BS::GUIElementStyle* foldoutBtnStyle, BS::GUIElementStyle* selectionBackgroundStyle, BS::GUIElementStyle* editBoxStyle,
  42. BS::GUIElementStyle* dragHighlightStyle, BS::GUIElementStyle* dragSepHighlightStyle, const BS::GUILayoutOptions& layoutOptions);
  43. void updateTreeElement(SceneTreeElement* element);
  44. virtual TreeElement& getRootElement() { return mRootElement; }
  45. virtual const TreeElement& getRootElementConst() const { return mRootElement; }
  46. virtual void updateTreeElementHierarchy();
  47. virtual void renameTreeElement(TreeElement* element, const CM::WString& name);
  48. virtual void deleteTreeElement(TreeElement* element);
  49. virtual bool acceptDragAndDrop() const;
  50. virtual void dragAndDropStart();
  51. virtual void dragAndDropEnded(TreeElement* overTreeElement);
  52. virtual void dragAndDropFinalize();
  53. void deleteTreeElementInternal(TreeElement* element);
  54. };
  55. }