BsGUISceneTreeView.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsGUITreeView.h"
  4. #include "BsEvent.h"
  5. namespace BansheeEngine
  6. {
  7. struct DraggedSceneObjects
  8. {
  9. DraggedSceneObjects(UINT32 numObjects);
  10. ~DraggedSceneObjects();
  11. UINT32 numObjects;
  12. HSceneObject* objects;
  13. };
  14. class GUISceneTreeView : public GUITreeView
  15. {
  16. struct SceneTreeElement : public GUITreeView::TreeElement
  17. {
  18. SceneTreeElement()
  19. :mId(0)
  20. { }
  21. HSceneObject mSceneObject;
  22. UINT64 mId;
  23. };
  24. public:
  25. static const String& getGUITypeName();
  26. static GUISceneTreeView* create(
  27. const String& backgroundStyle = StringUtil::BLANK, const String& elementBtnStyle = StringUtil::BLANK,
  28. const String& foldoutBtnStyle = StringUtil::BLANK, const String& selectionBackgroundStyle = StringUtil::BLANK,
  29. const String& editBoxStyle = StringUtil::BLANK, const String& dragHighlightStyle = StringUtil::BLANK,
  30. const String& dragSepHighlightStyle = StringUtil::BLANK);
  31. static GUISceneTreeView* create(const GUIOptions& options,
  32. const String& backgroundStyle = StringUtil::BLANK, const String& elementBtnStyle = StringUtil::BLANK,
  33. const String& foldoutBtnStyle = StringUtil::BLANK, const String& selectionBackgroundStyle = StringUtil::BLANK,
  34. const String& editBoxStyle = StringUtil::BLANK, const String& dragHighlightStyle = StringUtil::BLANK,
  35. const String& dragSepHighlightStyle = StringUtil::BLANK);
  36. protected:
  37. virtual ~GUISceneTreeView();
  38. protected:
  39. SceneTreeElement mRootElement;
  40. GUISceneTreeView(const String& backgroundStyle, const String& elementBtnStyle,
  41. const String& foldoutBtnStyle, const String& selectionBackgroundStyle, const String& editBoxStyle,
  42. const String& dragHighlightStyle, const String& dragSepHighlightStyle, const 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 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 Vector2I position, UINT32 typeId) const;
  54. void deleteTreeElementInternal(TreeElement* element);
  55. };
  56. }