BsGUIToggleField.h 740 B

123456789101112131415161718192021222324252627282930
  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 GUILayoutOptions& layoutOptions, bool withLabel);
  13. bool getValue() const { return mValue; }
  14. void setValue(bool value);
  15. Event<void(bool)> onValueChanged;
  16. protected:
  17. virtual ~GUIToggleField() { }
  18. void styleUpdated();
  19. void valueChanged(bool newValue);
  20. GUIToggle* mToggle;
  21. bool mValue;
  22. };
  23. }