BsGUIGameObjectField.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #pragma once
  2. #include "BsScriptEditorPrerequisites.h"
  3. #include "BsGUIElementContainer.h"
  4. namespace BansheeEngine
  5. {
  6. class BS_SCR_BED_EXPORT GUIGameObjectField : public GUIElementContainer
  7. {
  8. struct PrivatelyConstruct {};
  9. public:
  10. static const String& getGUITypeName();
  11. static GUIGameObjectField* create(const String& typeNamespace, const String& type, const GUIContent& labelContent, UINT32 labelWidth, const GUIOptions& layoutOptions,
  12. const String& style = StringUtil::BLANK);
  13. static GUIGameObjectField* create(const String& typeNamespace, const String& type, const GUIContent& labelContent, const GUIOptions& layoutOptions,
  14. const String& style = StringUtil::BLANK);
  15. static GUIGameObjectField* create(const String& typeNamespace, const String& type, const HString& labelText, UINT32 labelWidth, const GUIOptions& layoutOptions,
  16. const String& style = StringUtil::BLANK);
  17. static GUIGameObjectField* create(const String& typeNamespace, const String& type, const HString& labelText, const GUIOptions& layoutOptions,
  18. const String& style = StringUtil::BLANK);
  19. static GUIGameObjectField* create(const String& typeNamespace, const String& type, const GUIOptions& layoutOptions, const String& style = StringUtil::BLANK);
  20. static GUIGameObjectField* create(const String& typeNamespace, const String& type, const GUIContent& labelContent, UINT32 labelWidth,
  21. const String& style = StringUtil::BLANK);
  22. static GUIGameObjectField* create(const String& typeNamespace, const String& type, const GUIContent& labelContent,
  23. const String& style = StringUtil::BLANK);
  24. static GUIGameObjectField* create(const String& typeNamespace, const String& type, const HString& labelText, UINT32 labelWidth,
  25. const String& style = StringUtil::BLANK);
  26. static GUIGameObjectField* create(const String& typeNamespace, const String& type, const HString& labelText,
  27. const String& style = StringUtil::BLANK);
  28. static GUIGameObjectField* create(const String& typeNamespace, const String& type, const String& style = StringUtil::BLANK);
  29. GUIGameObjectField(const PrivatelyConstruct& dummy, const String& typeNamespace, const String& type, const GUIContent& labelContent,
  30. UINT32 labelWidth, const String& style, const GUILayoutOptions& layoutOptions, bool withLabel);
  31. HGameObject getValue() const;
  32. void setValue(const HGameObject& value);
  33. void _updateLayoutInternal(INT32 x, INT32 y, UINT32 width, UINT32 height,
  34. Rect2I clipRect, UINT8 widgetDepth, UINT16 areaDepth);
  35. Vector2I _getOptimalSize() const;
  36. Event<void(const HGameObject&)> onValueChanged;
  37. private:
  38. virtual ~GUIGameObjectField();
  39. void styleUpdated();
  40. void dataDropped(void* data);
  41. void onClearButtonClicked();
  42. private:
  43. static const UINT32 DEFAULT_LABEL_WIDTH;
  44. GUILayout* mLayout;
  45. GUILabel* mLabel;
  46. GUIDropButton* mDropButton;
  47. GUIButton* mClearButton;
  48. String mType;
  49. String mNamespace;
  50. UINT64 mInstanceId;
  51. };
  52. }