BsGUIColorField.h 956 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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 GUIDimensions& dimensions, bool withLabel);
  14. Color getValue() const { return mValue; }
  15. void setValue(const Color& value);
  16. /**
  17. * @copydoc GUIElement::setTint
  18. */
  19. virtual void setTint(const Color& color);
  20. Vector2I _getOptimalSize() const;
  21. Event<void(const Color&)> onValueChanged;
  22. protected:
  23. virtual ~GUIColorField();
  24. void styleUpdated();
  25. void valueChanged(const Color& newValue);
  26. UINT32 mLabelWidth;
  27. Color mValue;
  28. GUILabel* mLabel;
  29. GUIColor* mColor;
  30. };
  31. }