BsGUIToggleField.h 830 B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsGUIFieldBase.h"
  4. namespace BansheeEngine
  5. {
  6. class BS_ED_EXPORT GUIToggleField : public TGUIField<GUIToggleField>
  7. {
  8. public:
  9. static const String& getGUITypeName();
  10. static const String& getToggleStyleType();
  11. GUIToggleField(const PrivatelyConstruct& dummy, const GUIContent& labelContent, UINT32 labelWidth,
  12. const String& style, const GUIDimensions& dimensions, bool withLabel);
  13. bool getValue() const { return mValue; }
  14. void setValue(bool value);
  15. /**
  16. * @copydoc GUIElement::setTint
  17. */
  18. virtual void setTint(const Color& color);
  19. Event<void(bool)> onValueChanged;
  20. protected:
  21. virtual ~GUIToggleField() { }
  22. void styleUpdated();
  23. void valueChanged(bool newValue);
  24. GUIToggle* mToggle;
  25. bool mValue;
  26. };
  27. }