BsGUIFoldout.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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& layoutOptions, 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 GUILayoutOptions& layoutOptions);
  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. void _updateLayoutInternal(INT32 x, INT32 y, UINT32 width, UINT32 height,
  23. Rect2I clipRect, UINT8 widgetDepth, UINT16 areaDepth);
  24. Vector2I _getOptimalSize() const;
  25. Event<void(bool)> onStateChanged;
  26. protected:
  27. virtual ~GUIFoldout();
  28. void toggleTriggered(bool value);
  29. void styleUpdated();
  30. GUILabel* mLabel;
  31. GUIToggle* mToggle;
  32. bool mIsExpanded;
  33. };
  34. }