class_buttongroup.rst 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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/ButtonGroup.xml.
  6. .. _class_ButtonGroup:
  7. ButtonGroup
  8. ===========
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. A group of buttons that doesn't allow more than one button to be pressed at a time.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A group of :ref:`BaseButton<class_BaseButton>`-derived buttons. The buttons in a **ButtonGroup** are treated like radio buttons: No more than one button can be pressed at a time. Some types of buttons (such as :ref:`CheckBox<class_CheckBox>`) may have a special appearance in this state.
  15. Every member of a **ButtonGroup** should have :ref:`BaseButton.toggle_mode<class_BaseButton_property_toggle_mode>` set to ``true``.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +-------------------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------+
  22. | :ref:`bool<class_bool>` | :ref:`allow_unpress<class_ButtonGroup_property_allow_unpress>` | ``false`` |
  23. +-------------------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | resource_local_to_scene | ``true`` (overrides :ref:`Resource<class_Resource_property_resource_local_to_scene>`) |
  25. +-------------------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------+
  26. .. rst-class:: classref-reftable-group
  27. Methods
  28. -------
  29. .. table::
  30. :widths: auto
  31. +------------------------------------------------------------------+------------------------------------------------------------------------------+
  32. | :ref:`Array<class_Array>`\[:ref:`BaseButton<class_BaseButton>`\] | :ref:`get_buttons<class_ButtonGroup_method_get_buttons>`\ (\ ) |
  33. +------------------------------------------------------------------+------------------------------------------------------------------------------+
  34. | :ref:`BaseButton<class_BaseButton>` | :ref:`get_pressed_button<class_ButtonGroup_method_get_pressed_button>`\ (\ ) |
  35. +------------------------------------------------------------------+------------------------------------------------------------------------------+
  36. .. rst-class:: classref-section-separator
  37. ----
  38. .. rst-class:: classref-descriptions-group
  39. Signals
  40. -------
  41. .. _class_ButtonGroup_signal_pressed:
  42. .. rst-class:: classref-signal
  43. **pressed**\ (\ button\: :ref:`BaseButton<class_BaseButton>`\ ) :ref:`🔗<class_ButtonGroup_signal_pressed>`
  44. Emitted when one of the buttons of the group is pressed.
  45. .. rst-class:: classref-section-separator
  46. ----
  47. .. rst-class:: classref-descriptions-group
  48. Property Descriptions
  49. ---------------------
  50. .. _class_ButtonGroup_property_allow_unpress:
  51. .. rst-class:: classref-property
  52. :ref:`bool<class_bool>` **allow_unpress** = ``false`` :ref:`🔗<class_ButtonGroup_property_allow_unpress>`
  53. .. rst-class:: classref-property-setget
  54. - |void| **set_allow_unpress**\ (\ value\: :ref:`bool<class_bool>`\ )
  55. - :ref:`bool<class_bool>` **is_allow_unpress**\ (\ )
  56. If ``true``, it is possible to unpress all buttons in this **ButtonGroup**.
  57. .. rst-class:: classref-section-separator
  58. ----
  59. .. rst-class:: classref-descriptions-group
  60. Method Descriptions
  61. -------------------
  62. .. _class_ButtonGroup_method_get_buttons:
  63. .. rst-class:: classref-method
  64. :ref:`Array<class_Array>`\[:ref:`BaseButton<class_BaseButton>`\] **get_buttons**\ (\ ) :ref:`🔗<class_ButtonGroup_method_get_buttons>`
  65. Returns an :ref:`Array<class_Array>` of :ref:`Button<class_Button>`\ s who have this as their **ButtonGroup** (see :ref:`BaseButton.button_group<class_BaseButton_property_button_group>`).
  66. .. rst-class:: classref-item-separator
  67. ----
  68. .. _class_ButtonGroup_method_get_pressed_button:
  69. .. rst-class:: classref-method
  70. :ref:`BaseButton<class_BaseButton>` **get_pressed_button**\ (\ ) :ref:`🔗<class_ButtonGroup_method_get_pressed_button>`
  71. Returns the current pressed button.
  72. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  73. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  74. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  75. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  76. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  77. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  78. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  79. .. |void| replace:: :abbr:`void (No return value.)`