BsGUIGameObjectField.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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& options,
  12. const String& style = StringUtil::BLANK);
  13. static GUIGameObjectField* create(const String& typeNamespace, const String& type, const GUIContent& labelContent, const GUIOptions& options,
  14. const String& style = StringUtil::BLANK);
  15. static GUIGameObjectField* create(const String& typeNamespace, const String& type, const HString& labelText, UINT32 labelWidth, const GUIOptions& options,
  16. const String& style = StringUtil::BLANK);
  17. static GUIGameObjectField* create(const String& typeNamespace, const String& type, const HString& labelText, const GUIOptions& options,
  18. const String& style = StringUtil::BLANK);
  19. static GUIGameObjectField* create(const String& typeNamespace, const String& type, const GUIOptions& options, 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 GUIDimensions& dimensions, bool withLabel);
  31. HGameObject getValue() const;
  32. void setValue(const HGameObject& value);
  33. /**
  34. * @copydoc GUIElement::setTint
  35. */
  36. virtual void setTint(const Color& color);
  37. void _updateLayoutInternal(const GUILayoutData& data);
  38. Vector2I _getOptimalSize() const;
  39. Event<void(const HGameObject&)> onValueChanged;
  40. private:
  41. virtual ~GUIGameObjectField();
  42. void styleUpdated();
  43. void dataDropped(void* data);
  44. void onClearButtonClicked();
  45. private:
  46. static const UINT32 DEFAULT_LABEL_WIDTH;
  47. GUILayout* mLayout;
  48. GUILabel* mLabel;
  49. GUIDropButton* mDropButton;
  50. GUIButton* mClearButton;
  51. String mType;
  52. String mNamespace;
  53. UINT64 mInstanceId;
  54. };
  55. }