BsGUIFoldout.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsGUIElementContainer.h"
  4. namespace BansheeEngine
  5. {
  6. class BS_ED_EXPORT GUIFoldout : public GUIElementContainer
  7. {
  8. struct PrivatelyConstruct {};
  9. public:
  10. static const String& getGUITypeName();
  11. static const String& getFoldoutButtonStyleType();
  12. static const String& getLabelStyleType();
  13. static GUIFoldout* create(const HString& label, const GUIOptions& options, const String& style = StringUtil::BLANK);
  14. static GUIFoldout* create(const HString& label, const String& style = StringUtil::BLANK);
  15. GUIFoldout(const PrivatelyConstruct& dummy, const HString& label, const String& style, const GUIDimensions& dimensions);
  16. bool isExpanded() const { return mIsExpanded; }
  17. void setExpanded(bool expanded);
  18. /**
  19. * Changes the label of the foldout.
  20. */
  21. void setContent(const GUIContent& content);
  22. /**
  23. * @copydoc GUIElement::setTint
  24. */
  25. virtual void setTint(const Color& color);
  26. void _updateLayoutInternal(const GUILayoutData& data);
  27. Vector2I _getOptimalSize() const;
  28. Event<void(bool)> onStateChanged;
  29. protected:
  30. virtual ~GUIFoldout();
  31. void toggleTriggered(bool value);
  32. void styleUpdated();
  33. GUILabel* mLabel;
  34. GUIToggle* mToggle;
  35. bool mIsExpanded;
  36. };
  37. }