BsGUIComponentFoldout.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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& options, 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 GUIDimensions& dimensions);
  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. /**
  22. * @copydoc GUIElement::setTint
  23. */
  24. virtual void setTint(const Color& color);
  25. void _updateLayoutInternal(const GUILayoutData& data);
  26. Vector2I _getOptimalSize() const;
  27. Event<void(bool)> onStateChanged;
  28. protected:
  29. virtual ~GUIComponentFoldout();
  30. void toggleTriggered(bool value);
  31. void styleUpdated();
  32. GUIToggle* mToggle;
  33. bool mIsExpanded;
  34. };
  35. }