BsGUIGameObjectField.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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(const BS::GUIContent& labelContent, CM::UINT32 labelWidth, const BS::GUIOptions& layoutOptions,
  12. const CM::String& labelStyle = CM::StringUtil::BLANK, const CM::String& dropButtonStyle = CM::StringUtil::BLANK,
  13. const CM::String& clearButtonStyle = CM::StringUtil::BLANK);
  14. static GUIGameObjectField* create(const BS::GUIContent& labelContent, const BS::GUIOptions& layoutOptions,
  15. const CM::String& labelStyle = CM::StringUtil::BLANK, const CM::String& dropButtonStyle = CM::StringUtil::BLANK,
  16. const CM::String& clearButtonStyle = CM::StringUtil::BLANK);
  17. static GUIGameObjectField* create(const CM::HString& labelText, CM::UINT32 labelWidth, const BS::GUIOptions& layoutOptions,
  18. const CM::String& labelStyle = CM::StringUtil::BLANK, const CM::String& dropButtonStyle = CM::StringUtil::BLANK,
  19. const CM::String& clearButtonStyle = CM::StringUtil::BLANK);
  20. static GUIGameObjectField* create(const CM::HString& labelText, const BS::GUIOptions& layoutOptions,
  21. const CM::String& labelStyle = CM::StringUtil::BLANK, const CM::String& dropButtonStyle = CM::StringUtil::BLANK,
  22. const CM::String& clearButtonStyle = CM::StringUtil::BLANK);
  23. static GUIGameObjectField* create(const BS::GUIOptions& layoutOptions, const CM::String& dropButtonStyle = CM::StringUtil::BLANK,
  24. const CM::String& clearButtonStyle = CM::StringUtil::BLANK);
  25. static GUIGameObjectField* create(const BS::GUIContent& labelContent, CM::UINT32 labelWidth,
  26. const CM::String& labelStyle = CM::StringUtil::BLANK, const CM::String& dropButtonStyle = CM::StringUtil::BLANK,
  27. const CM::String& clearButtonStyle = CM::StringUtil::BLANK);
  28. static GUIGameObjectField* create(const BS::GUIContent& labelContent,
  29. const CM::String& labelStyle = CM::StringUtil::BLANK, const CM::String& dropButtonStyle = CM::StringUtil::BLANK,
  30. const CM::String& clearButtonStyle = CM::StringUtil::BLANK);
  31. static GUIGameObjectField* create(const CM::HString& labelText, CM::UINT32 labelWidth,
  32. const CM::String& labelStyle = CM::StringUtil::BLANK, const CM::String& dropButtonStyle = CM::StringUtil::BLANK,
  33. const CM::String& clearButtonStyle = CM::StringUtil::BLANK);
  34. static GUIGameObjectField* create(const CM::HString& labelText,
  35. const CM::String& labelStyle = CM::StringUtil::BLANK, const CM::String& dropButtonStyle = CM::StringUtil::BLANK,
  36. const CM::String& clearButtonStyle = CM::StringUtil::BLANK);
  37. static GUIGameObjectField* create(const CM::String& dropButtonStyle = CM::StringUtil::BLANK,
  38. const CM::String& clearButtonStyle = CM::StringUtil::BLANK);
  39. GUIGameObjectField(const PrivatelyConstruct& dummy, const BS::GUIContent& labelContent,
  40. CM::UINT32 labelWidth, const CM::String& labelStyle, const CM::String& dropButtonStyle,
  41. const CM::String& 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. static const CM::String DROP_BUTTON_STYLE;
  53. static const CM::String CLEAR_BUTTON_STYLE;
  54. BS::GUILayout* mLayout;
  55. BS::GUILabel* mLabel;
  56. GUIDropButton* mDropButton;
  57. BS::GUIButton* mClearButton;
  58. CM::UINT64 mInstanceId;
  59. };
  60. }