BsGUIFoldout.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 GUIFoldout : public GUIElementContainer
  7. {
  8. struct PrivatelyConstruct {};
  9. public:
  10. static const String& getGUITypeName();
  11. static GUIFoldout* create(const GUIOptions& layoutOptions,
  12. const String& toggleStyle = StringUtil::BLANK, const String& backgroundStyle = StringUtil::BLANK);
  13. static GUIFoldout* create(const String& toggleStyle = StringUtil::BLANK,
  14. const String& backgroundStyle = StringUtil::BLANK);
  15. GUIFoldout(const PrivatelyConstruct& dummy, const String& toggleStyle,
  16. const String& backgroundStyle, const GUILayoutOptions& layoutOptions);
  17. bool isExpanded() const { return mIsExpanded; }
  18. void setExpanded(bool expanded);
  19. void _updateLayoutInternal(INT32 x, INT32 y, UINT32 width, UINT32 height,
  20. RectI clipRect, UINT8 widgetDepth, UINT16 areaDepth);
  21. Vector2I _getOptimalSize() const;
  22. Event<void(bool)> onStateChanged;
  23. protected:
  24. virtual ~GUIFoldout();
  25. protected:
  26. static const String FOLDOUT_BUTTON_STYLE;
  27. static const String FOLDOUT_BG_STYLE;
  28. GUIToggle* mToggle;
  29. GUITexture* mBackground;
  30. bool mIsExpanded;
  31. };
  32. }