BsGUIComponentFoldout.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsGUIElementContainer.h"
  4. namespace BansheeEngine
  5. {
  6. class BS_ED_EXPORT GUIComponentFoldout : public GUIElementContainer
  7. {
  8. struct PrivatelyConstruct {};
  9. public:
  10. static const String& getGUITypeName();
  11. static const String& getFoldoutButtonStyleType();
  12. static GUIComponentFoldout* create(const HString& label, const GUIOptions& layoutOptions, const String& style = StringUtil::BLANK);
  13. static GUIComponentFoldout* create(const HString& label, const String& style = StringUtil::BLANK);
  14. GUIComponentFoldout(const PrivatelyConstruct& dummy, const HString& label, const String& style, const GUILayoutOptions& layoutOptions);
  15. bool isExpanded() const { return mIsExpanded; }
  16. void setExpanded(bool expanded);
  17. /**
  18. * Changes the label of the foldout.
  19. */
  20. void setContent(const GUIContent& content);
  21. void _updateLayoutInternal(INT32 x, INT32 y, UINT32 width, UINT32 height,
  22. Rect2I clipRect, UINT8 widgetDepth, UINT16 areaDepth);
  23. Vector2I _getOptimalSize() const;
  24. Event<void(bool)> onStateChanged;
  25. protected:
  26. virtual ~GUIComponentFoldout();
  27. void toggleTriggered(bool value);
  28. void styleUpdated();
  29. GUIToggle* mToggle;
  30. bool mIsExpanded;
  31. };
  32. }