BsGUITextureField.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #pragma once
  2. #include "BsScriptEditorPrerequisites.h"
  3. #include "BsGUIElementContainer.h"
  4. namespace BansheeEngine
  5. {
  6. class BS_SCR_BED_EXPORT GUITextureField : public GUIElementContainer
  7. {
  8. struct PrivatelyConstruct {};
  9. public:
  10. static const String& getGUITypeName();
  11. static GUITextureField* create(const GUIContent& labelContent, UINT32 labelWidth, const GUIOptions& options,
  12. const String& style = StringUtil::BLANK);
  13. static GUITextureField* create(const GUIContent& labelContent, const GUIOptions& options,
  14. const String& style = StringUtil::BLANK);
  15. static GUITextureField* create(const HString& labelText, UINT32 labelWidth, const GUIOptions& options,
  16. const String& style = StringUtil::BLANK);
  17. static GUITextureField* create(const HString& labelText, const GUIOptions& options,
  18. const String& style = StringUtil::BLANK);
  19. static GUITextureField* create(const GUIOptions& options, const String& style = StringUtil::BLANK);
  20. static GUITextureField* create(const GUIContent& labelContent, UINT32 labelWidth,
  21. const String& style = StringUtil::BLANK);
  22. static GUITextureField* create(const GUIContent& labelContent,
  23. const String& style = StringUtil::BLANK);
  24. static GUITextureField* create(const HString& labelText, UINT32 labelWidth,
  25. const String& style = StringUtil::BLANK);
  26. static GUITextureField* create(const HString& labelText,
  27. const String& style = StringUtil::BLANK);
  28. static GUITextureField* create(const String& style = StringUtil::BLANK);
  29. GUITextureField(const PrivatelyConstruct& dummy, const GUIContent& labelContent,
  30. UINT32 labelWidth, const String& style, const GUIDimensions& dimensions, bool withLabel);
  31. HTexture getValue() const;
  32. void setValue(const HTexture& value);
  33. String getUUID() const { return mUUID; }
  34. void setUUID(const String& uuid);
  35. /**
  36. * @copydoc GUIElement::setTint
  37. */
  38. virtual void setTint(const Color& color) override;
  39. void _updateLayoutInternal(const GUILayoutData& data) override;
  40. Vector2I _getOptimalSize() const override;
  41. Event<void(const String&)> onValueChanged;
  42. private:
  43. virtual ~GUITextureField();
  44. void styleUpdated() override;
  45. void dataDropped(void* data);
  46. void onClearButtonClicked();
  47. private:
  48. static const UINT32 DEFAULT_LABEL_WIDTH;
  49. GUILayout* mLayout;
  50. GUILabel* mLabel;
  51. GUIDropButton* mDropButton;
  52. GUIButton* mClearButton;
  53. String mUUID;
  54. };
  55. }