BsGUIGameObjectField.h 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsGUIElementContainer.h"
  4. namespace BansheeEditor
  5. {
  6. class BS_ED_EXPORT GUIGameObjectField : public BS::GUIElementContainer
  7. {
  8. struct PrivatelyConstruct {};
  9. public:
  10. static const CM::String& getGUITypeName();
  11. static GUIGameObjectField* create(BS::GUIWidget& parent, const BS::GUIContent& labelContent, CM::UINT32 labelWidth, const BS::GUIOptions& layoutOptions,
  12. BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* dropButtonStyle = nullptr,
  13. BS::GUIElementStyle* clearButtonStyle = nullptr);
  14. static GUIGameObjectField* create(BS::GUIWidget& parent, const BS::GUIContent& labelContent, const BS::GUIOptions& layoutOptions,
  15. BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* dropButtonStyle = nullptr,
  16. BS::GUIElementStyle* clearButtonStyle = nullptr);
  17. static GUIGameObjectField* create(BS::GUIWidget& parent, const CM::HString& labelText, CM::UINT32 labelWidth, const BS::GUIOptions& layoutOptions,
  18. BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* dropButtonStyle = nullptr,
  19. BS::GUIElementStyle* clearButtonStyle = nullptr);
  20. static GUIGameObjectField* create(BS::GUIWidget& parent, const CM::HString& labelText, const BS::GUIOptions& layoutOptions,
  21. BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* dropButtonStyle = nullptr,
  22. BS::GUIElementStyle* clearButtonStyle = nullptr);
  23. static GUIGameObjectField* create(BS::GUIWidget& parent, const BS::GUIOptions& layoutOptions, BS::GUIElementStyle* dropButtonStyle = nullptr,
  24. BS::GUIElementStyle* clearButtonStyle = nullptr);
  25. static GUIGameObjectField* create(BS::GUIWidget& parent, const BS::GUIContent& labelContent, CM::UINT32 labelWidth,
  26. BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* dropButtonStyle = nullptr,
  27. BS::GUIElementStyle* clearButtonStyle = nullptr);
  28. static GUIGameObjectField* create(BS::GUIWidget& parent, const BS::GUIContent& labelContent,
  29. BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* dropButtonStyle = nullptr,
  30. BS::GUIElementStyle* clearButtonStyle = nullptr);
  31. static GUIGameObjectField* create(BS::GUIWidget& parent, const CM::HString& labelText, CM::UINT32 labelWidth,
  32. BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* dropButtonStyle = nullptr,
  33. BS::GUIElementStyle* clearButtonStyle = nullptr);
  34. static GUIGameObjectField* create(BS::GUIWidget& parent, const CM::HString& labelText,
  35. BS::GUIElementStyle* labelStyle = nullptr, BS::GUIElementStyle* dropButtonStyle = nullptr,
  36. BS::GUIElementStyle* clearButtonStyle = nullptr);
  37. static GUIGameObjectField* create(BS::GUIWidget& parent, BS::GUIElementStyle* dropButtonStyle = nullptr,
  38. BS::GUIElementStyle* clearButtonStyle = nullptr);
  39. GUIGameObjectField(const PrivatelyConstruct& dummy, BS::GUIWidget& parent, const BS::GUIContent& labelContent,
  40. CM::UINT32 labelWidth, BS::GUIElementStyle* labelStyle, BS::GUIElementStyle* dropButtonStyle,
  41. BS::GUIElementStyle* clearButtonStyle, const BS::GUILayoutOptions& layoutOptions, bool withLabel);
  42. CM::HGameObject getValue() const;
  43. void setValue(const CM::HGameObject& value);
  44. void _updateLayoutInternal(CM::INT32 x, CM::INT32 y, CM::UINT32 width, CM::UINT32 height,
  45. CM::RectI clipRect, CM::UINT8 widgetDepth, CM::UINT16 areaDepth);
  46. CM::Vector2I _getOptimalSize() const;
  47. private:
  48. virtual ~GUIGameObjectField();
  49. void dataDropped(void* data);
  50. private:
  51. static const CM::UINT32 DEFAULT_LABEL_WIDTH;
  52. BS::GUILayout* mLayout;
  53. BS::GUILabel* mLabel;
  54. GUIDropButton* mDropButton;
  55. BS::GUIButton* mClearButton;
  56. CM::UINT64 mInstanceId;
  57. };
  58. }