class_container.rst 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Container.xml.
  6. .. _class_Container:
  7. Container
  8. =========
  9. **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`AspectRatioContainer<class_AspectRatioContainer>`, :ref:`BoxContainer<class_BoxContainer>`, :ref:`CenterContainer<class_CenterContainer>`, :ref:`EditorProperty<class_EditorProperty>`, :ref:`FlowContainer<class_FlowContainer>`, :ref:`GraphElement<class_GraphElement>`, :ref:`GridContainer<class_GridContainer>`, :ref:`MarginContainer<class_MarginContainer>`, :ref:`PanelContainer<class_PanelContainer>`, :ref:`ScrollContainer<class_ScrollContainer>`, :ref:`SplitContainer<class_SplitContainer>`, :ref:`SubViewportContainer<class_SubViewportContainer>`, :ref:`TabContainer<class_TabContainer>`
  11. Base class for all GUI containers.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Base class for all GUI containers. A **Container** automatically arranges its child controls in a certain way. This class can be inherited to make custom container types.
  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:`MouseFilter<enum_Control_MouseFilter>` | mouse_filter | ``1`` (overrides :ref:`Control<class_Control_property_mouse_filter>`) |
  27. +----------------------------------------------+--------------+-----------------------------------------------------------------------+
  28. .. rst-class:: classref-reftable-group
  29. Methods
  30. -------
  31. .. table::
  32. :widths: auto
  33. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`_get_allowed_size_flags_horizontal<class_Container_private_method__get_allowed_size_flags_horizontal>`\ (\ ) |virtual| |const| |
  35. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`_get_allowed_size_flags_vertical<class_Container_private_method__get_allowed_size_flags_vertical>`\ (\ ) |virtual| |const| |
  37. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | |void| | :ref:`fit_child_in_rect<class_Container_method_fit_child_in_rect>`\ (\ child\: :ref:`Control<class_Control>`, rect\: :ref:`Rect2<class_Rect2>`\ ) |
  39. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | |void| | :ref:`queue_sort<class_Container_method_queue_sort>`\ (\ ) |
  41. +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  42. .. rst-class:: classref-section-separator
  43. ----
  44. .. rst-class:: classref-descriptions-group
  45. Signals
  46. -------
  47. .. _class_Container_signal_pre_sort_children:
  48. .. rst-class:: classref-signal
  49. **pre_sort_children**\ (\ ) :ref:`🔗<class_Container_signal_pre_sort_children>`
  50. Emitted when children are going to be sorted.
  51. .. rst-class:: classref-item-separator
  52. ----
  53. .. _class_Container_signal_sort_children:
  54. .. rst-class:: classref-signal
  55. **sort_children**\ (\ ) :ref:`🔗<class_Container_signal_sort_children>`
  56. Emitted when sorting the children is needed.
  57. .. rst-class:: classref-section-separator
  58. ----
  59. .. rst-class:: classref-descriptions-group
  60. Constants
  61. ---------
  62. .. _class_Container_constant_NOTIFICATION_PRE_SORT_CHILDREN:
  63. .. rst-class:: classref-constant
  64. **NOTIFICATION_PRE_SORT_CHILDREN** = ``50`` :ref:`🔗<class_Container_constant_NOTIFICATION_PRE_SORT_CHILDREN>`
  65. Notification just before children are going to be sorted, in case there's something to process beforehand.
  66. .. _class_Container_constant_NOTIFICATION_SORT_CHILDREN:
  67. .. rst-class:: classref-constant
  68. **NOTIFICATION_SORT_CHILDREN** = ``51`` :ref:`🔗<class_Container_constant_NOTIFICATION_SORT_CHILDREN>`
  69. Notification for when sorting the children, it must be obeyed immediately.
  70. .. rst-class:: classref-section-separator
  71. ----
  72. .. rst-class:: classref-descriptions-group
  73. Method Descriptions
  74. -------------------
  75. .. _class_Container_private_method__get_allowed_size_flags_horizontal:
  76. .. rst-class:: classref-method
  77. :ref:`PackedInt32Array<class_PackedInt32Array>` **_get_allowed_size_flags_horizontal**\ (\ ) |virtual| |const| :ref:`🔗<class_Container_private_method__get_allowed_size_flags_horizontal>`
  78. Implement to return a list of allowed horizontal :ref:`SizeFlags<enum_Control_SizeFlags>` for child nodes. This doesn't technically prevent the usages of any other size flags, if your implementation requires that. This only limits the options available to the user in the Inspector dock.
  79. \ **Note:** Having no size flags is equal to having :ref:`Control.SIZE_SHRINK_BEGIN<class_Control_constant_SIZE_SHRINK_BEGIN>`. As such, this value is always implicitly allowed.
  80. .. rst-class:: classref-item-separator
  81. ----
  82. .. _class_Container_private_method__get_allowed_size_flags_vertical:
  83. .. rst-class:: classref-method
  84. :ref:`PackedInt32Array<class_PackedInt32Array>` **_get_allowed_size_flags_vertical**\ (\ ) |virtual| |const| :ref:`🔗<class_Container_private_method__get_allowed_size_flags_vertical>`
  85. Implement to return a list of allowed vertical :ref:`SizeFlags<enum_Control_SizeFlags>` for child nodes. This doesn't technically prevent the usages of any other size flags, if your implementation requires that. This only limits the options available to the user in the Inspector dock.
  86. \ **Note:** Having no size flags is equal to having :ref:`Control.SIZE_SHRINK_BEGIN<class_Control_constant_SIZE_SHRINK_BEGIN>`. As such, this value is always implicitly allowed.
  87. .. rst-class:: classref-item-separator
  88. ----
  89. .. _class_Container_method_fit_child_in_rect:
  90. .. rst-class:: classref-method
  91. |void| **fit_child_in_rect**\ (\ child\: :ref:`Control<class_Control>`, rect\: :ref:`Rect2<class_Rect2>`\ ) :ref:`🔗<class_Container_method_fit_child_in_rect>`
  92. Fit a child control in a given rect. This is mainly a helper for creating custom container classes.
  93. .. rst-class:: classref-item-separator
  94. ----
  95. .. _class_Container_method_queue_sort:
  96. .. rst-class:: classref-method
  97. |void| **queue_sort**\ (\ ) :ref:`🔗<class_Container_method_queue_sort>`
  98. Queue resort of the contained children. This is called automatically anyway, but can be called upon request.
  99. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  100. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  101. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  102. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  103. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  104. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  105. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  106. .. |void| replace:: :abbr:`void (No return value.)`