BsGUIGameObjectField.h 3.4 KB

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