class_itemlist.rst 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211
  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/3.5/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/ItemList.xml.
  6. .. _class_ItemList:
  7. ItemList
  8. ========
  9. **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Control that provides a list of selectable items (and/or icons) in a single column, or optionally in multiple columns.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This control provides a selectable list of items that may be in a single (or multiple columns) with option of text, icons, or both text and icon. Tooltips are supported and may be different for every item in the list.
  15. Selectable items in the list may be selected or deselected and multiple selection may be enabled. Selection with right mouse button may also be enabled to allow use of popup context menus. Items may also be "activated" by double-clicking them or by pressing Enter.
  16. Item text only supports single-line strings, newline characters (e.g. ``\n``) in the string won't produce a newline. Text wrapping is enabled in :ref:`ICON_MODE_TOP<class_ItemList_constant_ICON_MODE_TOP>` mode, but column's width is adjusted to fully fit its content by default. You need to set :ref:`fixed_column_width<class_ItemList_property_fixed_column_width>` greater than zero to wrap the text.
  17. \ **Incremental search:** Like :ref:`PopupMenu<class_PopupMenu>` and :ref:`Tree<class_Tree>`, **ItemList** supports searching within the list while the control is focused. Press a key that matches the first letter of an item's name to select the first item starting with the given letter. After that point, there are two ways to perform incremental search: 1) Press the same key again before the timeout duration to select the next item starting with the same letter. 2) Press letter keys that match the rest of the word before the timeout duration to match to select the item in question directly. Both of these actions will be reset to the beginning of the list if the timeout duration has passed since the last keystroke was registered. You can adjust the timeout duration by changing :ref:`ProjectSettings.gui/timers/incremental_search_max_interval_msec<class_ProjectSettings_property_gui/timers/incremental_search_max_interval_msec>`.
  18. .. rst-class:: classref-reftable-group
  19. Properties
  20. ----------
  21. .. table::
  22. :widths: auto
  23. +---------------------------------------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`allow_reselect<class_ItemList_property_allow_reselect>` | ``false`` |
  25. +---------------------------------------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------+
  26. | :ref:`bool<class_bool>` | :ref:`allow_rmb_select<class_ItemList_property_allow_rmb_select>` | ``false`` |
  27. +---------------------------------------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------+
  28. | :ref:`bool<class_bool>` | :ref:`auto_height<class_ItemList_property_auto_height>` | ``false`` |
  29. +---------------------------------------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------+
  30. | :ref:`int<class_int>` | :ref:`fixed_column_width<class_ItemList_property_fixed_column_width>` | ``0`` |
  31. +---------------------------------------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------+
  32. | :ref:`Vector2<class_Vector2>` | :ref:`fixed_icon_size<class_ItemList_property_fixed_icon_size>` | ``Vector2( 0, 0 )`` |
  33. +---------------------------------------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------+
  34. | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
  35. +---------------------------------------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------+
  36. | :ref:`IconMode<enum_ItemList_IconMode>` | :ref:`icon_mode<class_ItemList_property_icon_mode>` | ``1`` |
  37. +---------------------------------------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------+
  38. | :ref:`float<class_float>` | :ref:`icon_scale<class_ItemList_property_icon_scale>` | ``1.0`` |
  39. +---------------------------------------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------+
  40. | :ref:`int<class_int>` | :ref:`max_columns<class_ItemList_property_max_columns>` | ``1`` |
  41. +---------------------------------------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------+
  42. | :ref:`int<class_int>` | :ref:`max_text_lines<class_ItemList_property_max_text_lines>` | ``1`` |
  43. +---------------------------------------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------+
  44. | :ref:`bool<class_bool>` | rect_clip_content | ``true`` (overrides :ref:`Control<class_Control_property_rect_clip_content>`) |
  45. +---------------------------------------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------+
  46. | :ref:`bool<class_bool>` | :ref:`same_column_width<class_ItemList_property_same_column_width>` | ``false`` |
  47. +---------------------------------------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------+
  48. | :ref:`SelectMode<enum_ItemList_SelectMode>` | :ref:`select_mode<class_ItemList_property_select_mode>` | ``0`` |
  49. +---------------------------------------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------+
  50. .. rst-class:: classref-reftable-group
  51. Methods
  52. -------
  53. .. table::
  54. :widths: auto
  55. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | void | :ref:`add_icon_item<class_ItemList_method_add_icon_item>` **(** :ref:`Texture<class_Texture>` icon, :ref:`bool<class_bool>` selectable=true **)** |
  57. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | void | :ref:`add_item<class_ItemList_method_add_item>` **(** :ref:`String<class_String>` text, :ref:`Texture<class_Texture>` icon=null, :ref:`bool<class_bool>` selectable=true **)** |
  59. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | void | :ref:`clear<class_ItemList_method_clear>` **(** **)** |
  61. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | void | :ref:`ensure_current_is_visible<class_ItemList_method_ensure_current_is_visible>` **(** **)** |
  63. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`int<class_int>` | :ref:`get_item_at_position<class_ItemList_method_get_item_at_position>` **(** :ref:`Vector2<class_Vector2>` position, :ref:`bool<class_bool>` exact=false **)** |const| |
  65. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`int<class_int>` | :ref:`get_item_count<class_ItemList_method_get_item_count>` **(** **)** |const| |
  67. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`Color<class_Color>` | :ref:`get_item_custom_bg_color<class_ItemList_method_get_item_custom_bg_color>` **(** :ref:`int<class_int>` idx **)** |const| |
  69. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`Color<class_Color>` | :ref:`get_item_custom_fg_color<class_ItemList_method_get_item_custom_fg_color>` **(** :ref:`int<class_int>` idx **)** |const| |
  71. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`Texture<class_Texture>` | :ref:`get_item_icon<class_ItemList_method_get_item_icon>` **(** :ref:`int<class_int>` idx **)** |const| |
  73. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`Color<class_Color>` | :ref:`get_item_icon_modulate<class_ItemList_method_get_item_icon_modulate>` **(** :ref:`int<class_int>` idx **)** |const| |
  75. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`Rect2<class_Rect2>` | :ref:`get_item_icon_region<class_ItemList_method_get_item_icon_region>` **(** :ref:`int<class_int>` idx **)** |const| |
  77. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`Variant<class_Variant>` | :ref:`get_item_metadata<class_ItemList_method_get_item_metadata>` **(** :ref:`int<class_int>` idx **)** |const| |
  79. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`String<class_String>` | :ref:`get_item_text<class_ItemList_method_get_item_text>` **(** :ref:`int<class_int>` idx **)** |const| |
  81. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`String<class_String>` | :ref:`get_item_tooltip<class_ItemList_method_get_item_tooltip>` **(** :ref:`int<class_int>` idx **)** |const| |
  83. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_selected_items<class_ItemList_method_get_selected_items>` **(** **)** |
  85. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`VScrollBar<class_VScrollBar>` | :ref:`get_v_scroll<class_ItemList_method_get_v_scroll>` **(** **)** |
  87. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`bool<class_bool>` | :ref:`is_anything_selected<class_ItemList_method_is_anything_selected>` **(** **)** |
  89. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`bool<class_bool>` | :ref:`is_item_disabled<class_ItemList_method_is_item_disabled>` **(** :ref:`int<class_int>` idx **)** |const| |
  91. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`bool<class_bool>` | :ref:`is_item_icon_transposed<class_ItemList_method_is_item_icon_transposed>` **(** :ref:`int<class_int>` idx **)** |const| |
  93. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`bool<class_bool>` | :ref:`is_item_selectable<class_ItemList_method_is_item_selectable>` **(** :ref:`int<class_int>` idx **)** |const| |
  95. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`bool<class_bool>` | :ref:`is_item_tooltip_enabled<class_ItemList_method_is_item_tooltip_enabled>` **(** :ref:`int<class_int>` idx **)** |const| |
  97. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`bool<class_bool>` | :ref:`is_selected<class_ItemList_method_is_selected>` **(** :ref:`int<class_int>` idx **)** |const| |
  99. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | void | :ref:`move_item<class_ItemList_method_move_item>` **(** :ref:`int<class_int>` from_idx, :ref:`int<class_int>` to_idx **)** |
  101. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | void | :ref:`remove_item<class_ItemList_method_remove_item>` **(** :ref:`int<class_int>` idx **)** |
  103. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | void | :ref:`select<class_ItemList_method_select>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` single=true **)** |
  105. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | void | :ref:`set_item_custom_bg_color<class_ItemList_method_set_item_custom_bg_color>` **(** :ref:`int<class_int>` idx, :ref:`Color<class_Color>` custom_bg_color **)** |
  107. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | void | :ref:`set_item_custom_fg_color<class_ItemList_method_set_item_custom_fg_color>` **(** :ref:`int<class_int>` idx, :ref:`Color<class_Color>` custom_fg_color **)** |
  109. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | void | :ref:`set_item_disabled<class_ItemList_method_set_item_disabled>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)** |
  111. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | void | :ref:`set_item_icon<class_ItemList_method_set_item_icon>` **(** :ref:`int<class_int>` idx, :ref:`Texture<class_Texture>` icon **)** |
  113. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | void | :ref:`set_item_icon_modulate<class_ItemList_method_set_item_icon_modulate>` **(** :ref:`int<class_int>` idx, :ref:`Color<class_Color>` modulate **)** |
  115. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | void | :ref:`set_item_icon_region<class_ItemList_method_set_item_icon_region>` **(** :ref:`int<class_int>` idx, :ref:`Rect2<class_Rect2>` rect **)** |
  117. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | void | :ref:`set_item_icon_transposed<class_ItemList_method_set_item_icon_transposed>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` transposed **)** |
  119. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | void | :ref:`set_item_metadata<class_ItemList_method_set_item_metadata>` **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` metadata **)** |
  121. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | void | :ref:`set_item_selectable<class_ItemList_method_set_item_selectable>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` selectable **)** |
  123. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | void | :ref:`set_item_text<class_ItemList_method_set_item_text>` **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)** |
  125. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | void | :ref:`set_item_tooltip<class_ItemList_method_set_item_tooltip>` **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` tooltip **)** |
  127. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | void | :ref:`set_item_tooltip_enabled<class_ItemList_method_set_item_tooltip_enabled>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable **)** |
  129. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | void | :ref:`sort_items_by_text<class_ItemList_method_sort_items_by_text>` **(** **)** |
  131. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | void | :ref:`unselect<class_ItemList_method_unselect>` **(** :ref:`int<class_int>` idx **)** |
  133. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | void | :ref:`unselect_all<class_ItemList_method_unselect_all>` **(** **)** |
  135. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. .. rst-class:: classref-reftable-group
  137. Theme Properties
  138. ----------------
  139. .. table::
  140. :widths: auto
  141. +---------------------------------+----------------------------------------------------------------------------+----------------------------------+
  142. | :ref:`Color<class_Color>` | :ref:`font_color<class_ItemList_theme_color_font_color>` | ``Color( 0.63, 0.63, 0.63, 1 )`` |
  143. +---------------------------------+----------------------------------------------------------------------------+----------------------------------+
  144. | :ref:`Color<class_Color>` | :ref:`font_color_selected<class_ItemList_theme_color_font_color_selected>` | ``Color( 1, 1, 1, 1 )`` |
  145. +---------------------------------+----------------------------------------------------------------------------+----------------------------------+
  146. | :ref:`Color<class_Color>` | :ref:`guide_color<class_ItemList_theme_color_guide_color>` | ``Color( 0, 0, 0, 0.1 )`` |
  147. +---------------------------------+----------------------------------------------------------------------------+----------------------------------+
  148. | :ref:`int<class_int>` | :ref:`hseparation<class_ItemList_theme_constant_hseparation>` | ``4`` |
  149. +---------------------------------+----------------------------------------------------------------------------+----------------------------------+
  150. | :ref:`int<class_int>` | :ref:`icon_margin<class_ItemList_theme_constant_icon_margin>` | ``4`` |
  151. +---------------------------------+----------------------------------------------------------------------------+----------------------------------+
  152. | :ref:`int<class_int>` | :ref:`line_separation<class_ItemList_theme_constant_line_separation>` | ``2`` |
  153. +---------------------------------+----------------------------------------------------------------------------+----------------------------------+
  154. | :ref:`int<class_int>` | :ref:`vseparation<class_ItemList_theme_constant_vseparation>` | ``2`` |
  155. +---------------------------------+----------------------------------------------------------------------------+----------------------------------+
  156. | :ref:`Font<class_Font>` | :ref:`font<class_ItemList_theme_font_font>` | |
  157. +---------------------------------+----------------------------------------------------------------------------+----------------------------------+
  158. | :ref:`StyleBox<class_StyleBox>` | :ref:`bg<class_ItemList_theme_style_bg>` | |
  159. +---------------------------------+----------------------------------------------------------------------------+----------------------------------+
  160. | :ref:`StyleBox<class_StyleBox>` | :ref:`bg_focus<class_ItemList_theme_style_bg_focus>` | |
  161. +---------------------------------+----------------------------------------------------------------------------+----------------------------------+
  162. | :ref:`StyleBox<class_StyleBox>` | :ref:`cursor<class_ItemList_theme_style_cursor>` | |
  163. +---------------------------------+----------------------------------------------------------------------------+----------------------------------+
  164. | :ref:`StyleBox<class_StyleBox>` | :ref:`cursor_unfocused<class_ItemList_theme_style_cursor_unfocused>` | |
  165. +---------------------------------+----------------------------------------------------------------------------+----------------------------------+
  166. | :ref:`StyleBox<class_StyleBox>` | :ref:`selected<class_ItemList_theme_style_selected>` | |
  167. +---------------------------------+----------------------------------------------------------------------------+----------------------------------+
  168. | :ref:`StyleBox<class_StyleBox>` | :ref:`selected_focus<class_ItemList_theme_style_selected_focus>` | |
  169. +---------------------------------+----------------------------------------------------------------------------+----------------------------------+
  170. .. rst-class:: classref-section-separator
  171. ----
  172. .. rst-class:: classref-descriptions-group
  173. Signals
  174. -------
  175. .. _class_ItemList_signal_item_activated:
  176. .. rst-class:: classref-signal
  177. **item_activated** **(** :ref:`int<class_int>` index **)**
  178. Triggered when specified list item is activated via double-clicking or by pressing Enter.
  179. .. rst-class:: classref-item-separator
  180. ----
  181. .. _class_ItemList_signal_item_rmb_selected:
  182. .. rst-class:: classref-signal
  183. **item_rmb_selected** **(** :ref:`int<class_int>` index, :ref:`Vector2<class_Vector2>` at_position **)**
  184. Triggered when specified list item has been selected via right mouse clicking.
  185. The click position is also provided to allow appropriate popup of context menus at the correct location.
  186. \ :ref:`allow_rmb_select<class_ItemList_property_allow_rmb_select>` must be enabled.
  187. .. rst-class:: classref-item-separator
  188. ----
  189. .. _class_ItemList_signal_item_selected:
  190. .. rst-class:: classref-signal
  191. **item_selected** **(** :ref:`int<class_int>` index **)**
  192. Triggered when specified item has been selected.
  193. \ :ref:`allow_reselect<class_ItemList_property_allow_reselect>` must be enabled to reselect an item.
  194. .. rst-class:: classref-item-separator
  195. ----
  196. .. _class_ItemList_signal_multi_selected:
  197. .. rst-class:: classref-signal
  198. **multi_selected** **(** :ref:`int<class_int>` index, :ref:`bool<class_bool>` selected **)**
  199. Triggered when a multiple selection is altered on a list allowing multiple selection.
  200. .. rst-class:: classref-item-separator
  201. ----
  202. .. _class_ItemList_signal_nothing_selected:
  203. .. rst-class:: classref-signal
  204. **nothing_selected** **(** **)**
  205. Triggered when a left mouse click is issued within the rect of the list but on empty space.
  206. .. rst-class:: classref-item-separator
  207. ----
  208. .. _class_ItemList_signal_rmb_clicked:
  209. .. rst-class:: classref-signal
  210. **rmb_clicked** **(** :ref:`Vector2<class_Vector2>` at_position **)**
  211. Triggered when a right mouse click is issued within the rect of the list but on empty space.
  212. \ :ref:`allow_rmb_select<class_ItemList_property_allow_rmb_select>` must be enabled.
  213. .. rst-class:: classref-section-separator
  214. ----
  215. .. rst-class:: classref-descriptions-group
  216. Enumerations
  217. ------------
  218. .. _enum_ItemList_IconMode:
  219. .. rst-class:: classref-enumeration
  220. enum **IconMode**:
  221. .. _class_ItemList_constant_ICON_MODE_TOP:
  222. .. rst-class:: classref-enumeration-constant
  223. :ref:`IconMode<enum_ItemList_IconMode>` **ICON_MODE_TOP** = ``0``
  224. Icon is drawn above the text.
  225. .. _class_ItemList_constant_ICON_MODE_LEFT:
  226. .. rst-class:: classref-enumeration-constant
  227. :ref:`IconMode<enum_ItemList_IconMode>` **ICON_MODE_LEFT** = ``1``
  228. Icon is drawn to the left of the text.
  229. .. rst-class:: classref-item-separator
  230. ----
  231. .. _enum_ItemList_SelectMode:
  232. .. rst-class:: classref-enumeration
  233. enum **SelectMode**:
  234. .. _class_ItemList_constant_SELECT_SINGLE:
  235. .. rst-class:: classref-enumeration-constant
  236. :ref:`SelectMode<enum_ItemList_SelectMode>` **SELECT_SINGLE** = ``0``
  237. Only allow selecting a single item.
  238. .. _class_ItemList_constant_SELECT_MULTI:
  239. .. rst-class:: classref-enumeration-constant
  240. :ref:`SelectMode<enum_ItemList_SelectMode>` **SELECT_MULTI** = ``1``
  241. Allows selecting multiple items by holding Ctrl or Shift.
  242. .. rst-class:: classref-section-separator
  243. ----
  244. .. rst-class:: classref-descriptions-group
  245. Property Descriptions
  246. ---------------------
  247. .. _class_ItemList_property_allow_reselect:
  248. .. rst-class:: classref-property
  249. :ref:`bool<class_bool>` **allow_reselect** = ``false``
  250. .. rst-class:: classref-property-setget
  251. - void **set_allow_reselect** **(** :ref:`bool<class_bool>` value **)**
  252. - :ref:`bool<class_bool>` **get_allow_reselect** **(** **)**
  253. If ``true``, the currently selected item can be selected again.
  254. .. rst-class:: classref-item-separator
  255. ----
  256. .. _class_ItemList_property_allow_rmb_select:
  257. .. rst-class:: classref-property
  258. :ref:`bool<class_bool>` **allow_rmb_select** = ``false``
  259. .. rst-class:: classref-property-setget
  260. - void **set_allow_rmb_select** **(** :ref:`bool<class_bool>` value **)**
  261. - :ref:`bool<class_bool>` **get_allow_rmb_select** **(** **)**
  262. If ``true``, right mouse button click can select items.
  263. .. rst-class:: classref-item-separator
  264. ----
  265. .. _class_ItemList_property_auto_height:
  266. .. rst-class:: classref-property
  267. :ref:`bool<class_bool>` **auto_height** = ``false``
  268. .. rst-class:: classref-property-setget
  269. - void **set_auto_height** **(** :ref:`bool<class_bool>` value **)**
  270. - :ref:`bool<class_bool>` **has_auto_height** **(** **)**
  271. If ``true``, the control will automatically resize the height to fit its content.
  272. .. rst-class:: classref-item-separator
  273. ----
  274. .. _class_ItemList_property_fixed_column_width:
  275. .. rst-class:: classref-property
  276. :ref:`int<class_int>` **fixed_column_width** = ``0``
  277. .. rst-class:: classref-property-setget
  278. - void **set_fixed_column_width** **(** :ref:`int<class_int>` value **)**
  279. - :ref:`int<class_int>` **get_fixed_column_width** **(** **)**
  280. The width all columns will be adjusted to.
  281. A value of zero disables the adjustment, each item will have a width equal to the width of its content and the columns will have an uneven width.
  282. .. rst-class:: classref-item-separator
  283. ----
  284. .. _class_ItemList_property_fixed_icon_size:
  285. .. rst-class:: classref-property
  286. :ref:`Vector2<class_Vector2>` **fixed_icon_size** = ``Vector2( 0, 0 )``
  287. .. rst-class:: classref-property-setget
  288. - void **set_fixed_icon_size** **(** :ref:`Vector2<class_Vector2>` value **)**
  289. - :ref:`Vector2<class_Vector2>` **get_fixed_icon_size** **(** **)**
  290. The size all icons will be adjusted to.
  291. If either X or Y component is not greater than zero, icon size won't be affected.
  292. .. rst-class:: classref-item-separator
  293. ----
  294. .. _class_ItemList_property_icon_mode:
  295. .. rst-class:: classref-property
  296. :ref:`IconMode<enum_ItemList_IconMode>` **icon_mode** = ``1``
  297. .. rst-class:: classref-property-setget
  298. - void **set_icon_mode** **(** :ref:`IconMode<enum_ItemList_IconMode>` value **)**
  299. - :ref:`IconMode<enum_ItemList_IconMode>` **get_icon_mode** **(** **)**
  300. The icon position, whether above or to the left of the text. See the :ref:`IconMode<enum_ItemList_IconMode>` constants.
  301. .. rst-class:: classref-item-separator
  302. ----
  303. .. _class_ItemList_property_icon_scale:
  304. .. rst-class:: classref-property
  305. :ref:`float<class_float>` **icon_scale** = ``1.0``
  306. .. rst-class:: classref-property-setget
  307. - void **set_icon_scale** **(** :ref:`float<class_float>` value **)**
  308. - :ref:`float<class_float>` **get_icon_scale** **(** **)**
  309. The scale of icon applied after :ref:`fixed_icon_size<class_ItemList_property_fixed_icon_size>` and transposing takes effect.
  310. .. rst-class:: classref-item-separator
  311. ----
  312. .. _class_ItemList_property_max_columns:
  313. .. rst-class:: classref-property
  314. :ref:`int<class_int>` **max_columns** = ``1``
  315. .. rst-class:: classref-property-setget
  316. - void **set_max_columns** **(** :ref:`int<class_int>` value **)**
  317. - :ref:`int<class_int>` **get_max_columns** **(** **)**
  318. Maximum columns the list will have.
  319. If greater than zero, the content will be split among the specified columns.
  320. A value of zero means unlimited columns, i.e. all items will be put in the same row.
  321. .. rst-class:: classref-item-separator
  322. ----
  323. .. _class_ItemList_property_max_text_lines:
  324. .. rst-class:: classref-property
  325. :ref:`int<class_int>` **max_text_lines** = ``1``
  326. .. rst-class:: classref-property-setget
  327. - void **set_max_text_lines** **(** :ref:`int<class_int>` value **)**
  328. - :ref:`int<class_int>` **get_max_text_lines** **(** **)**
  329. Maximum lines of text allowed in each item. Space will be reserved even when there is not enough lines of text to display.
  330. \ **Note:** This property takes effect only when :ref:`icon_mode<class_ItemList_property_icon_mode>` is :ref:`ICON_MODE_TOP<class_ItemList_constant_ICON_MODE_TOP>`. To make the text wrap, :ref:`fixed_column_width<class_ItemList_property_fixed_column_width>` should be greater than zero.
  331. .. rst-class:: classref-item-separator
  332. ----
  333. .. _class_ItemList_property_same_column_width:
  334. .. rst-class:: classref-property
  335. :ref:`bool<class_bool>` **same_column_width** = ``false``
  336. .. rst-class:: classref-property-setget
  337. - void **set_same_column_width** **(** :ref:`bool<class_bool>` value **)**
  338. - :ref:`bool<class_bool>` **is_same_column_width** **(** **)**
  339. Whether all columns will have the same width.
  340. If ``true``, the width is equal to the largest column width of all columns.
  341. .. rst-class:: classref-item-separator
  342. ----
  343. .. _class_ItemList_property_select_mode:
  344. .. rst-class:: classref-property
  345. :ref:`SelectMode<enum_ItemList_SelectMode>` **select_mode** = ``0``
  346. .. rst-class:: classref-property-setget
  347. - void **set_select_mode** **(** :ref:`SelectMode<enum_ItemList_SelectMode>` value **)**
  348. - :ref:`SelectMode<enum_ItemList_SelectMode>` **get_select_mode** **(** **)**
  349. Allows single or multiple item selection. See the :ref:`SelectMode<enum_ItemList_SelectMode>` constants.
  350. .. rst-class:: classref-section-separator
  351. ----
  352. .. rst-class:: classref-descriptions-group
  353. Method Descriptions
  354. -------------------
  355. .. _class_ItemList_method_add_icon_item:
  356. .. rst-class:: classref-method
  357. void **add_icon_item** **(** :ref:`Texture<class_Texture>` icon, :ref:`bool<class_bool>` selectable=true **)**
  358. Adds an item to the item list with no text, only an icon.
  359. .. rst-class:: classref-item-separator
  360. ----
  361. .. _class_ItemList_method_add_item:
  362. .. rst-class:: classref-method
  363. void **add_item** **(** :ref:`String<class_String>` text, :ref:`Texture<class_Texture>` icon=null, :ref:`bool<class_bool>` selectable=true **)**
  364. Adds an item to the item list with specified text. Specify an ``icon``, or use ``null`` as the ``icon`` for a list item with no icon.
  365. If selectable is ``true``, the list item will be selectable.
  366. .. rst-class:: classref-item-separator
  367. ----
  368. .. _class_ItemList_method_clear:
  369. .. rst-class:: classref-method
  370. void **clear** **(** **)**
  371. Removes all items from the list.
  372. .. rst-class:: classref-item-separator
  373. ----
  374. .. _class_ItemList_method_ensure_current_is_visible:
  375. .. rst-class:: classref-method
  376. void **ensure_current_is_visible** **(** **)**
  377. Ensure current selection is visible, adjusting the scroll position as necessary.
  378. .. rst-class:: classref-item-separator
  379. ----
  380. .. _class_ItemList_method_get_item_at_position:
  381. .. rst-class:: classref-method
  382. :ref:`int<class_int>` **get_item_at_position** **(** :ref:`Vector2<class_Vector2>` position, :ref:`bool<class_bool>` exact=false **)** |const|
  383. Returns the item index at the given ``position``.
  384. When there is no item at that point, -1 will be returned if ``exact`` is ``true``, and the closest item index will be returned otherwise.
  385. .. rst-class:: classref-item-separator
  386. ----
  387. .. _class_ItemList_method_get_item_count:
  388. .. rst-class:: classref-method
  389. :ref:`int<class_int>` **get_item_count** **(** **)** |const|
  390. Returns the number of items currently in the list.
  391. .. rst-class:: classref-item-separator
  392. ----
  393. .. _class_ItemList_method_get_item_custom_bg_color:
  394. .. rst-class:: classref-method
  395. :ref:`Color<class_Color>` **get_item_custom_bg_color** **(** :ref:`int<class_int>` idx **)** |const|
  396. Returns the custom background color of the item specified by ``idx`` index.
  397. .. rst-class:: classref-item-separator
  398. ----
  399. .. _class_ItemList_method_get_item_custom_fg_color:
  400. .. rst-class:: classref-method
  401. :ref:`Color<class_Color>` **get_item_custom_fg_color** **(** :ref:`int<class_int>` idx **)** |const|
  402. Returns the custom foreground color of the item specified by ``idx`` index.
  403. .. rst-class:: classref-item-separator
  404. ----
  405. .. _class_ItemList_method_get_item_icon:
  406. .. rst-class:: classref-method
  407. :ref:`Texture<class_Texture>` **get_item_icon** **(** :ref:`int<class_int>` idx **)** |const|
  408. Returns the icon associated with the specified index.
  409. .. rst-class:: classref-item-separator
  410. ----
  411. .. _class_ItemList_method_get_item_icon_modulate:
  412. .. rst-class:: classref-method
  413. :ref:`Color<class_Color>` **get_item_icon_modulate** **(** :ref:`int<class_int>` idx **)** |const|
  414. Returns a :ref:`Color<class_Color>` modulating item's icon at the specified index.
  415. .. rst-class:: classref-item-separator
  416. ----
  417. .. _class_ItemList_method_get_item_icon_region:
  418. .. rst-class:: classref-method
  419. :ref:`Rect2<class_Rect2>` **get_item_icon_region** **(** :ref:`int<class_int>` idx **)** |const|
  420. Returns the region of item's icon used. The whole icon will be used if the region has no area.
  421. .. rst-class:: classref-item-separator
  422. ----
  423. .. _class_ItemList_method_get_item_metadata:
  424. .. rst-class:: classref-method
  425. :ref:`Variant<class_Variant>` **get_item_metadata** **(** :ref:`int<class_int>` idx **)** |const|
  426. Returns the metadata value of the specified index.
  427. .. rst-class:: classref-item-separator
  428. ----
  429. .. _class_ItemList_method_get_item_text:
  430. .. rst-class:: classref-method
  431. :ref:`String<class_String>` **get_item_text** **(** :ref:`int<class_int>` idx **)** |const|
  432. Returns the text associated with the specified index.
  433. .. rst-class:: classref-item-separator
  434. ----
  435. .. _class_ItemList_method_get_item_tooltip:
  436. .. rst-class:: classref-method
  437. :ref:`String<class_String>` **get_item_tooltip** **(** :ref:`int<class_int>` idx **)** |const|
  438. Returns the tooltip hint associated with the specified index.
  439. .. rst-class:: classref-item-separator
  440. ----
  441. .. _class_ItemList_method_get_selected_items:
  442. .. rst-class:: classref-method
  443. :ref:`PoolIntArray<class_PoolIntArray>` **get_selected_items** **(** **)**
  444. Returns an array with the indexes of the selected items.
  445. .. rst-class:: classref-item-separator
  446. ----
  447. .. _class_ItemList_method_get_v_scroll:
  448. .. rst-class:: classref-method
  449. :ref:`VScrollBar<class_VScrollBar>` **get_v_scroll** **(** **)**
  450. Returns the vertical scrollbar.
  451. \ **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` property.
  452. .. rst-class:: classref-item-separator
  453. ----
  454. .. _class_ItemList_method_is_anything_selected:
  455. .. rst-class:: classref-method
  456. :ref:`bool<class_bool>` **is_anything_selected** **(** **)**
  457. Returns ``true`` if one or more items are selected.
  458. .. rst-class:: classref-item-separator
  459. ----
  460. .. _class_ItemList_method_is_item_disabled:
  461. .. rst-class:: classref-method
  462. :ref:`bool<class_bool>` **is_item_disabled** **(** :ref:`int<class_int>` idx **)** |const|
  463. Returns ``true`` if the item at the specified index is disabled.
  464. .. rst-class:: classref-item-separator
  465. ----
  466. .. _class_ItemList_method_is_item_icon_transposed:
  467. .. rst-class:: classref-method
  468. :ref:`bool<class_bool>` **is_item_icon_transposed** **(** :ref:`int<class_int>` idx **)** |const|
  469. Returns ``true`` if the item icon will be drawn transposed, i.e. the X and Y axes are swapped.
  470. .. rst-class:: classref-item-separator
  471. ----
  472. .. _class_ItemList_method_is_item_selectable:
  473. .. rst-class:: classref-method
  474. :ref:`bool<class_bool>` **is_item_selectable** **(** :ref:`int<class_int>` idx **)** |const|
  475. Returns ``true`` if the item at the specified index is selectable.
  476. .. rst-class:: classref-item-separator
  477. ----
  478. .. _class_ItemList_method_is_item_tooltip_enabled:
  479. .. rst-class:: classref-method
  480. :ref:`bool<class_bool>` **is_item_tooltip_enabled** **(** :ref:`int<class_int>` idx **)** |const|
  481. Returns ``true`` if the tooltip is enabled for specified item index.
  482. .. rst-class:: classref-item-separator
  483. ----
  484. .. _class_ItemList_method_is_selected:
  485. .. rst-class:: classref-method
  486. :ref:`bool<class_bool>` **is_selected** **(** :ref:`int<class_int>` idx **)** |const|
  487. Returns ``true`` if the item at the specified index is currently selected.
  488. .. rst-class:: classref-item-separator
  489. ----
  490. .. _class_ItemList_method_move_item:
  491. .. rst-class:: classref-method
  492. void **move_item** **(** :ref:`int<class_int>` from_idx, :ref:`int<class_int>` to_idx **)**
  493. Moves item from index ``from_idx`` to ``to_idx``.
  494. .. rst-class:: classref-item-separator
  495. ----
  496. .. _class_ItemList_method_remove_item:
  497. .. rst-class:: classref-method
  498. void **remove_item** **(** :ref:`int<class_int>` idx **)**
  499. Removes the item specified by ``idx`` index from the list.
  500. .. rst-class:: classref-item-separator
  501. ----
  502. .. _class_ItemList_method_select:
  503. .. rst-class:: classref-method
  504. void **select** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` single=true **)**
  505. Select the item at the specified index.
  506. \ **Note:** This method does not trigger the item selection signal.
  507. .. rst-class:: classref-item-separator
  508. ----
  509. .. _class_ItemList_method_set_item_custom_bg_color:
  510. .. rst-class:: classref-method
  511. void **set_item_custom_bg_color** **(** :ref:`int<class_int>` idx, :ref:`Color<class_Color>` custom_bg_color **)**
  512. Sets the background color of the item specified by ``idx`` index to the specified :ref:`Color<class_Color>`.
  513. .. rst-class:: classref-item-separator
  514. ----
  515. .. _class_ItemList_method_set_item_custom_fg_color:
  516. .. rst-class:: classref-method
  517. void **set_item_custom_fg_color** **(** :ref:`int<class_int>` idx, :ref:`Color<class_Color>` custom_fg_color **)**
  518. Sets the foreground color of the item specified by ``idx`` index to the specified :ref:`Color<class_Color>`.
  519. .. rst-class:: classref-item-separator
  520. ----
  521. .. _class_ItemList_method_set_item_disabled:
  522. .. rst-class:: classref-method
  523. void **set_item_disabled** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)**
  524. Disables (or enables) the item at the specified index.
  525. Disabled items cannot be selected and do not trigger activation signals (when double-clicking or pressing Enter).
  526. .. rst-class:: classref-item-separator
  527. ----
  528. .. _class_ItemList_method_set_item_icon:
  529. .. rst-class:: classref-method
  530. void **set_item_icon** **(** :ref:`int<class_int>` idx, :ref:`Texture<class_Texture>` icon **)**
  531. Sets (or replaces) the icon's :ref:`Texture<class_Texture>` associated with the specified index.
  532. .. rst-class:: classref-item-separator
  533. ----
  534. .. _class_ItemList_method_set_item_icon_modulate:
  535. .. rst-class:: classref-method
  536. void **set_item_icon_modulate** **(** :ref:`int<class_int>` idx, :ref:`Color<class_Color>` modulate **)**
  537. Sets a modulating :ref:`Color<class_Color>` of the item associated with the specified index.
  538. .. rst-class:: classref-item-separator
  539. ----
  540. .. _class_ItemList_method_set_item_icon_region:
  541. .. rst-class:: classref-method
  542. void **set_item_icon_region** **(** :ref:`int<class_int>` idx, :ref:`Rect2<class_Rect2>` rect **)**
  543. Sets the region of item's icon used. The whole icon will be used if the region has no area.
  544. .. rst-class:: classref-item-separator
  545. ----
  546. .. _class_ItemList_method_set_item_icon_transposed:
  547. .. rst-class:: classref-method
  548. void **set_item_icon_transposed** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` transposed **)**
  549. Sets whether the item icon will be drawn transposed.
  550. .. rst-class:: classref-item-separator
  551. ----
  552. .. _class_ItemList_method_set_item_metadata:
  553. .. rst-class:: classref-method
  554. void **set_item_metadata** **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` metadata **)**
  555. Sets a value (of any type) to be stored with the item associated with the specified index.
  556. .. rst-class:: classref-item-separator
  557. ----
  558. .. _class_ItemList_method_set_item_selectable:
  559. .. rst-class:: classref-method
  560. void **set_item_selectable** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` selectable **)**
  561. Allows or disallows selection of the item associated with the specified index.
  562. .. rst-class:: classref-item-separator
  563. ----
  564. .. _class_ItemList_method_set_item_text:
  565. .. rst-class:: classref-method
  566. void **set_item_text** **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)**
  567. Sets text of the item associated with the specified index.
  568. .. rst-class:: classref-item-separator
  569. ----
  570. .. _class_ItemList_method_set_item_tooltip:
  571. .. rst-class:: classref-method
  572. void **set_item_tooltip** **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` tooltip **)**
  573. Sets the tooltip hint for the item associated with the specified index.
  574. .. rst-class:: classref-item-separator
  575. ----
  576. .. _class_ItemList_method_set_item_tooltip_enabled:
  577. .. rst-class:: classref-method
  578. void **set_item_tooltip_enabled** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable **)**
  579. Sets whether the tooltip hint is enabled for specified item index.
  580. .. rst-class:: classref-item-separator
  581. ----
  582. .. _class_ItemList_method_sort_items_by_text:
  583. .. rst-class:: classref-method
  584. void **sort_items_by_text** **(** **)**
  585. Sorts items in the list by their text.
  586. .. rst-class:: classref-item-separator
  587. ----
  588. .. _class_ItemList_method_unselect:
  589. .. rst-class:: classref-method
  590. void **unselect** **(** :ref:`int<class_int>` idx **)**
  591. Ensures the item associated with the specified index is not selected.
  592. .. rst-class:: classref-item-separator
  593. ----
  594. .. _class_ItemList_method_unselect_all:
  595. .. rst-class:: classref-method
  596. void **unselect_all** **(** **)**
  597. Ensures there are no items selected.
  598. .. rst-class:: classref-section-separator
  599. ----
  600. .. rst-class:: classref-descriptions-group
  601. Theme Property Descriptions
  602. ---------------------------
  603. .. _class_ItemList_theme_color_font_color:
  604. .. rst-class:: classref-themeproperty
  605. :ref:`Color<class_Color>` **font_color** = ``Color( 0.63, 0.63, 0.63, 1 )``
  606. Default text :ref:`Color<class_Color>` of the item.
  607. .. rst-class:: classref-item-separator
  608. ----
  609. .. _class_ItemList_theme_color_font_color_selected:
  610. .. rst-class:: classref-themeproperty
  611. :ref:`Color<class_Color>` **font_color_selected** = ``Color( 1, 1, 1, 1 )``
  612. Text :ref:`Color<class_Color>` used when the item is selected.
  613. .. rst-class:: classref-item-separator
  614. ----
  615. .. _class_ItemList_theme_color_guide_color:
  616. .. rst-class:: classref-themeproperty
  617. :ref:`Color<class_Color>` **guide_color** = ``Color( 0, 0, 0, 0.1 )``
  618. :ref:`Color<class_Color>` of the guideline. The guideline is a line drawn between each row of items.
  619. .. rst-class:: classref-item-separator
  620. ----
  621. .. _class_ItemList_theme_constant_hseparation:
  622. .. rst-class:: classref-themeproperty
  623. :ref:`int<class_int>` **hseparation** = ``4``
  624. The horizontal spacing between items.
  625. .. rst-class:: classref-item-separator
  626. ----
  627. .. _class_ItemList_theme_constant_icon_margin:
  628. .. rst-class:: classref-themeproperty
  629. :ref:`int<class_int>` **icon_margin** = ``4``
  630. The spacing between item's icon and text.
  631. .. rst-class:: classref-item-separator
  632. ----
  633. .. _class_ItemList_theme_constant_line_separation:
  634. .. rst-class:: classref-themeproperty
  635. :ref:`int<class_int>` **line_separation** = ``2``
  636. The vertical spacing between each line of text.
  637. .. rst-class:: classref-item-separator
  638. ----
  639. .. _class_ItemList_theme_constant_vseparation:
  640. .. rst-class:: classref-themeproperty
  641. :ref:`int<class_int>` **vseparation** = ``2``
  642. The vertical spacing between items.
  643. .. rst-class:: classref-item-separator
  644. ----
  645. .. _class_ItemList_theme_font_font:
  646. .. rst-class:: classref-themeproperty
  647. :ref:`Font<class_Font>` **font**
  648. :ref:`Font<class_Font>` of the item's text.
  649. .. rst-class:: classref-item-separator
  650. ----
  651. .. _class_ItemList_theme_style_bg:
  652. .. rst-class:: classref-themeproperty
  653. :ref:`StyleBox<class_StyleBox>` **bg**
  654. Default :ref:`StyleBox<class_StyleBox>` for the **ItemList**, i.e. used when the control is not being focused.
  655. .. rst-class:: classref-item-separator
  656. ----
  657. .. _class_ItemList_theme_style_bg_focus:
  658. .. rst-class:: classref-themeproperty
  659. :ref:`StyleBox<class_StyleBox>` **bg_focus**
  660. :ref:`StyleBox<class_StyleBox>` used when the **ItemList** is being focused.
  661. .. rst-class:: classref-item-separator
  662. ----
  663. .. _class_ItemList_theme_style_cursor:
  664. .. rst-class:: classref-themeproperty
  665. :ref:`StyleBox<class_StyleBox>` **cursor**
  666. :ref:`StyleBox<class_StyleBox>` used for the cursor, when the **ItemList** is being focused.
  667. .. rst-class:: classref-item-separator
  668. ----
  669. .. _class_ItemList_theme_style_cursor_unfocused:
  670. .. rst-class:: classref-themeproperty
  671. :ref:`StyleBox<class_StyleBox>` **cursor_unfocused**
  672. :ref:`StyleBox<class_StyleBox>` used for the cursor, when the **ItemList** is not being focused.
  673. .. rst-class:: classref-item-separator
  674. ----
  675. .. _class_ItemList_theme_style_selected:
  676. .. rst-class:: classref-themeproperty
  677. :ref:`StyleBox<class_StyleBox>` **selected**
  678. :ref:`StyleBox<class_StyleBox>` for the selected items, used when the **ItemList** is not being focused.
  679. .. rst-class:: classref-item-separator
  680. ----
  681. .. _class_ItemList_theme_style_selected_focus:
  682. .. rst-class:: classref-themeproperty
  683. :ref:`StyleBox<class_StyleBox>` **selected_focus**
  684. :ref:`StyleBox<class_StyleBox>` for the selected items, used when the **ItemList** is being focused.
  685. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  686. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  687. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  688. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`