BsGUIVector4Field.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsGUIElementContainer.h"
  4. #include "CmVector4.h"
  5. namespace BansheeEditor
  6. {
  7. class BS_ED_EXPORT GUIVector4Field : public BS::GUIElementContainer
  8. {
  9. struct PrivatelyConstruct {};
  10. public:
  11. static const CM::String& getGUITypeName();
  12. static GUIVector4Field* create(BS::GUIWidget& parent, const BS::GUIContent& labelContent,
  13. const BS::GUIOptions& layoutOptions, BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* inputBoxStyle = nullptr);
  14. static GUIVector4Field* create(BS::GUIWidget& parent, const CM::HString& labelText,
  15. const BS::GUIOptions& layoutOptions, BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* inputBoxStyle = nullptr);
  16. static GUIVector4Field* create(BS::GUIWidget& parent,
  17. const BS::GUIOptions& layoutOptions, BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* inputBoxStyle = nullptr);
  18. static GUIVector4Field* create(BS::GUIWidget& parent, const BS::GUIContent& labelContent,
  19. BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* inputBoxStyle = nullptr);
  20. static GUIVector4Field* create(BS::GUIWidget& parent, const CM::HString& labelText,
  21. BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* inputBoxStyle = nullptr);
  22. static GUIVector4Field* create(BS::GUIWidget& parent,
  23. BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* inputBoxStyle = nullptr);
  24. GUIVector4Field(const PrivatelyConstruct& dummy, BS::GUIWidget& parent, const BS::GUIContent& labelContent,
  25. BS::GUIElementStyle* labelStyle, BS::GUIElementStyle* inputBoxStyle, const BS::GUILayoutOptions& layoutOptions);
  26. GUIVector4Field(const PrivatelyConstruct& dummy, BS::GUIWidget& parent,
  27. BS::GUIElementStyle* labelStyle, BS::GUIElementStyle* inputBoxStyle, const BS::GUILayoutOptions& layoutOptions);
  28. CM::Vector4 getValue() const;
  29. void setValue(const CM::Vector4& value);
  30. CM::Vector2I _getOptimalSize() const;
  31. protected:
  32. virtual ~GUIVector4Field();
  33. void _updateLayoutInternal(CM::INT32 x, CM::INT32 y, CM::UINT32 width, CM::UINT32 height,
  34. CM::RectI clipRect, CM::UINT8 widgetDepth, CM::UINT16 areaDepth);
  35. protected:
  36. static const CM::UINT32 ELEMENT_LABEL_WIDTH;
  37. BS::GUILabel* mLabel;
  38. GUIFloatField* mFieldX;
  39. GUIFloatField* mFieldY;
  40. GUIFloatField* mFieldZ;
  41. GUIFloatField* mFieldW;
  42. void construct(BS::GUIWidget& parent, const BS::GUIContent& labelContent, BS::GUIElementStyle* labelStyle,
  43. BS::GUIElementStyle* inputBoxStyle, const BS::GUILayoutOptions& layoutOptions, bool withLabel);
  44. };
  45. }