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. struct DraggedSceneObjects
  8. {
  9. DraggedSceneObjects(CM::UINT32 numObjects);
  10. ~DraggedSceneObjects();
  11. CM::UINT32 numObjects;
  12. CM::HSceneObject* objects;
  13. };
  14. class GUISceneTreeView : public GUITreeView
  15. {
  16. struct SceneTreeElement : public GUITreeView::TreeElement
  17. {
  18. SceneTreeElement()
  19. :mId(0)
  20. { }
  21. CM::HSceneObject mSceneObject;
  22. CM::UINT64 mId;
  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. }