BsGUIToggleField.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsGUIElementContainer.h"
  4. namespace BansheeEditor
  5. {
  6. class BS_ED_EXPORT GUIToggleField : public BS::GUIElementContainer
  7. {
  8. struct PrivatelyConstruct {};
  9. public:
  10. static const CM::String& getGUITypeName();
  11. static GUIToggleField* create(BS::GUIWidget& parent, const BS::GUIContent& labelContent,
  12. const BS::GUIOptions& layoutOptions, BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* toggleStyle = nullptr);
  13. static GUIToggleField* create(BS::GUIWidget& parent, const CM::HString& labelText,
  14. const BS::GUIOptions& layoutOptions, BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* toggleStyle = nullptr);
  15. static GUIToggleField* create(BS::GUIWidget& parent,
  16. const BS::GUIOptions& layoutOptions, BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* toggleStyle = nullptr);
  17. static GUIToggleField* create(BS::GUIWidget& parent, const BS::GUIContent& labelContent,
  18. BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* toggleStyle = nullptr);
  19. static GUIToggleField* create(BS::GUIWidget& parent, const CM::HString& labelText,
  20. BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* toggleStyle = nullptr);
  21. static GUIToggleField* create(BS::GUIWidget& parent,
  22. BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* toggleStyle = nullptr);
  23. GUIToggleField(const PrivatelyConstruct& dummy, BS::GUIWidget& parent, const BS::GUIContent& labelContent,
  24. BS::GUIElementStyle* labelStyle, BS::GUIElementStyle* toggleStyle, const BS::GUILayoutOptions& layoutOptions);
  25. GUIToggleField(const PrivatelyConstruct& dummy, BS::GUIWidget& parent,
  26. BS::GUIElementStyle* labelStyle, BS::GUIElementStyle* toggleStyle, const BS::GUILayoutOptions& layoutOptions);
  27. bool getValue() const;
  28. void setValue(bool value);
  29. void setLabelWidth(CM::UINT32 width);
  30. void _updateLayoutInternal(CM::INT32 x, CM::INT32 y, CM::UINT32 width, CM::UINT32 height,
  31. CM::RectI clipRect, CM::UINT8 widgetDepth, CM::UINT16 areaDepth);
  32. CM::Vector2I _getOptimalSize() const;
  33. protected:
  34. virtual ~GUIToggleField();
  35. protected:
  36. CM::UINT32 mLabelWidth;
  37. BS::GUILabel* mLabel;
  38. BS::GUIToggle* mToggle;
  39. };
  40. }