BsGUISceneTreeView.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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(
  27. const CM::String& backgroundStyle = CM::StringUtil::BLANK, const CM::String& elementBtnStyle = CM::StringUtil::BLANK,
  28. const CM::String& foldoutBtnStyle = CM::StringUtil::BLANK, const CM::String& selectionBackgroundStyle = CM::StringUtil::BLANK,
  29. const CM::String& editBoxStyle = CM::StringUtil::BLANK, const CM::String& dragHighlightStyle = CM::StringUtil::BLANK,
  30. const CM::String& dragSepHighlightStyle = CM::StringUtil::BLANK);
  31. static GUISceneTreeView* create(const BS::GUIOptions& options,
  32. const CM::String& backgroundStyle = CM::StringUtil::BLANK, const CM::String& elementBtnStyle = CM::StringUtil::BLANK,
  33. const CM::String& foldoutBtnStyle = CM::StringUtil::BLANK, const CM::String& selectionBackgroundStyle = CM::StringUtil::BLANK,
  34. const CM::String& editBoxStyle = CM::StringUtil::BLANK, const CM::String& dragHighlightStyle = CM::StringUtil::BLANK,
  35. const CM::String& dragSepHighlightStyle = CM::StringUtil::BLANK);
  36. protected:
  37. virtual ~GUISceneTreeView();
  38. protected:
  39. SceneTreeElement mRootElement;
  40. GUISceneTreeView(const CM::String& backgroundStyle, const CM::String& elementBtnStyle,
  41. const CM::String& foldoutBtnStyle, const CM::String& selectionBackgroundStyle, const CM::String& editBoxStyle,
  42. const CM::String& dragHighlightStyle, const CM::String& 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. virtual bool _acceptDragAndDrop(const CM::Vector2I position, CM::UINT32 typeId) const;
  54. void deleteTreeElementInternal(TreeElement* element);
  55. };
  56. }