BsGUIFoldout.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsGUIElementContainer.h"
  4. namespace BansheeEditor
  5. {
  6. class BS_ED_EXPORT GUIFoldout : public BS::GUIElementContainer
  7. {
  8. struct PrivatelyConstruct {};
  9. public:
  10. static const CM::String& getGUITypeName();
  11. static GUIFoldout* create(const BS::GUIOptions& layoutOptions,
  12. const CM::String& toggleStyle = CM::StringUtil::BLANK, const CM::String& backgroundStyle = CM::StringUtil::BLANK);
  13. static GUIFoldout* create(const CM::String& toggleStyle = CM::StringUtil::BLANK,
  14. const CM::String& backgroundStyle = CM::StringUtil::BLANK);
  15. GUIFoldout(const PrivatelyConstruct& dummy, const CM::String& toggleStyle,
  16. const CM::String& backgroundStyle, const BS::GUILayoutOptions& layoutOptions);
  17. bool isExpanded() const { return mIsExpanded; }
  18. void setExpanded(bool expanded);
  19. void _updateLayoutInternal(CM::INT32 x, CM::INT32 y, CM::UINT32 width, CM::UINT32 height,
  20. CM::RectI clipRect, CM::UINT8 widgetDepth, CM::UINT16 areaDepth);
  21. CM::Vector2I _getOptimalSize() const;
  22. boost::signal<void(bool)> onStateChanged;
  23. protected:
  24. virtual ~GUIFoldout();
  25. protected:
  26. static const CM::String FOLDOUT_BUTTON_STYLE;
  27. static const CM::String FOLDOUT_BG_STYLE;
  28. BS::GUIToggle* mToggle;
  29. BS::GUITexture* mBackground;
  30. bool mIsExpanded;
  31. };
  32. }