BsGUIVector2Field.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsGUIElementContainer.h"
  4. #include "CmVector2.h"
  5. namespace BansheeEditor
  6. {
  7. class BS_ED_EXPORT GUIVector2Field : public BS::GUIElementContainer
  8. {
  9. struct PrivatelyConstruct {};
  10. public:
  11. static const CM::String& getGUITypeName();
  12. static GUIVector2Field* create(BS::GUIWidget& parent, const BS::GUIContent& labelContent,
  13. const BS::GUIOptions& layoutOptions, BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* inputBoxStyle = nullptr);
  14. static GUIVector2Field* create(BS::GUIWidget& parent, const CM::HString& labelText,
  15. const BS::GUIOptions& layoutOptions, BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* inputBoxStyle = nullptr);
  16. static GUIVector2Field* create(BS::GUIWidget& parent,
  17. const BS::GUIOptions& layoutOptions, BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* inputBoxStyle = nullptr);
  18. static GUIVector2Field* create(BS::GUIWidget& parent, const BS::GUIContent& labelContent,
  19. BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* inputBoxStyle = nullptr);
  20. static GUIVector2Field* create(BS::GUIWidget& parent, const CM::HString& labelText,
  21. BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* inputBoxStyle = nullptr);
  22. static GUIVector2Field* create(BS::GUIWidget& parent,
  23. BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* inputBoxStyle = nullptr);
  24. GUIVector2Field(const PrivatelyConstruct& dummy, BS::GUIWidget& parent, const BS::GUIContent& labelContent,
  25. BS::GUIElementStyle* labelStyle, BS::GUIElementStyle* inputBoxStyle, const BS::GUILayoutOptions& layoutOptions);
  26. GUIVector2Field(const PrivatelyConstruct& dummy, BS::GUIWidget& parent,
  27. BS::GUIElementStyle* labelStyle, BS::GUIElementStyle* inputBoxStyle, const BS::GUILayoutOptions& layoutOptions);
  28. CM::Vector2 getValue() const;
  29. void setValue(const CM::Vector2& value);
  30. CM::Vector2I _getOptimalSize() const;
  31. protected:
  32. virtual ~GUIVector2Field();
  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. void construct(BS::GUIWidget& parent, const BS::GUIContent& labelContent, BS::GUIElementStyle* labelStyle,
  41. BS::GUIElementStyle* inputBoxStyle, const BS::GUILayoutOptions& layoutOptions, bool withLabel);
  42. };
  43. }