class_splitcontainer.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/SplitContainer.xml.
  6. .. _class_SplitContainer:
  7. SplitContainer
  8. ==============
  9. **Inherits:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`HSplitContainer<class_HSplitContainer>`, :ref:`VSplitContainer<class_VSplitContainer>`
  11. A container that splits two child controls horizontally or vertically and provides a grabber for adjusting the split ratio.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. A container that accepts only two child controls, then arranges them horizontally or vertically and creates a divisor between them. The divisor can be dragged around to change the size relation between the child controls.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - :doc:`Using Containers <../tutorials/ui/gui_containers>`
  20. .. rst-class:: classref-reftable-group
  21. Properties
  22. ----------
  23. .. table::
  24. :widths: auto
  25. +-----------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
  26. | :ref:`bool<class_bool>` | :ref:`collapsed<class_SplitContainer_property_collapsed>` | ``false`` |
  27. +-----------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
  28. | :ref:`DraggerVisibility<enum_SplitContainer_DraggerVisibility>` | :ref:`dragger_visibility<class_SplitContainer_property_dragger_visibility>` | ``0`` |
  29. +-----------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
  30. | :ref:`int<class_int>` | :ref:`split_offset<class_SplitContainer_property_split_offset>` | ``0`` |
  31. +-----------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
  32. | :ref:`bool<class_bool>` | :ref:`vertical<class_SplitContainer_property_vertical>` | ``false`` |
  33. +-----------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
  34. .. rst-class:: classref-reftable-group
  35. Methods
  36. -------
  37. .. table::
  38. :widths: auto
  39. +------+---------------------------------------------------------------------------------------+
  40. | void | :ref:`clamp_split_offset<class_SplitContainer_method_clamp_split_offset>` **(** **)** |
  41. +------+---------------------------------------------------------------------------------------+
  42. .. rst-class:: classref-reftable-group
  43. Theme Properties
  44. ----------------
  45. .. table::
  46. :widths: auto
  47. +-----------------------------------+-------------------------------------------------------------------------------------------+--------+
  48. | :ref:`int<class_int>` | :ref:`autohide<class_SplitContainer_theme_constant_autohide>` | ``1`` |
  49. +-----------------------------------+-------------------------------------------------------------------------------------------+--------+
  50. | :ref:`int<class_int>` | :ref:`minimum_grab_thickness<class_SplitContainer_theme_constant_minimum_grab_thickness>` | ``6`` |
  51. +-----------------------------------+-------------------------------------------------------------------------------------------+--------+
  52. | :ref:`int<class_int>` | :ref:`separation<class_SplitContainer_theme_constant_separation>` | ``12`` |
  53. +-----------------------------------+-------------------------------------------------------------------------------------------+--------+
  54. | :ref:`Texture2D<class_Texture2D>` | :ref:`grabber<class_SplitContainer_theme_icon_grabber>` | |
  55. +-----------------------------------+-------------------------------------------------------------------------------------------+--------+
  56. | :ref:`Texture2D<class_Texture2D>` | :ref:`h_grabber<class_SplitContainer_theme_icon_h_grabber>` | |
  57. +-----------------------------------+-------------------------------------------------------------------------------------------+--------+
  58. | :ref:`Texture2D<class_Texture2D>` | :ref:`v_grabber<class_SplitContainer_theme_icon_v_grabber>` | |
  59. +-----------------------------------+-------------------------------------------------------------------------------------------+--------+
  60. .. rst-class:: classref-section-separator
  61. ----
  62. .. rst-class:: classref-descriptions-group
  63. Signals
  64. -------
  65. .. _class_SplitContainer_signal_dragged:
  66. .. rst-class:: classref-signal
  67. **dragged** **(** :ref:`int<class_int>` offset **)**
  68. Emitted when the dragger is dragged by user.
  69. .. rst-class:: classref-section-separator
  70. ----
  71. .. rst-class:: classref-descriptions-group
  72. Enumerations
  73. ------------
  74. .. _enum_SplitContainer_DraggerVisibility:
  75. .. rst-class:: classref-enumeration
  76. enum **DraggerVisibility**:
  77. .. _class_SplitContainer_constant_DRAGGER_VISIBLE:
  78. .. rst-class:: classref-enumeration-constant
  79. :ref:`DraggerVisibility<enum_SplitContainer_DraggerVisibility>` **DRAGGER_VISIBLE** = ``0``
  80. The split dragger is visible when the cursor hovers it.
  81. .. _class_SplitContainer_constant_DRAGGER_HIDDEN:
  82. .. rst-class:: classref-enumeration-constant
  83. :ref:`DraggerVisibility<enum_SplitContainer_DraggerVisibility>` **DRAGGER_HIDDEN** = ``1``
  84. The split dragger is never visible.
  85. .. _class_SplitContainer_constant_DRAGGER_HIDDEN_COLLAPSED:
  86. .. rst-class:: classref-enumeration-constant
  87. :ref:`DraggerVisibility<enum_SplitContainer_DraggerVisibility>` **DRAGGER_HIDDEN_COLLAPSED** = ``2``
  88. The split dragger is never visible and its space collapsed.
  89. .. rst-class:: classref-section-separator
  90. ----
  91. .. rst-class:: classref-descriptions-group
  92. Property Descriptions
  93. ---------------------
  94. .. _class_SplitContainer_property_collapsed:
  95. .. rst-class:: classref-property
  96. :ref:`bool<class_bool>` **collapsed** = ``false``
  97. .. rst-class:: classref-property-setget
  98. - void **set_collapsed** **(** :ref:`bool<class_bool>` value **)**
  99. - :ref:`bool<class_bool>` **is_collapsed** **(** **)**
  100. If ``true``, the area of the first :ref:`Control<class_Control>` will be collapsed and the dragger will be disabled.
  101. .. rst-class:: classref-item-separator
  102. ----
  103. .. _class_SplitContainer_property_dragger_visibility:
  104. .. rst-class:: classref-property
  105. :ref:`DraggerVisibility<enum_SplitContainer_DraggerVisibility>` **dragger_visibility** = ``0``
  106. .. rst-class:: classref-property-setget
  107. - void **set_dragger_visibility** **(** :ref:`DraggerVisibility<enum_SplitContainer_DraggerVisibility>` value **)**
  108. - :ref:`DraggerVisibility<enum_SplitContainer_DraggerVisibility>` **get_dragger_visibility** **(** **)**
  109. Determines the dragger's visibility. See :ref:`DraggerVisibility<enum_SplitContainer_DraggerVisibility>` for details.
  110. .. rst-class:: classref-item-separator
  111. ----
  112. .. _class_SplitContainer_property_split_offset:
  113. .. rst-class:: classref-property
  114. :ref:`int<class_int>` **split_offset** = ``0``
  115. .. rst-class:: classref-property-setget
  116. - void **set_split_offset** **(** :ref:`int<class_int>` value **)**
  117. - :ref:`int<class_int>` **get_split_offset** **(** **)**
  118. The initial offset of the splitting between the two :ref:`Control<class_Control>`\ s, with ``0`` being at the end of the first :ref:`Control<class_Control>`.
  119. .. rst-class:: classref-item-separator
  120. ----
  121. .. _class_SplitContainer_property_vertical:
  122. .. rst-class:: classref-property
  123. :ref:`bool<class_bool>` **vertical** = ``false``
  124. .. rst-class:: classref-property-setget
  125. - void **set_vertical** **(** :ref:`bool<class_bool>` value **)**
  126. - :ref:`bool<class_bool>` **is_vertical** **(** **)**
  127. If ``true``, the **SplitContainer** will arrange its children vertically, rather than horizontally.
  128. Can't be changed when using :ref:`HSplitContainer<class_HSplitContainer>` and :ref:`VSplitContainer<class_VSplitContainer>`.
  129. .. rst-class:: classref-section-separator
  130. ----
  131. .. rst-class:: classref-descriptions-group
  132. Method Descriptions
  133. -------------------
  134. .. _class_SplitContainer_method_clamp_split_offset:
  135. .. rst-class:: classref-method
  136. void **clamp_split_offset** **(** **)**
  137. Clamps the :ref:`split_offset<class_SplitContainer_property_split_offset>` value to not go outside the currently possible minimal and maximum values.
  138. .. rst-class:: classref-section-separator
  139. ----
  140. .. rst-class:: classref-descriptions-group
  141. Theme Property Descriptions
  142. ---------------------------
  143. .. _class_SplitContainer_theme_constant_autohide:
  144. .. rst-class:: classref-themeproperty
  145. :ref:`int<class_int>` **autohide** = ``1``
  146. Boolean value. If 1 (``true``), the grabber will hide automatically when it isn't under the cursor. If 0 (``false``), it's always visible.
  147. .. rst-class:: classref-item-separator
  148. ----
  149. .. _class_SplitContainer_theme_constant_minimum_grab_thickness:
  150. .. rst-class:: classref-themeproperty
  151. :ref:`int<class_int>` **minimum_grab_thickness** = ``6``
  152. The minimum thickness of the area users can click on to grab the splitting line. If :ref:`separation<class_SplitContainer_theme_constant_separation>` or :ref:`h_grabber<class_SplitContainer_theme_icon_h_grabber>` / :ref:`v_grabber<class_SplitContainer_theme_icon_v_grabber>`'s thickness are too small, this ensure that the splitting line can still be dragged.
  153. .. rst-class:: classref-item-separator
  154. ----
  155. .. _class_SplitContainer_theme_constant_separation:
  156. .. rst-class:: classref-themeproperty
  157. :ref:`int<class_int>` **separation** = ``12``
  158. The space between sides of the container.
  159. .. rst-class:: classref-item-separator
  160. ----
  161. .. _class_SplitContainer_theme_icon_grabber:
  162. .. rst-class:: classref-themeproperty
  163. :ref:`Texture2D<class_Texture2D>` **grabber**
  164. The icon used for the grabber drawn in the middle area.
  165. .. rst-class:: classref-item-separator
  166. ----
  167. .. _class_SplitContainer_theme_icon_h_grabber:
  168. .. rst-class:: classref-themeproperty
  169. :ref:`Texture2D<class_Texture2D>` **h_grabber**
  170. The icon used for the grabber drawn in the middle area when :ref:`vertical<class_SplitContainer_property_vertical>` is ``false``.
  171. .. rst-class:: classref-item-separator
  172. ----
  173. .. _class_SplitContainer_theme_icon_v_grabber:
  174. .. rst-class:: classref-themeproperty
  175. :ref:`Texture2D<class_Texture2D>` **v_grabber**
  176. The icon used for the grabber drawn in the middle area when :ref:`vertical<class_SplitContainer_property_vertical>` is ``true``.
  177. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  178. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  179. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  180. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  181. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  182. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  183. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`