BsGUIColorField.h 866 B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsGUIFieldBase.h"
  4. #include "BsColor.h"
  5. namespace BansheeEngine
  6. {
  7. class BS_ED_EXPORT GUIColorField : public TGUIField<GUIColorField>
  8. {
  9. public:
  10. static const String& getGUITypeName();
  11. static const String& getColorInputStyleType();
  12. GUIColorField(const PrivatelyConstruct& dummy, const GUIContent& labelContent, UINT32 labelWidth,
  13. const String& style, const GUILayoutOptions& layoutOptions, bool withLabel);
  14. Color getValue() const { return mValue; }
  15. void setValue(const Color& value);
  16. Vector2I _getOptimalSize() const;
  17. Event<void(const Color&)> onValueChanged;
  18. protected:
  19. virtual ~GUIColorField();
  20. void styleUpdated();
  21. void valueChanged(const Color& newValue);
  22. UINT32 mLabelWidth;
  23. Color mValue;
  24. GUILabel* mLabel;
  25. GUIColor* mColor;
  26. };
  27. }