BsGUIFieldOptions.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsEditorPrerequisites.h"
  5. #include "GUI/BsGUIOptions.h"
  6. #include "GUI/BsGUIContent.h"
  7. namespace bs
  8. {
  9. /** @addtogroup GUI-Editor
  10. * @{
  11. */
  12. /** Provides common options for initializing a GUI element used for editor fields. */
  13. struct BS_ED_EXPORT GUIFieldOptions
  14. {
  15. /**
  16. * Constructor for field options with a label.
  17. *
  18. * @param[in] labelContent Content to display in the editor field label.
  19. * @param[in] labelWidth Width of the label in pixels.
  20. * @param[in] options Options that allow you to control how is the element positioned and sized. This will
  21. * override any similar options set by style.
  22. * @param[in] style Optional style to use for the element. Style will be retrieved from GUISkin of the
  23. * GUIWidget the element is used on. If not specified default style is used.
  24. */
  25. GUIFieldOptions(const GUIContent& labelContent, UINT32 labelWidth, const GUIOptions& options,
  26. const String& style = StringUtil::BLANK)
  27. :labelContent(labelContent), labelWidth(labelWidth), options(options), style(style)
  28. { }
  29. /**
  30. * Constructor for field options with a label.
  31. *
  32. * @param[in] labelContent Content to display in the editor field label.
  33. * @param[in] options Options that allow you to control how is the element positioned and sized. This will
  34. * override any similar options set by style.
  35. * @param[in] style Optional style to use for the element. Style will be retrieved from GUISkin of the
  36. * GUIWidget the element is used on. If not specified default style is used.
  37. */
  38. GUIFieldOptions(const GUIContent& labelContent, const GUIOptions& options,
  39. const String& style = StringUtil::BLANK)
  40. :labelContent(labelContent), options(options), style(style)
  41. { }
  42. /**
  43. * Constructor for field options with a label.
  44. *
  45. * @param[in] labelText Text to display in the editor field label.
  46. * @param[in] labelWidth Width of the label in pixels.
  47. * @param[in] options Options that allow you to control how is the element positioned and sized. This will
  48. * override any similar options set by style.
  49. * @param[in] style Optional style to use for the element. Style will be retrieved from GUISkin of the
  50. * GUIWidget the element is used on. If not specified default style is used.
  51. */
  52. GUIFieldOptions(const HString& labelText, UINT32 labelWidth, const GUIOptions& options,
  53. const String& style = StringUtil::BLANK)
  54. :labelContent(labelText), labelWidth(labelWidth), options(options), style(style)
  55. { }
  56. /**
  57. * Constructor for field options with a label.
  58. *
  59. * @param[in] labelText Text to display in the editor field label.
  60. * @param[in] options Options that allow you to control how is the element positioned and sized. This will
  61. * override any similar options set by style.
  62. * @param[in] style Optional style to use for the element. Style will be retrieved from GUISkin of the
  63. * GUIWidget the element is used on. If not specified default style is used.
  64. */
  65. GUIFieldOptions(const HString& labelText, const GUIOptions& options,
  66. const String& style = StringUtil::BLANK)
  67. :labelContent(labelText), options(options), style(style)
  68. { }
  69. /**
  70. * Constructor for field options without a label.
  71. *
  72. * @param[in] options Options that allow you to control how is the element positioned and sized. This will
  73. * override any similar options set by style.
  74. * @param[in] style Optional style to use for the element. Style will be retrieved from GUISkin of the
  75. * GUIWidget the element is used on. If not specified default style is used.
  76. */
  77. GUIFieldOptions(const GUIOptions& options, const String& style = StringUtil::BLANK)
  78. :labelWidth(0), options(options), style(style)
  79. { }
  80. /**
  81. * Constructor.
  82. *
  83. * @param[in] labelContent Content to display in the editor field label.
  84. * @param[in] labelWidth Width of the label in pixels.
  85. * @param[in] style Optional style to use for the element. Style will be retrieved from GUISkin of the
  86. * GUIWidget the element is used on. If not specified default style is used.
  87. */
  88. GUIFieldOptions(const GUIContent& labelContent, UINT32 labelWidth, const String& style = StringUtil::BLANK)
  89. :labelContent(labelContent), labelWidth(labelWidth), style(style)
  90. { }
  91. /**
  92. * Constructor for field options with a label.
  93. *
  94. * @param[in] labelContent Content to display in the editor field label.
  95. * @param[in] style Optional style to use for the element. Style will be retrieved from GUISkin of the
  96. * GUIWidget the element is used on. If not specified default style is used.
  97. */
  98. GUIFieldOptions(const GUIContent& labelContent, const String& style = StringUtil::BLANK)
  99. :labelContent(labelContent), style(style)
  100. { }
  101. /**
  102. * Constructor for field options with a label.
  103. *
  104. * @param[in] labelText Text to display in the editor field label.
  105. * @param[in] labelWidth Width of the label in pixels.
  106. * @param[in] style Optional style to use for the element. Style will be retrieved from GUISkin of the
  107. * GUIWidget the element is used on. If not specified default style is used.
  108. */
  109. GUIFieldOptions(const HString& labelText, UINT32 labelWidth, const String& style = StringUtil::BLANK)
  110. :labelContent(labelText), labelWidth(labelWidth), style(style)
  111. { }
  112. /**
  113. * Constructor for field options with a label.
  114. *
  115. * @param[in] labelText Text to display in the editor field label.
  116. * @param[in] style Optional style to use for the element. Style will be retrieved from GUISkin of the
  117. * GUIWidget the element is used on. If not specified default style is used.
  118. */
  119. GUIFieldOptions(const HString& labelText, const String& style = StringUtil::BLANK)
  120. :labelContent(labelText), style(style)
  121. { }
  122. /**
  123. * Constructor for field options without a label.
  124. *
  125. * @param[in] style Optional style to use for the element. Style will be retrieved from GUISkin of the
  126. * GUIWidget the element is used on. If not specified default style is used.
  127. */
  128. GUIFieldOptions(const String& style = StringUtil::BLANK)
  129. :labelWidth(0), style(style)
  130. { }
  131. GUIContent labelContent;
  132. UINT32 labelWidth = 100;
  133. GUIOptions options;
  134. String style;
  135. };
  136. /** @} */
  137. }