class_buttongroup.rst 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. :github_url: hide
  2. .. meta::
  3. :keywords: radio
  4. .. DO NOT EDIT THIS FILE!!!
  5. .. Generated automatically from Godot engine sources.
  6. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  7. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/ButtonGroup.xml.
  8. .. _class_ButtonGroup:
  9. ButtonGroup
  10. ===========
  11. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  12. A group of buttons that doesn't allow more than one button to be pressed at a time.
  13. .. rst-class:: classref-introduction-group
  14. Description
  15. -----------
  16. 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.
  17. Every member of a **ButtonGroup** should have :ref:`BaseButton.toggle_mode<class_BaseButton_property_toggle_mode>` set to ``true``.
  18. .. rst-class:: classref-reftable-group
  19. Properties
  20. ----------
  21. .. table::
  22. :widths: auto
  23. +-------------------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`allow_unpress<class_ButtonGroup_property_allow_unpress>` | ``false`` |
  25. +-------------------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------+
  26. | :ref:`bool<class_bool>` | resource_local_to_scene | ``true`` (overrides :ref:`Resource<class_Resource_property_resource_local_to_scene>`) |
  27. +-------------------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------+
  28. .. rst-class:: classref-reftable-group
  29. Methods
  30. -------
  31. .. table::
  32. :widths: auto
  33. +------------------------------------------------------------------+------------------------------------------------------------------------------+
  34. | :ref:`Array<class_Array>`\[:ref:`BaseButton<class_BaseButton>`\] | :ref:`get_buttons<class_ButtonGroup_method_get_buttons>`\ (\ ) |
  35. +------------------------------------------------------------------+------------------------------------------------------------------------------+
  36. | :ref:`BaseButton<class_BaseButton>` | :ref:`get_pressed_button<class_ButtonGroup_method_get_pressed_button>`\ (\ ) |
  37. +------------------------------------------------------------------+------------------------------------------------------------------------------+
  38. .. rst-class:: classref-section-separator
  39. ----
  40. .. rst-class:: classref-descriptions-group
  41. Signals
  42. -------
  43. .. _class_ButtonGroup_signal_pressed:
  44. .. rst-class:: classref-signal
  45. **pressed**\ (\ button\: :ref:`BaseButton<class_BaseButton>`\ ) :ref:`🔗<class_ButtonGroup_signal_pressed>`
  46. Emitted when one of the buttons of the group is pressed.
  47. .. rst-class:: classref-section-separator
  48. ----
  49. .. rst-class:: classref-descriptions-group
  50. Property Descriptions
  51. ---------------------
  52. .. _class_ButtonGroup_property_allow_unpress:
  53. .. rst-class:: classref-property
  54. :ref:`bool<class_bool>` **allow_unpress** = ``false`` :ref:`🔗<class_ButtonGroup_property_allow_unpress>`
  55. .. rst-class:: classref-property-setget
  56. - |void| **set_allow_unpress**\ (\ value\: :ref:`bool<class_bool>`\ )
  57. - :ref:`bool<class_bool>` **is_allow_unpress**\ (\ )
  58. If ``true``, it is possible to unpress all buttons in this **ButtonGroup**.
  59. .. rst-class:: classref-section-separator
  60. ----
  61. .. rst-class:: classref-descriptions-group
  62. Method Descriptions
  63. -------------------
  64. .. _class_ButtonGroup_method_get_buttons:
  65. .. rst-class:: classref-method
  66. :ref:`Array<class_Array>`\[:ref:`BaseButton<class_BaseButton>`\] **get_buttons**\ (\ ) :ref:`🔗<class_ButtonGroup_method_get_buttons>`
  67. 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>`).
  68. .. rst-class:: classref-item-separator
  69. ----
  70. .. _class_ButtonGroup_method_get_pressed_button:
  71. .. rst-class:: classref-method
  72. :ref:`BaseButton<class_BaseButton>` **get_pressed_button**\ (\ ) :ref:`🔗<class_ButtonGroup_method_get_pressed_button>`
  73. Returns the current pressed button.
  74. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  75. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  76. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  77. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  78. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  79. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  80. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  81. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  82. .. |void| replace:: :abbr:`void (No return value.)`