class_checkbutton.rst 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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/CheckButton.xml.
  6. .. _class_CheckButton:
  7. CheckButton
  8. ===========
  9. **Inherits:** :ref:`Button<class_Button>` **<** :ref:`BaseButton<class_BaseButton>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A button that represents a binary choice.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **CheckButton** is a toggle button displayed as a check field. It's similar to :ref:`CheckBox<class_CheckBox>` in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use **CheckButton** when toggling it has an **immediate** effect on something. For example, it can be used when pressing it shows or hides advanced settings, without asking the user to confirm this action.
  15. See also :ref:`BaseButton<class_BaseButton>` which contains common properties and methods associated with this node.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +-------------------------------------------------------------------+-------------+-------------------------------------------------------------------------------+
  22. | :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` | alignment | ``0`` (overrides :ref:`Button<class_Button_property_alignment>`) |
  23. +-------------------------------------------------------------------+-------------+-------------------------------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | toggle_mode | ``true`` (overrides :ref:`BaseButton<class_BaseButton_property_toggle_mode>`) |
  25. +-------------------------------------------------------------------+-------------+-------------------------------------------------------------------------------+
  26. .. rst-class:: classref-reftable-group
  27. Theme Properties
  28. ----------------
  29. .. table::
  30. :widths: auto
  31. +-----------------------------------+----------------------------------------------------------------------------------------------+-------+
  32. | :ref:`int<class_int>` | :ref:`check_v_offset<class_CheckButton_theme_constant_check_v_offset>` | ``0`` |
  33. +-----------------------------------+----------------------------------------------------------------------------------------------+-------+
  34. | :ref:`Texture2D<class_Texture2D>` | :ref:`checked<class_CheckButton_theme_icon_checked>` | |
  35. +-----------------------------------+----------------------------------------------------------------------------------------------+-------+
  36. | :ref:`Texture2D<class_Texture2D>` | :ref:`checked_disabled<class_CheckButton_theme_icon_checked_disabled>` | |
  37. +-----------------------------------+----------------------------------------------------------------------------------------------+-------+
  38. | :ref:`Texture2D<class_Texture2D>` | :ref:`checked_disabled_mirrored<class_CheckButton_theme_icon_checked_disabled_mirrored>` | |
  39. +-----------------------------------+----------------------------------------------------------------------------------------------+-------+
  40. | :ref:`Texture2D<class_Texture2D>` | :ref:`checked_mirrored<class_CheckButton_theme_icon_checked_mirrored>` | |
  41. +-----------------------------------+----------------------------------------------------------------------------------------------+-------+
  42. | :ref:`Texture2D<class_Texture2D>` | :ref:`unchecked<class_CheckButton_theme_icon_unchecked>` | |
  43. +-----------------------------------+----------------------------------------------------------------------------------------------+-------+
  44. | :ref:`Texture2D<class_Texture2D>` | :ref:`unchecked_disabled<class_CheckButton_theme_icon_unchecked_disabled>` | |
  45. +-----------------------------------+----------------------------------------------------------------------------------------------+-------+
  46. | :ref:`Texture2D<class_Texture2D>` | :ref:`unchecked_disabled_mirrored<class_CheckButton_theme_icon_unchecked_disabled_mirrored>` | |
  47. +-----------------------------------+----------------------------------------------------------------------------------------------+-------+
  48. | :ref:`Texture2D<class_Texture2D>` | :ref:`unchecked_mirrored<class_CheckButton_theme_icon_unchecked_mirrored>` | |
  49. +-----------------------------------+----------------------------------------------------------------------------------------------+-------+
  50. .. rst-class:: classref-section-separator
  51. ----
  52. .. rst-class:: classref-descriptions-group
  53. Theme Property Descriptions
  54. ---------------------------
  55. .. _class_CheckButton_theme_constant_check_v_offset:
  56. .. rst-class:: classref-themeproperty
  57. :ref:`int<class_int>` **check_v_offset** = ``0`` :ref:`🔗<class_CheckButton_theme_constant_check_v_offset>`
  58. The vertical offset used when rendering the toggle icons (in pixels).
  59. .. rst-class:: classref-item-separator
  60. ----
  61. .. _class_CheckButton_theme_icon_checked:
  62. .. rst-class:: classref-themeproperty
  63. :ref:`Texture2D<class_Texture2D>` **checked** :ref:`🔗<class_CheckButton_theme_icon_checked>`
  64. The icon to display when the **CheckButton** is checked (for left-to-right layouts).
  65. .. rst-class:: classref-item-separator
  66. ----
  67. .. _class_CheckButton_theme_icon_checked_disabled:
  68. .. rst-class:: classref-themeproperty
  69. :ref:`Texture2D<class_Texture2D>` **checked_disabled** :ref:`🔗<class_CheckButton_theme_icon_checked_disabled>`
  70. The icon to display when the **CheckButton** is checked and disabled (for left-to-right layouts).
  71. .. rst-class:: classref-item-separator
  72. ----
  73. .. _class_CheckButton_theme_icon_checked_disabled_mirrored:
  74. .. rst-class:: classref-themeproperty
  75. :ref:`Texture2D<class_Texture2D>` **checked_disabled_mirrored** :ref:`🔗<class_CheckButton_theme_icon_checked_disabled_mirrored>`
  76. The icon to display when the **CheckButton** is checked and disabled (for right-to-left layouts).
  77. .. rst-class:: classref-item-separator
  78. ----
  79. .. _class_CheckButton_theme_icon_checked_mirrored:
  80. .. rst-class:: classref-themeproperty
  81. :ref:`Texture2D<class_Texture2D>` **checked_mirrored** :ref:`🔗<class_CheckButton_theme_icon_checked_mirrored>`
  82. The icon to display when the **CheckButton** is checked (for right-to-left layouts).
  83. .. rst-class:: classref-item-separator
  84. ----
  85. .. _class_CheckButton_theme_icon_unchecked:
  86. .. rst-class:: classref-themeproperty
  87. :ref:`Texture2D<class_Texture2D>` **unchecked** :ref:`🔗<class_CheckButton_theme_icon_unchecked>`
  88. The icon to display when the **CheckButton** is unchecked (for left-to-right layouts).
  89. .. rst-class:: classref-item-separator
  90. ----
  91. .. _class_CheckButton_theme_icon_unchecked_disabled:
  92. .. rst-class:: classref-themeproperty
  93. :ref:`Texture2D<class_Texture2D>` **unchecked_disabled** :ref:`🔗<class_CheckButton_theme_icon_unchecked_disabled>`
  94. The icon to display when the **CheckButton** is unchecked and disabled (for left-to-right layouts).
  95. .. rst-class:: classref-item-separator
  96. ----
  97. .. _class_CheckButton_theme_icon_unchecked_disabled_mirrored:
  98. .. rst-class:: classref-themeproperty
  99. :ref:`Texture2D<class_Texture2D>` **unchecked_disabled_mirrored** :ref:`🔗<class_CheckButton_theme_icon_unchecked_disabled_mirrored>`
  100. The icon to display when the **CheckButton** is unchecked and disabled (for right-to-left layouts).
  101. .. rst-class:: classref-item-separator
  102. ----
  103. .. _class_CheckButton_theme_icon_unchecked_mirrored:
  104. .. rst-class:: classref-themeproperty
  105. :ref:`Texture2D<class_Texture2D>` **unchecked_mirrored** :ref:`🔗<class_CheckButton_theme_icon_unchecked_mirrored>`
  106. The icon to display when the **CheckButton** is unchecked (for right-to-left layouts).
  107. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  108. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  109. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  110. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  111. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  112. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  113. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  114. .. |void| replace:: :abbr:`void (No return value.)`