GUIVector4Field.generated.cs 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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 a Vector4 input field.
  15. /// </summary>
  16. [ShowInInspector]
  17. public partial class GUIVector4Field : GUIElement
  18. {
  19. private GUIVector4Field(bool __dummy0) { }
  20. protected GUIVector4Field() { }
  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 GUIVector4Field(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 GUIVector4Field(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 GUIVector4Field(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 GUIVector4Field(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 GUIVector4Field(string style = "")
  69. {
  70. Internal_create3(this, style);
  71. }
  72. /// <summary>Sets a new value in the input field.</summary>
  73. [ShowInInspector]
  74. [NativeWrapper]
  75. public Vector4 Value
  76. {
  77. get
  78. {
  79. Vector4 temp;
  80. Internal_getValue(mCachedPtr, out temp);
  81. return temp;
  82. }
  83. set { Internal_setValue(mCachedPtr, ref value); }
  84. }
  85. /// <summary>Checks is the input field currently active.</summary>
  86. [NativeWrapper]
  87. public bool HasInputFocus
  88. {
  89. get { return Internal_hasInputFocus(mCachedPtr); }
  90. }
  91. /// <summary>
  92. /// Reports the new value of the vector when the user changes the value of any of the vector components.
  93. /// </summary>
  94. public event Action<Vector4> OnValueChanged;
  95. /// <summary>Reports the new value of an individual vector component when the user changes it.</summary>
  96. public event Action<float, VectorComponent> OnComponentChanged;
  97. /// <summary>Triggered when an individual component loses or gains focus.</summary>
  98. public event Action<bool, VectorComponent> OnComponentFocusChanged;
  99. /// <summary>Triggered when the user hits the Enter key with any of the component input boxes in focus.</summary>
  100. public event Action<VectorComponent> OnConfirm;
  101. /// <summary>Sets input focus to a specific component&apos;s input box.</summary>
  102. public void SetInputFocus(VectorComponent component, bool focus)
  103. {
  104. Internal_setInputFocus(mCachedPtr, component, focus);
  105. }
  106. [MethodImpl(MethodImplOptions.InternalCall)]
  107. private static extern void Internal_getValue(IntPtr thisPtr, out Vector4 __output);
  108. [MethodImpl(MethodImplOptions.InternalCall)]
  109. private static extern void Internal_setValue(IntPtr thisPtr, ref Vector4 value);
  110. [MethodImpl(MethodImplOptions.InternalCall)]
  111. private static extern bool Internal_hasInputFocus(IntPtr thisPtr);
  112. [MethodImpl(MethodImplOptions.InternalCall)]
  113. private static extern void Internal_setInputFocus(IntPtr thisPtr, VectorComponent component, bool focus);
  114. [MethodImpl(MethodImplOptions.InternalCall)]
  115. private static extern void Internal_create(GUIVector4Field managedInstance, ref GUIContent labelContent, int labelWidth, string style);
  116. [MethodImpl(MethodImplOptions.InternalCall)]
  117. private static extern void Internal_create0(GUIVector4Field managedInstance, ref GUIContent labelContent, string style);
  118. [MethodImpl(MethodImplOptions.InternalCall)]
  119. private static extern void Internal_create1(GUIVector4Field managedInstance, LocString labelText, int labelWidth, string style);
  120. [MethodImpl(MethodImplOptions.InternalCall)]
  121. private static extern void Internal_create2(GUIVector4Field managedInstance, LocString labelText, string style);
  122. [MethodImpl(MethodImplOptions.InternalCall)]
  123. private static extern void Internal_create3(GUIVector4Field managedInstance, string style);
  124. private void Internal_onValueChanged(ref Vector4 p0)
  125. {
  126. OnValueChanged?.Invoke(p0);
  127. }
  128. private void Internal_onComponentChanged(float p0, VectorComponent p1)
  129. {
  130. OnComponentChanged?.Invoke(p0, p1);
  131. }
  132. private void Internal_onComponentFocusChanged(bool p0, VectorComponent p1)
  133. {
  134. OnComponentFocusChanged?.Invoke(p0, p1);
  135. }
  136. private void Internal_onConfirm(VectorComponent p0)
  137. {
  138. OnConfirm?.Invoke(p0);
  139. }
  140. }
  141. /** @} */
  142. }