GUIFloatDistributionField.generated.cs 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //************** Copyright (c) 2016-2019 Marko Pintera ([email protected]). All rights reserved. *******************//
  3. using System;
  4. using System.Runtime.CompilerServices;
  5. using System.Runtime.InteropServices;
  6. using bs;
  7. namespace bs.Editor
  8. {
  9. /** @addtogroup GUIEditor
  10. * @{
  11. */
  12. /// <summary>
  13. /// A composite GUI object representing an editor field. Editor fields are a combination of a label and an input field.
  14. /// Label is optional. This specific implementation displays an input field for a floating point distribution.
  15. /// </summary>
  16. [ShowInInspector]
  17. public partial class GUIFloatDistributionField : GUIElement
  18. {
  19. private GUIFloatDistributionField(bool __dummy0) { }
  20. protected GUIFloatDistributionField() { }
  21. /// <summary>Creates a new GUI editor field with a label.</summary>
  22. /// <param name="labelContent">Content to display in the editor field label.</param>
  23. /// <param name="labelWidth">Width of the label in pixels.</param>
  24. /// <param name="style">
  25. /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
  26. /// If not specified default style is used.
  27. /// </param>
  28. public GUIFloatDistributionField(GUIContent labelContent, int labelWidth, string style = "")
  29. {
  30. Internal_create(this, ref labelContent, labelWidth, style);
  31. }
  32. /// <summary>Creates a new GUI editor field with a label.</summary>
  33. /// <param name="labelContent">Content to display in the editor field label.</param>
  34. /// <param name="style">
  35. /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
  36. /// If not specified default style is used.
  37. /// </param>
  38. public GUIFloatDistributionField(GUIContent labelContent, string style = "")
  39. {
  40. Internal_create0(this, ref labelContent, style);
  41. }
  42. /// <summary>Creates a new GUI editor field with a label.</summary>
  43. /// <param name="labelText">String to display in the editor field label.</param>
  44. /// <param name="labelWidth">Width of the label in pixels.</param>
  45. /// <param name="style">
  46. /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
  47. /// If not specified default style is used.
  48. /// </param>
  49. public GUIFloatDistributionField(LocString labelText, int labelWidth, string style = "")
  50. {
  51. Internal_create1(this, labelText, labelWidth, style);
  52. }
  53. /// <summary>Creates a new GUI editor field with a label.</summary>
  54. /// <param name="labelText">String to display in the editor field label.</param>
  55. /// <param name="style">
  56. /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
  57. /// If not specified default style is used.
  58. /// </param>
  59. public GUIFloatDistributionField(LocString labelText, string style = "")
  60. {
  61. Internal_create2(this, labelText, style);
  62. }
  63. /// <summary>Creates a new GUI editor field without a label.</summary>
  64. /// <param name="style">
  65. /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
  66. /// If not specified default style is used.
  67. /// </param>
  68. public GUIFloatDistributionField(string style = "")
  69. {
  70. Internal_create3(this, style);
  71. }
  72. /// <summary>Changes the value of the field.</summary>
  73. [ShowInInspector]
  74. [NotNull]
  75. [PassByCopy]
  76. [NativeWrapper]
  77. public FloatDistribution Value
  78. {
  79. get { return Internal_getValue(mCachedPtr); }
  80. set { Internal_setValue(mCachedPtr, value); }
  81. }
  82. /// <summary>Returns the type of the currently selected distribution.</summary>
  83. [NativeWrapper]
  84. public PropertyDistributionType DistributionType
  85. {
  86. get { return Internal_getType(mCachedPtr); }
  87. }
  88. /// <summary>
  89. /// Checks if any of the float input fields currently have input focus. Only relevant for non-curve distributions.
  90. /// </summary>
  91. [NativeWrapper]
  92. public bool HasInputFocus
  93. {
  94. get { return Internal_hasInputFocus(mCachedPtr); }
  95. }
  96. /// <summary>
  97. /// Triggered when the user clicks on the curve display. Only relevant if the distribution is a curve distribution.
  98. /// Provides the index of the clicked curve.
  99. /// </summary>
  100. partial void OnClicked(VectorComponent p0);
  101. /// <summary>
  102. /// Triggered when the user modifies the value of the non-curve (constant) values of the distribution. Only relevant if
  103. /// the distribution is not a curve distribution.
  104. /// </summary>
  105. public event Action<RangeComponent, VectorComponent> OnConstantModified;
  106. /// <summary>
  107. /// Triggered when the user confirms inputs in the non-curve (constant) values of the distribution. Only relevant if the
  108. /// distribution is not a curve distribution.
  109. /// </summary>
  110. public event Action<RangeComponent, VectorComponent> OnConstantConfirmed;
  111. /// <summary>
  112. /// Triggered when a GUI field representing an individual component loses or gains focus. This only applies to input
  113. /// fields representing the non-curve (constant) distribution types.
  114. /// </summary>
  115. public event Action<bool, RangeComponent, VectorComponent> OnConstantFocusChanged;
  116. /// <summary>Sets input focus to a specific component&apos;s input box.</summary>
  117. /// <param name="rangeComponent">
  118. /// Whether to focus on the minimum or the maximum part of the range. Only relevant if the distribution represents a
  119. /// constant range.
  120. /// </param>
  121. /// <param name="vectorComponent">
  122. /// Vector component to focus on. Only relevant of the distribution constant is a vector type, and if the current
  123. /// distribution type is a non-curve (constant) type.
  124. /// </param>
  125. /// <param name="focus">True to enable focus, false to disable.</param>
  126. public void SetInputFocus(RangeComponent rangeComponent, VectorComponent vectorComponent, bool focus)
  127. {
  128. Internal_setInputFocus(mCachedPtr, rangeComponent, vectorComponent, focus);
  129. }
  130. [MethodImpl(MethodImplOptions.InternalCall)]
  131. private static extern FloatDistribution Internal_getValue(IntPtr thisPtr);
  132. [MethodImpl(MethodImplOptions.InternalCall)]
  133. private static extern void Internal_setValue(IntPtr thisPtr, FloatDistribution value);
  134. [MethodImpl(MethodImplOptions.InternalCall)]
  135. private static extern PropertyDistributionType Internal_getType(IntPtr thisPtr);
  136. [MethodImpl(MethodImplOptions.InternalCall)]
  137. private static extern bool Internal_hasInputFocus(IntPtr thisPtr);
  138. [MethodImpl(MethodImplOptions.InternalCall)]
  139. private static extern void Internal_setInputFocus(IntPtr thisPtr, RangeComponent rangeComponent, VectorComponent vectorComponent, bool focus);
  140. [MethodImpl(MethodImplOptions.InternalCall)]
  141. private static extern void Internal_create(GUIFloatDistributionField managedInstance, ref GUIContent labelContent, int labelWidth, string style);
  142. [MethodImpl(MethodImplOptions.InternalCall)]
  143. private static extern void Internal_create0(GUIFloatDistributionField managedInstance, ref GUIContent labelContent, string style);
  144. [MethodImpl(MethodImplOptions.InternalCall)]
  145. private static extern void Internal_create1(GUIFloatDistributionField managedInstance, LocString labelText, int labelWidth, string style);
  146. [MethodImpl(MethodImplOptions.InternalCall)]
  147. private static extern void Internal_create2(GUIFloatDistributionField managedInstance, LocString labelText, string style);
  148. [MethodImpl(MethodImplOptions.InternalCall)]
  149. private static extern void Internal_create3(GUIFloatDistributionField managedInstance, string style);
  150. private void Internal_onClicked(VectorComponent p0)
  151. {
  152. OnClicked(p0);
  153. }
  154. private void Internal_onConstantModified(RangeComponent p0, VectorComponent p1)
  155. {
  156. OnConstantModified?.Invoke(p0, p1);
  157. }
  158. private void Internal_onConstantConfirmed(RangeComponent p0, VectorComponent p1)
  159. {
  160. OnConstantConfirmed?.Invoke(p0, p1);
  161. }
  162. private void Internal_onConstantFocusChanged(bool p0, RangeComponent p1, VectorComponent p2)
  163. {
  164. OnConstantFocusChanged?.Invoke(p0, p1, p2);
  165. }
  166. }
  167. /** @} */
  168. }