BsGUIColorField.h 2.2 KB

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