class_itemlist.rst 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_ItemList:
  4. ItemList
  5. ========
  6. **Inherits:** :ref:`Control<class_control>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. Member Functions
  11. ----------------
  12. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  13. | void | :ref:`add_item<class_ItemList_add_item>` **(** :ref:`String<class_string>` text, :ref:`Texture<class_texture>` icon=NULL, :ref:`bool<class_bool>` selectable=true **)** |
  14. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | void | :ref:`add_icon_item<class_ItemList_add_icon_item>` **(** :ref:`Texture<class_texture>` icon, :ref:`bool<class_bool>` selectable=true **)** |
  16. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | void | :ref:`set_item_text<class_ItemList_set_item_text>` **(** :ref:`int<class_int>` idx, :ref:`String<class_string>` text **)** |
  18. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`String<class_string>` | :ref:`get_item_text<class_ItemList_get_item_text>` **(** :ref:`int<class_int>` idx **)** const |
  20. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | void | :ref:`set_item_icon<class_ItemList_set_item_icon>` **(** :ref:`int<class_int>` idx, :ref:`Texture<class_texture>` icon **)** |
  22. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`Texture<class_texture>` | :ref:`get_item_icon<class_ItemList_get_item_icon>` **(** :ref:`int<class_int>` idx **)** const |
  24. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`set_item_selectable<class_ItemList_set_item_selectable>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` selectable **)** |
  26. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`is_item_selectable<class_ItemList_is_item_selectable>` **(** :ref:`int<class_int>` idx **)** const |
  28. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`set_item_disabled<class_ItemList_set_item_disabled>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)** |
  30. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`bool<class_bool>` | :ref:`is_item_disabled<class_ItemList_is_item_disabled>` **(** :ref:`int<class_int>` idx **)** const |
  32. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`set_item_metadata<class_ItemList_set_item_metadata>` **(** :ref:`int<class_int>` idx, var metadata **)** |
  34. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`get_item_metadata<class_ItemList_get_item_metadata>` **(** :ref:`int<class_int>` idx **)** const |
  36. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`set_item_custom_bg_color<class_ItemList_set_item_custom_bg_color>` **(** :ref:`int<class_int>` idx, :ref:`Color<class_color>` custom_bg_color **)** |
  38. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`Color<class_color>` | :ref:`get_item_custom_bg_color<class_ItemList_get_item_custom_bg_color>` **(** :ref:`int<class_int>` idx **)** const |
  40. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`set_item_tooltip<class_ItemList_set_item_tooltip>` **(** :ref:`int<class_int>` idx, :ref:`String<class_string>` tooltip **)** |
  42. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`String<class_string>` | :ref:`get_item_tooltip<class_ItemList_get_item_tooltip>` **(** :ref:`int<class_int>` idx **)** const |
  44. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | void | :ref:`select<class_ItemList_select>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` single=true **)** |
  46. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | void | :ref:`unselect<class_ItemList_unselect>` **(** :ref:`int<class_int>` idx **)** |
  48. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`bool<class_bool>` | :ref:`is_selected<class_ItemList_is_selected>` **(** :ref:`int<class_int>` idx **)** const |
  50. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`int<class_int>` | :ref:`get_item_count<class_ItemList_get_item_count>` **(** **)** const |
  52. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | void | :ref:`remove_item<class_ItemList_remove_item>` **(** :ref:`int<class_int>` idx **)** |
  54. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | void | :ref:`clear<class_ItemList_clear>` **(** **)** |
  56. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | void | :ref:`sort_items_by_text<class_ItemList_sort_items_by_text>` **(** **)** |
  58. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | void | :ref:`set_fixed_column_width<class_ItemList_set_fixed_column_width>` **(** :ref:`int<class_int>` width **)** |
  60. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`int<class_int>` | :ref:`get_fixed_column_width<class_ItemList_get_fixed_column_width>` **(** **)** const |
  62. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | void | :ref:`set_max_text_lines<class_ItemList_set_max_text_lines>` **(** :ref:`int<class_int>` lines **)** |
  64. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`int<class_int>` | :ref:`get_max_text_lines<class_ItemList_get_max_text_lines>` **(** **)** const |
  66. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | void | :ref:`set_max_columns<class_ItemList_set_max_columns>` **(** :ref:`int<class_int>` amount **)** |
  68. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`int<class_int>` | :ref:`get_max_columns<class_ItemList_get_max_columns>` **(** **)** const |
  70. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | void | :ref:`set_select_mode<class_ItemList_set_select_mode>` **(** :ref:`int<class_int>` mode **)** |
  72. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`int<class_int>` | :ref:`get_select_mode<class_ItemList_get_select_mode>` **(** **)** const |
  74. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | void | :ref:`set_icon_mode<class_ItemList_set_icon_mode>` **(** :ref:`int<class_int>` mode **)** |
  76. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`int<class_int>` | :ref:`get_icon_mode<class_ItemList_get_icon_mode>` **(** **)** const |
  78. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | void | :ref:`set_min_icon_size<class_ItemList_set_min_icon_size>` **(** :ref:`Vector2<class_vector2>` size **)** |
  80. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`Vector2<class_vector2>` | :ref:`get_min_icon_size<class_ItemList_get_min_icon_size>` **(** **)** const |
  82. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | void | :ref:`ensure_current_is_visible<class_ItemList_ensure_current_is_visible>` **(** **)** |
  84. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. Signals
  86. -------
  87. - **item_activated** **(** :ref:`int<class_int>` index **)**
  88. - **multi_selected** **(** :ref:`int<class_int>` index, :ref:`bool<class_bool>` selected **)**
  89. - **item_selected** **(** :ref:`int<class_int>` index **)**
  90. Numeric Constants
  91. -----------------
  92. - **ICON_MODE_TOP** = **0**
  93. - **ICON_MODE_LEFT** = **1**
  94. - **SELECT_SINGLE** = **0**
  95. - **SELECT_MULTI** = **1**
  96. Member Function Description
  97. ---------------------------
  98. .. _class_ItemList_add_item:
  99. - void **add_item** **(** :ref:`String<class_string>` text, :ref:`Texture<class_texture>` icon=NULL, :ref:`bool<class_bool>` selectable=true **)**
  100. .. _class_ItemList_add_icon_item:
  101. - void **add_icon_item** **(** :ref:`Texture<class_texture>` icon, :ref:`bool<class_bool>` selectable=true **)**
  102. .. _class_ItemList_set_item_text:
  103. - void **set_item_text** **(** :ref:`int<class_int>` idx, :ref:`String<class_string>` text **)**
  104. .. _class_ItemList_get_item_text:
  105. - :ref:`String<class_string>` **get_item_text** **(** :ref:`int<class_int>` idx **)** const
  106. .. _class_ItemList_set_item_icon:
  107. - void **set_item_icon** **(** :ref:`int<class_int>` idx, :ref:`Texture<class_texture>` icon **)**
  108. .. _class_ItemList_get_item_icon:
  109. - :ref:`Texture<class_texture>` **get_item_icon** **(** :ref:`int<class_int>` idx **)** const
  110. .. _class_ItemList_set_item_selectable:
  111. - void **set_item_selectable** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` selectable **)**
  112. .. _class_ItemList_is_item_selectable:
  113. - :ref:`bool<class_bool>` **is_item_selectable** **(** :ref:`int<class_int>` idx **)** const
  114. .. _class_ItemList_set_item_disabled:
  115. - void **set_item_disabled** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)**
  116. .. _class_ItemList_is_item_disabled:
  117. - :ref:`bool<class_bool>` **is_item_disabled** **(** :ref:`int<class_int>` idx **)** const
  118. .. _class_ItemList_set_item_metadata:
  119. - void **set_item_metadata** **(** :ref:`int<class_int>` idx, var metadata **)**
  120. .. _class_ItemList_get_item_metadata:
  121. - void **get_item_metadata** **(** :ref:`int<class_int>` idx **)** const
  122. .. _class_ItemList_set_item_custom_bg_color:
  123. - void **set_item_custom_bg_color** **(** :ref:`int<class_int>` idx, :ref:`Color<class_color>` custom_bg_color **)**
  124. .. _class_ItemList_get_item_custom_bg_color:
  125. - :ref:`Color<class_color>` **get_item_custom_bg_color** **(** :ref:`int<class_int>` idx **)** const
  126. .. _class_ItemList_set_item_tooltip:
  127. - void **set_item_tooltip** **(** :ref:`int<class_int>` idx, :ref:`String<class_string>` tooltip **)**
  128. .. _class_ItemList_get_item_tooltip:
  129. - :ref:`String<class_string>` **get_item_tooltip** **(** :ref:`int<class_int>` idx **)** const
  130. .. _class_ItemList_select:
  131. - void **select** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` single=true **)**
  132. .. _class_ItemList_unselect:
  133. - void **unselect** **(** :ref:`int<class_int>` idx **)**
  134. .. _class_ItemList_is_selected:
  135. - :ref:`bool<class_bool>` **is_selected** **(** :ref:`int<class_int>` idx **)** const
  136. .. _class_ItemList_get_item_count:
  137. - :ref:`int<class_int>` **get_item_count** **(** **)** const
  138. .. _class_ItemList_remove_item:
  139. - void **remove_item** **(** :ref:`int<class_int>` idx **)**
  140. .. _class_ItemList_clear:
  141. - void **clear** **(** **)**
  142. .. _class_ItemList_sort_items_by_text:
  143. - void **sort_items_by_text** **(** **)**
  144. .. _class_ItemList_set_fixed_column_width:
  145. - void **set_fixed_column_width** **(** :ref:`int<class_int>` width **)**
  146. .. _class_ItemList_get_fixed_column_width:
  147. - :ref:`int<class_int>` **get_fixed_column_width** **(** **)** const
  148. .. _class_ItemList_set_max_text_lines:
  149. - void **set_max_text_lines** **(** :ref:`int<class_int>` lines **)**
  150. .. _class_ItemList_get_max_text_lines:
  151. - :ref:`int<class_int>` **get_max_text_lines** **(** **)** const
  152. .. _class_ItemList_set_max_columns:
  153. - void **set_max_columns** **(** :ref:`int<class_int>` amount **)**
  154. .. _class_ItemList_get_max_columns:
  155. - :ref:`int<class_int>` **get_max_columns** **(** **)** const
  156. .. _class_ItemList_set_select_mode:
  157. - void **set_select_mode** **(** :ref:`int<class_int>` mode **)**
  158. .. _class_ItemList_get_select_mode:
  159. - :ref:`int<class_int>` **get_select_mode** **(** **)** const
  160. .. _class_ItemList_set_icon_mode:
  161. - void **set_icon_mode** **(** :ref:`int<class_int>` mode **)**
  162. .. _class_ItemList_get_icon_mode:
  163. - :ref:`int<class_int>` **get_icon_mode** **(** **)** const
  164. .. _class_ItemList_set_min_icon_size:
  165. - void **set_min_icon_size** **(** :ref:`Vector2<class_vector2>` size **)**
  166. .. _class_ItemList_get_min_icon_size:
  167. - :ref:`Vector2<class_vector2>` **get_min_icon_size** **(** **)** const
  168. .. _class_ItemList_ensure_current_is_visible:
  169. - void **ensure_current_is_visible** **(** **)**