123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/ItemList.xml.
- .. _class_ItemList:
- ItemList
- ========
- **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
- A vertical list of selectable items with one or multiple columns.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- This control provides a vertical list of selectable items that may be in a single or in multiple columns, with each item having options for text and an icon. Tooltips are supported and may be different for every item in the list.
- 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 :kbd:`Enter`.
- 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 the 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.
- All ``set_*`` methods allow negative item indices, i.e. ``-1`` to access the last item, ``-2`` to select the second-to-last item, and so on.
- \ **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>`.
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`allow_reselect<class_ItemList_property_allow_reselect>` | ``false`` |
- +---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`allow_rmb_select<class_ItemList_property_allow_rmb_select>` | ``false`` |
- +---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`allow_search<class_ItemList_property_allow_search>` | ``true`` |
- +---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`auto_height<class_ItemList_property_auto_height>` | ``false`` |
- +---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`auto_width<class_ItemList_property_auto_width>` | ``false`` |
- +---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | clip_contents | ``true`` (overrides :ref:`Control<class_Control_property_clip_contents>`) |
- +---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`fixed_column_width<class_ItemList_property_fixed_column_width>` | ``0`` |
- +---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`Vector2i<class_Vector2i>` | :ref:`fixed_icon_size<class_ItemList_property_fixed_icon_size>` | ``Vector2i(0, 0)`` |
- +---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
- +---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`IconMode<enum_ItemList_IconMode>` | :ref:`icon_mode<class_ItemList_property_icon_mode>` | ``1`` |
- +---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`icon_scale<class_ItemList_property_icon_scale>` | ``1.0`` |
- +---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`item_count<class_ItemList_property_item_count>` | ``0`` |
- +---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`max_columns<class_ItemList_property_max_columns>` | ``1`` |
- +---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`max_text_lines<class_ItemList_property_max_text_lines>` | ``1`` |
- +---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`same_column_width<class_ItemList_property_same_column_width>` | ``false`` |
- +---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`SelectMode<enum_ItemList_SelectMode>` | :ref:`select_mode<class_ItemList_property_select_mode>` | ``0`` |
- +---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
- | :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` | :ref:`text_overrun_behavior<class_ItemList_property_text_overrun_behavior>` | ``3`` |
- +---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
- .. rst-class:: classref-reftable-group
- Methods
- -------
- .. table::
- :widths: auto
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`add_icon_item<class_ItemList_method_add_icon_item>`\ (\ icon\: :ref:`Texture2D<class_Texture2D>`, selectable\: :ref:`bool<class_bool>` = true\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`add_item<class_ItemList_method_add_item>`\ (\ text\: :ref:`String<class_String>`, icon\: :ref:`Texture2D<class_Texture2D>` = null, selectable\: :ref:`bool<class_bool>` = true\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`clear<class_ItemList_method_clear>`\ (\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`deselect<class_ItemList_method_deselect>`\ (\ idx\: :ref:`int<class_int>`\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`deselect_all<class_ItemList_method_deselect_all>`\ (\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`ensure_current_is_visible<class_ItemList_method_ensure_current_is_visible>`\ (\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`force_update_list_size<class_ItemList_method_force_update_list_size>`\ (\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_item_at_position<class_ItemList_method_get_item_at_position>`\ (\ position\: :ref:`Vector2<class_Vector2>`, exact\: :ref:`bool<class_bool>` = false\ ) |const| |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>` | :ref:`get_item_auto_translate_mode<class_ItemList_method_get_item_auto_translate_mode>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Color<class_Color>` | :ref:`get_item_custom_bg_color<class_ItemList_method_get_item_custom_bg_color>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Color<class_Color>` | :ref:`get_item_custom_fg_color<class_ItemList_method_get_item_custom_fg_color>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`get_item_icon<class_ItemList_method_get_item_icon>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Color<class_Color>` | :ref:`get_item_icon_modulate<class_ItemList_method_get_item_icon_modulate>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Rect2<class_Rect2>` | :ref:`get_item_icon_region<class_ItemList_method_get_item_icon_region>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`get_item_language<class_ItemList_method_get_item_language>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Variant<class_Variant>` | :ref:`get_item_metadata<class_ItemList_method_get_item_metadata>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Rect2<class_Rect2>` | :ref:`get_item_rect<class_ItemList_method_get_item_rect>`\ (\ idx\: :ref:`int<class_int>`, expand\: :ref:`bool<class_bool>` = true\ ) |const| |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`get_item_text<class_ItemList_method_get_item_text>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`TextDirection<enum_Control_TextDirection>` | :ref:`get_item_text_direction<class_ItemList_method_get_item_text_direction>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`get_item_tooltip<class_ItemList_method_get_item_tooltip>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_selected_items<class_ItemList_method_get_selected_items>`\ (\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`VScrollBar<class_VScrollBar>` | :ref:`get_v_scroll_bar<class_ItemList_method_get_v_scroll_bar>`\ (\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_anything_selected<class_ItemList_method_is_anything_selected>`\ (\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_item_disabled<class_ItemList_method_is_item_disabled>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_item_icon_transposed<class_ItemList_method_is_item_icon_transposed>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_item_selectable<class_ItemList_method_is_item_selectable>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_item_tooltip_enabled<class_ItemList_method_is_item_tooltip_enabled>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_selected<class_ItemList_method_is_selected>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`move_item<class_ItemList_method_move_item>`\ (\ from_idx\: :ref:`int<class_int>`, to_idx\: :ref:`int<class_int>`\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`remove_item<class_ItemList_method_remove_item>`\ (\ idx\: :ref:`int<class_int>`\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`select<class_ItemList_method_select>`\ (\ idx\: :ref:`int<class_int>`, single\: :ref:`bool<class_bool>` = true\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_item_auto_translate_mode<class_ItemList_method_set_item_auto_translate_mode>`\ (\ idx\: :ref:`int<class_int>`, mode\: :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>`\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_item_custom_bg_color<class_ItemList_method_set_item_custom_bg_color>`\ (\ idx\: :ref:`int<class_int>`, custom_bg_color\: :ref:`Color<class_Color>`\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_item_custom_fg_color<class_ItemList_method_set_item_custom_fg_color>`\ (\ idx\: :ref:`int<class_int>`, custom_fg_color\: :ref:`Color<class_Color>`\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_item_disabled<class_ItemList_method_set_item_disabled>`\ (\ idx\: :ref:`int<class_int>`, disabled\: :ref:`bool<class_bool>`\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_item_icon<class_ItemList_method_set_item_icon>`\ (\ idx\: :ref:`int<class_int>`, icon\: :ref:`Texture2D<class_Texture2D>`\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_item_icon_modulate<class_ItemList_method_set_item_icon_modulate>`\ (\ idx\: :ref:`int<class_int>`, modulate\: :ref:`Color<class_Color>`\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_item_icon_region<class_ItemList_method_set_item_icon_region>`\ (\ idx\: :ref:`int<class_int>`, rect\: :ref:`Rect2<class_Rect2>`\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_item_icon_transposed<class_ItemList_method_set_item_icon_transposed>`\ (\ idx\: :ref:`int<class_int>`, transposed\: :ref:`bool<class_bool>`\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_item_language<class_ItemList_method_set_item_language>`\ (\ idx\: :ref:`int<class_int>`, language\: :ref:`String<class_String>`\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_item_metadata<class_ItemList_method_set_item_metadata>`\ (\ idx\: :ref:`int<class_int>`, metadata\: :ref:`Variant<class_Variant>`\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_item_selectable<class_ItemList_method_set_item_selectable>`\ (\ idx\: :ref:`int<class_int>`, selectable\: :ref:`bool<class_bool>`\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_item_text<class_ItemList_method_set_item_text>`\ (\ idx\: :ref:`int<class_int>`, text\: :ref:`String<class_String>`\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_item_text_direction<class_ItemList_method_set_item_text_direction>`\ (\ idx\: :ref:`int<class_int>`, direction\: :ref:`TextDirection<enum_Control_TextDirection>`\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_item_tooltip<class_ItemList_method_set_item_tooltip>`\ (\ idx\: :ref:`int<class_int>`, tooltip\: :ref:`String<class_String>`\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_item_tooltip_enabled<class_ItemList_method_set_item_tooltip_enabled>`\ (\ idx\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`sort_items_by_text<class_ItemList_method_sort_items_by_text>`\ (\ ) |
- +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- .. rst-class:: classref-reftable-group
- Theme Properties
- ----------------
- .. table::
- :widths: auto
- +---------------------------------+----------------------------------------------------------------------------+--------------------------------+
- | :ref:`Color<class_Color>` | :ref:`font_color<class_ItemList_theme_color_font_color>` | ``Color(0.65, 0.65, 0.65, 1)`` |
- +---------------------------------+----------------------------------------------------------------------------+--------------------------------+
- | :ref:`Color<class_Color>` | :ref:`font_hovered_color<class_ItemList_theme_color_font_hovered_color>` | ``Color(0.95, 0.95, 0.95, 1)`` |
- +---------------------------------+----------------------------------------------------------------------------+--------------------------------+
- | :ref:`Color<class_Color>` | :ref:`font_outline_color<class_ItemList_theme_color_font_outline_color>` | ``Color(0, 0, 0, 1)`` |
- +---------------------------------+----------------------------------------------------------------------------+--------------------------------+
- | :ref:`Color<class_Color>` | :ref:`font_selected_color<class_ItemList_theme_color_font_selected_color>` | ``Color(1, 1, 1, 1)`` |
- +---------------------------------+----------------------------------------------------------------------------+--------------------------------+
- | :ref:`Color<class_Color>` | :ref:`guide_color<class_ItemList_theme_color_guide_color>` | ``Color(0.7, 0.7, 0.7, 0.25)`` |
- +---------------------------------+----------------------------------------------------------------------------+--------------------------------+
- | :ref:`int<class_int>` | :ref:`h_separation<class_ItemList_theme_constant_h_separation>` | ``4`` |
- +---------------------------------+----------------------------------------------------------------------------+--------------------------------+
- | :ref:`int<class_int>` | :ref:`icon_margin<class_ItemList_theme_constant_icon_margin>` | ``4`` |
- +---------------------------------+----------------------------------------------------------------------------+--------------------------------+
- | :ref:`int<class_int>` | :ref:`line_separation<class_ItemList_theme_constant_line_separation>` | ``2`` |
- +---------------------------------+----------------------------------------------------------------------------+--------------------------------+
- | :ref:`int<class_int>` | :ref:`outline_size<class_ItemList_theme_constant_outline_size>` | ``0`` |
- +---------------------------------+----------------------------------------------------------------------------+--------------------------------+
- | :ref:`int<class_int>` | :ref:`v_separation<class_ItemList_theme_constant_v_separation>` | ``4`` |
- +---------------------------------+----------------------------------------------------------------------------+--------------------------------+
- | :ref:`Font<class_Font>` | :ref:`font<class_ItemList_theme_font_font>` | |
- +---------------------------------+----------------------------------------------------------------------------+--------------------------------+
- | :ref:`int<class_int>` | :ref:`font_size<class_ItemList_theme_font_size_font_size>` | |
- +---------------------------------+----------------------------------------------------------------------------+--------------------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`cursor<class_ItemList_theme_style_cursor>` | |
- +---------------------------------+----------------------------------------------------------------------------+--------------------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`cursor_unfocused<class_ItemList_theme_style_cursor_unfocused>` | |
- +---------------------------------+----------------------------------------------------------------------------+--------------------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_ItemList_theme_style_focus>` | |
- +---------------------------------+----------------------------------------------------------------------------+--------------------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`hovered<class_ItemList_theme_style_hovered>` | |
- +---------------------------------+----------------------------------------------------------------------------+--------------------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`panel<class_ItemList_theme_style_panel>` | |
- +---------------------------------+----------------------------------------------------------------------------+--------------------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`selected<class_ItemList_theme_style_selected>` | |
- +---------------------------------+----------------------------------------------------------------------------+--------------------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`selected_focus<class_ItemList_theme_style_selected_focus>` | |
- +---------------------------------+----------------------------------------------------------------------------+--------------------------------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Signals
- -------
- .. _class_ItemList_signal_empty_clicked:
- .. rst-class:: classref-signal
- **empty_clicked**\ (\ at_position\: :ref:`Vector2<class_Vector2>`, mouse_button_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_ItemList_signal_empty_clicked>`
- Emitted when any mouse click is issued within the rect of the list but on empty space.
- \ ``at_position`` is the click position in this control's local coordinate system.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_signal_item_activated:
- .. rst-class:: classref-signal
- **item_activated**\ (\ index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_ItemList_signal_item_activated>`
- Emitted when specified list item is activated via double-clicking or by pressing :kbd:`Enter`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_signal_item_clicked:
- .. rst-class:: classref-signal
- **item_clicked**\ (\ index\: :ref:`int<class_int>`, at_position\: :ref:`Vector2<class_Vector2>`, mouse_button_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_ItemList_signal_item_clicked>`
- Emitted when specified list item has been clicked with any mouse button.
- \ ``at_position`` is the click position in this control's local coordinate system.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_signal_item_selected:
- .. rst-class:: classref-signal
- **item_selected**\ (\ index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_ItemList_signal_item_selected>`
- Emitted when specified item has been selected. Only applicable in single selection mode.
- \ :ref:`allow_reselect<class_ItemList_property_allow_reselect>` must be enabled to reselect an item.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_signal_multi_selected:
- .. rst-class:: classref-signal
- **multi_selected**\ (\ index\: :ref:`int<class_int>`, selected\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_ItemList_signal_multi_selected>`
- Emitted when a multiple selection is altered on a list allowing multiple selection.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Enumerations
- ------------
- .. _enum_ItemList_IconMode:
- .. rst-class:: classref-enumeration
- enum **IconMode**: :ref:`🔗<enum_ItemList_IconMode>`
- .. _class_ItemList_constant_ICON_MODE_TOP:
- .. rst-class:: classref-enumeration-constant
- :ref:`IconMode<enum_ItemList_IconMode>` **ICON_MODE_TOP** = ``0``
- Icon is drawn above the text.
- .. _class_ItemList_constant_ICON_MODE_LEFT:
- .. rst-class:: classref-enumeration-constant
- :ref:`IconMode<enum_ItemList_IconMode>` **ICON_MODE_LEFT** = ``1``
- Icon is drawn to the left of the text.
- .. rst-class:: classref-item-separator
- ----
- .. _enum_ItemList_SelectMode:
- .. rst-class:: classref-enumeration
- enum **SelectMode**: :ref:`🔗<enum_ItemList_SelectMode>`
- .. _class_ItemList_constant_SELECT_SINGLE:
- .. rst-class:: classref-enumeration-constant
- :ref:`SelectMode<enum_ItemList_SelectMode>` **SELECT_SINGLE** = ``0``
- Only allow selecting a single item.
- .. _class_ItemList_constant_SELECT_MULTI:
- .. rst-class:: classref-enumeration-constant
- :ref:`SelectMode<enum_ItemList_SelectMode>` **SELECT_MULTI** = ``1``
- Allows selecting multiple items by holding :kbd:`Ctrl` or :kbd:`Shift`.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_ItemList_property_allow_reselect:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **allow_reselect** = ``false`` :ref:`🔗<class_ItemList_property_allow_reselect>`
- .. rst-class:: classref-property-setget
- - |void| **set_allow_reselect**\ (\ value\: :ref:`bool<class_bool>`\ )
- - :ref:`bool<class_bool>` **get_allow_reselect**\ (\ )
- If ``true``, the currently selected item can be selected again.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_property_allow_rmb_select:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **allow_rmb_select** = ``false`` :ref:`🔗<class_ItemList_property_allow_rmb_select>`
- .. rst-class:: classref-property-setget
- - |void| **set_allow_rmb_select**\ (\ value\: :ref:`bool<class_bool>`\ )
- - :ref:`bool<class_bool>` **get_allow_rmb_select**\ (\ )
- If ``true``, right mouse button click can select items.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_property_allow_search:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **allow_search** = ``true`` :ref:`🔗<class_ItemList_property_allow_search>`
- .. rst-class:: classref-property-setget
- - |void| **set_allow_search**\ (\ value\: :ref:`bool<class_bool>`\ )
- - :ref:`bool<class_bool>` **get_allow_search**\ (\ )
- If ``true``, allows navigating the **ItemList** with letter keys through incremental search.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_property_auto_height:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **auto_height** = ``false`` :ref:`🔗<class_ItemList_property_auto_height>`
- .. rst-class:: classref-property-setget
- - |void| **set_auto_height**\ (\ value\: :ref:`bool<class_bool>`\ )
- - :ref:`bool<class_bool>` **has_auto_height**\ (\ )
- If ``true``, the control will automatically resize the height to fit its content.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_property_auto_width:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **auto_width** = ``false`` :ref:`🔗<class_ItemList_property_auto_width>`
- .. rst-class:: classref-property-setget
- - |void| **set_auto_width**\ (\ value\: :ref:`bool<class_bool>`\ )
- - :ref:`bool<class_bool>` **has_auto_width**\ (\ )
- If ``true``, the control will automatically resize the width to fit its content.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_property_fixed_column_width:
- .. rst-class:: classref-property
- :ref:`int<class_int>` **fixed_column_width** = ``0`` :ref:`🔗<class_ItemList_property_fixed_column_width>`
- .. rst-class:: classref-property-setget
- - |void| **set_fixed_column_width**\ (\ value\: :ref:`int<class_int>`\ )
- - :ref:`int<class_int>` **get_fixed_column_width**\ (\ )
- The width all columns will be adjusted to.
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_property_fixed_icon_size:
- .. rst-class:: classref-property
- :ref:`Vector2i<class_Vector2i>` **fixed_icon_size** = ``Vector2i(0, 0)`` :ref:`🔗<class_ItemList_property_fixed_icon_size>`
- .. rst-class:: classref-property-setget
- - |void| **set_fixed_icon_size**\ (\ value\: :ref:`Vector2i<class_Vector2i>`\ )
- - :ref:`Vector2i<class_Vector2i>` **get_fixed_icon_size**\ (\ )
- The size all icons will be adjusted to.
- If either X or Y component is not greater than zero, icon size won't be affected.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_property_icon_mode:
- .. rst-class:: classref-property
- :ref:`IconMode<enum_ItemList_IconMode>` **icon_mode** = ``1`` :ref:`🔗<class_ItemList_property_icon_mode>`
- .. rst-class:: classref-property-setget
- - |void| **set_icon_mode**\ (\ value\: :ref:`IconMode<enum_ItemList_IconMode>`\ )
- - :ref:`IconMode<enum_ItemList_IconMode>` **get_icon_mode**\ (\ )
- The icon position, whether above or to the left of the text. See the :ref:`IconMode<enum_ItemList_IconMode>` constants.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_property_icon_scale:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **icon_scale** = ``1.0`` :ref:`🔗<class_ItemList_property_icon_scale>`
- .. rst-class:: classref-property-setget
- - |void| **set_icon_scale**\ (\ value\: :ref:`float<class_float>`\ )
- - :ref:`float<class_float>` **get_icon_scale**\ (\ )
- The scale of icon applied after :ref:`fixed_icon_size<class_ItemList_property_fixed_icon_size>` and transposing takes effect.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_property_item_count:
- .. rst-class:: classref-property
- :ref:`int<class_int>` **item_count** = ``0`` :ref:`🔗<class_ItemList_property_item_count>`
- .. rst-class:: classref-property-setget
- - |void| **set_item_count**\ (\ value\: :ref:`int<class_int>`\ )
- - :ref:`int<class_int>` **get_item_count**\ (\ )
- The number of items currently in the list.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_property_max_columns:
- .. rst-class:: classref-property
- :ref:`int<class_int>` **max_columns** = ``1`` :ref:`🔗<class_ItemList_property_max_columns>`
- .. rst-class:: classref-property-setget
- - |void| **set_max_columns**\ (\ value\: :ref:`int<class_int>`\ )
- - :ref:`int<class_int>` **get_max_columns**\ (\ )
- Maximum columns the list will have.
- If greater than zero, the content will be split among the specified columns.
- A value of zero means unlimited columns, i.e. all items will be put in the same row.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_property_max_text_lines:
- .. rst-class:: classref-property
- :ref:`int<class_int>` **max_text_lines** = ``1`` :ref:`🔗<class_ItemList_property_max_text_lines>`
- .. rst-class:: classref-property-setget
- - |void| **set_max_text_lines**\ (\ value\: :ref:`int<class_int>`\ )
- - :ref:`int<class_int>` **get_max_text_lines**\ (\ )
- Maximum lines of text allowed in each item. Space will be reserved even when there is not enough lines of text to display.
- \ **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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_property_same_column_width:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **same_column_width** = ``false`` :ref:`🔗<class_ItemList_property_same_column_width>`
- .. rst-class:: classref-property-setget
- - |void| **set_same_column_width**\ (\ value\: :ref:`bool<class_bool>`\ )
- - :ref:`bool<class_bool>` **is_same_column_width**\ (\ )
- Whether all columns will have the same width.
- If ``true``, the width is equal to the largest column width of all columns.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_property_select_mode:
- .. rst-class:: classref-property
- :ref:`SelectMode<enum_ItemList_SelectMode>` **select_mode** = ``0`` :ref:`🔗<class_ItemList_property_select_mode>`
- .. rst-class:: classref-property-setget
- - |void| **set_select_mode**\ (\ value\: :ref:`SelectMode<enum_ItemList_SelectMode>`\ )
- - :ref:`SelectMode<enum_ItemList_SelectMode>` **get_select_mode**\ (\ )
- Allows single or multiple item selection. See the :ref:`SelectMode<enum_ItemList_SelectMode>` constants.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_property_text_overrun_behavior:
- .. rst-class:: classref-property
- :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` **text_overrun_behavior** = ``3`` :ref:`🔗<class_ItemList_property_text_overrun_behavior>`
- .. rst-class:: classref-property-setget
- - |void| **set_text_overrun_behavior**\ (\ value\: :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>`\ )
- - :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` **get_text_overrun_behavior**\ (\ )
- Sets the clipping behavior when the text exceeds an item's bounding rectangle. See :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` for a description of all modes.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Method Descriptions
- -------------------
- .. _class_ItemList_method_add_icon_item:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **add_icon_item**\ (\ icon\: :ref:`Texture2D<class_Texture2D>`, selectable\: :ref:`bool<class_bool>` = true\ ) :ref:`🔗<class_ItemList_method_add_icon_item>`
- Adds an item to the item list with no text, only an icon. Returns the index of an added item.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_add_item:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **add_item**\ (\ text\: :ref:`String<class_String>`, icon\: :ref:`Texture2D<class_Texture2D>` = null, selectable\: :ref:`bool<class_bool>` = true\ ) :ref:`🔗<class_ItemList_method_add_item>`
- Adds an item to the item list with specified text. Returns the index of an added item.
- Specify an ``icon``, or use ``null`` as the ``icon`` for a list item with no icon.
- If ``selectable`` is ``true``, the list item will be selectable.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_clear:
- .. rst-class:: classref-method
- |void| **clear**\ (\ ) :ref:`🔗<class_ItemList_method_clear>`
- Removes all items from the list.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_deselect:
- .. rst-class:: classref-method
- |void| **deselect**\ (\ idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_ItemList_method_deselect>`
- Ensures the item associated with the specified index is not selected.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_deselect_all:
- .. rst-class:: classref-method
- |void| **deselect_all**\ (\ ) :ref:`🔗<class_ItemList_method_deselect_all>`
- Ensures there are no items selected.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_ensure_current_is_visible:
- .. rst-class:: classref-method
- |void| **ensure_current_is_visible**\ (\ ) :ref:`🔗<class_ItemList_method_ensure_current_is_visible>`
- Ensure current selection is visible, adjusting the scroll position as necessary.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_force_update_list_size:
- .. rst-class:: classref-method
- |void| **force_update_list_size**\ (\ ) :ref:`🔗<class_ItemList_method_force_update_list_size>`
- Forces an update to the list size based on its items. This happens automatically whenever size of the items, or other relevant settings like :ref:`auto_height<class_ItemList_property_auto_height>`, change. The method can be used to trigger the update ahead of next drawing pass.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_get_item_at_position:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_item_at_position**\ (\ position\: :ref:`Vector2<class_Vector2>`, exact\: :ref:`bool<class_bool>` = false\ ) |const| :ref:`🔗<class_ItemList_method_get_item_at_position>`
- Returns the item index at the given ``position``.
- 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.
- \ **Note:** The returned value is unreliable if called right after modifying the **ItemList**, before it redraws in the next frame.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_get_item_auto_translate_mode:
- .. rst-class:: classref-method
- :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>` **get_item_auto_translate_mode**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ItemList_method_get_item_auto_translate_mode>`
- Returns item's auto translate mode.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_get_item_custom_bg_color:
- .. rst-class:: classref-method
- :ref:`Color<class_Color>` **get_item_custom_bg_color**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ItemList_method_get_item_custom_bg_color>`
- Returns the custom background color of the item specified by ``idx`` index.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_get_item_custom_fg_color:
- .. rst-class:: classref-method
- :ref:`Color<class_Color>` **get_item_custom_fg_color**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ItemList_method_get_item_custom_fg_color>`
- Returns the custom foreground color of the item specified by ``idx`` index.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_get_item_icon:
- .. rst-class:: classref-method
- :ref:`Texture2D<class_Texture2D>` **get_item_icon**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ItemList_method_get_item_icon>`
- Returns the icon associated with the specified index.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_get_item_icon_modulate:
- .. rst-class:: classref-method
- :ref:`Color<class_Color>` **get_item_icon_modulate**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ItemList_method_get_item_icon_modulate>`
- Returns a :ref:`Color<class_Color>` modulating item's icon at the specified index.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_get_item_icon_region:
- .. rst-class:: classref-method
- :ref:`Rect2<class_Rect2>` **get_item_icon_region**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ItemList_method_get_item_icon_region>`
- Returns the region of item's icon used. The whole icon will be used if the region has no area.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_get_item_language:
- .. rst-class:: classref-method
- :ref:`String<class_String>` **get_item_language**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ItemList_method_get_item_language>`
- Returns item's text language code.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_get_item_metadata:
- .. rst-class:: classref-method
- :ref:`Variant<class_Variant>` **get_item_metadata**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ItemList_method_get_item_metadata>`
- Returns the metadata value of the specified index.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_get_item_rect:
- .. rst-class:: classref-method
- :ref:`Rect2<class_Rect2>` **get_item_rect**\ (\ idx\: :ref:`int<class_int>`, expand\: :ref:`bool<class_bool>` = true\ ) |const| :ref:`🔗<class_ItemList_method_get_item_rect>`
- Returns the position and size of the item with the specified index, in the coordinate system of the **ItemList** node. If ``expand`` is ``true`` the last column expands to fill the rest of the row.
- \ **Note:** The returned value is unreliable if called right after modifying the **ItemList**, before it redraws in the next frame.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_get_item_text:
- .. rst-class:: classref-method
- :ref:`String<class_String>` **get_item_text**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ItemList_method_get_item_text>`
- Returns the text associated with the specified index.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_get_item_text_direction:
- .. rst-class:: classref-method
- :ref:`TextDirection<enum_Control_TextDirection>` **get_item_text_direction**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ItemList_method_get_item_text_direction>`
- Returns item's text base writing direction.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_get_item_tooltip:
- .. rst-class:: classref-method
- :ref:`String<class_String>` **get_item_tooltip**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ItemList_method_get_item_tooltip>`
- Returns the tooltip hint associated with the specified index.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_get_selected_items:
- .. rst-class:: classref-method
- :ref:`PackedInt32Array<class_PackedInt32Array>` **get_selected_items**\ (\ ) :ref:`🔗<class_ItemList_method_get_selected_items>`
- Returns an array with the indexes of the selected items.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_get_v_scroll_bar:
- .. rst-class:: classref-method
- :ref:`VScrollBar<class_VScrollBar>` **get_v_scroll_bar**\ (\ ) :ref:`🔗<class_ItemList_method_get_v_scroll_bar>`
- Returns the vertical scrollbar.
- \ **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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_is_anything_selected:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **is_anything_selected**\ (\ ) :ref:`🔗<class_ItemList_method_is_anything_selected>`
- Returns ``true`` if one or more items are selected.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_is_item_disabled:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **is_item_disabled**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ItemList_method_is_item_disabled>`
- Returns ``true`` if the item at the specified index is disabled.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_is_item_icon_transposed:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **is_item_icon_transposed**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ItemList_method_is_item_icon_transposed>`
- Returns ``true`` if the item icon will be drawn transposed, i.e. the X and Y axes are swapped.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_is_item_selectable:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **is_item_selectable**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ItemList_method_is_item_selectable>`
- Returns ``true`` if the item at the specified index is selectable.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_is_item_tooltip_enabled:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **is_item_tooltip_enabled**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ItemList_method_is_item_tooltip_enabled>`
- Returns ``true`` if the tooltip is enabled for specified item index.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_is_selected:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **is_selected**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_ItemList_method_is_selected>`
- Returns ``true`` if the item at the specified index is currently selected.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_move_item:
- .. rst-class:: classref-method
- |void| **move_item**\ (\ from_idx\: :ref:`int<class_int>`, to_idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_ItemList_method_move_item>`
- Moves item from index ``from_idx`` to ``to_idx``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_remove_item:
- .. rst-class:: classref-method
- |void| **remove_item**\ (\ idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_ItemList_method_remove_item>`
- Removes the item specified by ``idx`` index from the list.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_select:
- .. rst-class:: classref-method
- |void| **select**\ (\ idx\: :ref:`int<class_int>`, single\: :ref:`bool<class_bool>` = true\ ) :ref:`🔗<class_ItemList_method_select>`
- Select the item at the specified index.
- \ **Note:** This method does not trigger the item selection signal.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_set_item_auto_translate_mode:
- .. rst-class:: classref-method
- |void| **set_item_auto_translate_mode**\ (\ idx\: :ref:`int<class_int>`, mode\: :ref:`AutoTranslateMode<enum_Node_AutoTranslateMode>`\ ) :ref:`🔗<class_ItemList_method_set_item_auto_translate_mode>`
- Sets the auto translate mode of the item associated with the specified index.
- Items use :ref:`Node.AUTO_TRANSLATE_MODE_INHERIT<class_Node_constant_AUTO_TRANSLATE_MODE_INHERIT>` by default, which uses the same auto translate mode as the **ItemList** itself.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_set_item_custom_bg_color:
- .. rst-class:: classref-method
- |void| **set_item_custom_bg_color**\ (\ idx\: :ref:`int<class_int>`, custom_bg_color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_ItemList_method_set_item_custom_bg_color>`
- Sets the background color of the item specified by ``idx`` index to the specified :ref:`Color<class_Color>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_set_item_custom_fg_color:
- .. rst-class:: classref-method
- |void| **set_item_custom_fg_color**\ (\ idx\: :ref:`int<class_int>`, custom_fg_color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_ItemList_method_set_item_custom_fg_color>`
- Sets the foreground color of the item specified by ``idx`` index to the specified :ref:`Color<class_Color>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_set_item_disabled:
- .. rst-class:: classref-method
- |void| **set_item_disabled**\ (\ idx\: :ref:`int<class_int>`, disabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_ItemList_method_set_item_disabled>`
- Disables (or enables) the item at the specified index.
- Disabled items cannot be selected and do not trigger activation signals (when double-clicking or pressing :kbd:`Enter`).
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_set_item_icon:
- .. rst-class:: classref-method
- |void| **set_item_icon**\ (\ idx\: :ref:`int<class_int>`, icon\: :ref:`Texture2D<class_Texture2D>`\ ) :ref:`🔗<class_ItemList_method_set_item_icon>`
- Sets (or replaces) the icon's :ref:`Texture2D<class_Texture2D>` associated with the specified index.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_set_item_icon_modulate:
- .. rst-class:: classref-method
- |void| **set_item_icon_modulate**\ (\ idx\: :ref:`int<class_int>`, modulate\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_ItemList_method_set_item_icon_modulate>`
- Sets a modulating :ref:`Color<class_Color>` of the item associated with the specified index.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_set_item_icon_region:
- .. rst-class:: classref-method
- |void| **set_item_icon_region**\ (\ idx\: :ref:`int<class_int>`, rect\: :ref:`Rect2<class_Rect2>`\ ) :ref:`🔗<class_ItemList_method_set_item_icon_region>`
- Sets the region of item's icon used. The whole icon will be used if the region has no area.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_set_item_icon_transposed:
- .. rst-class:: classref-method
- |void| **set_item_icon_transposed**\ (\ idx\: :ref:`int<class_int>`, transposed\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_ItemList_method_set_item_icon_transposed>`
- Sets whether the item icon will be drawn transposed.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_set_item_language:
- .. rst-class:: classref-method
- |void| **set_item_language**\ (\ idx\: :ref:`int<class_int>`, language\: :ref:`String<class_String>`\ ) :ref:`🔗<class_ItemList_method_set_item_language>`
- Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_set_item_metadata:
- .. rst-class:: classref-method
- |void| **set_item_metadata**\ (\ idx\: :ref:`int<class_int>`, metadata\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_ItemList_method_set_item_metadata>`
- Sets a value (of any type) to be stored with the item associated with the specified index.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_set_item_selectable:
- .. rst-class:: classref-method
- |void| **set_item_selectable**\ (\ idx\: :ref:`int<class_int>`, selectable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_ItemList_method_set_item_selectable>`
- Allows or disallows selection of the item associated with the specified index.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_set_item_text:
- .. rst-class:: classref-method
- |void| **set_item_text**\ (\ idx\: :ref:`int<class_int>`, text\: :ref:`String<class_String>`\ ) :ref:`🔗<class_ItemList_method_set_item_text>`
- Sets text of the item associated with the specified index.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_set_item_text_direction:
- .. rst-class:: classref-method
- |void| **set_item_text_direction**\ (\ idx\: :ref:`int<class_int>`, direction\: :ref:`TextDirection<enum_Control_TextDirection>`\ ) :ref:`🔗<class_ItemList_method_set_item_text_direction>`
- Sets item's text base writing direction.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_set_item_tooltip:
- .. rst-class:: classref-method
- |void| **set_item_tooltip**\ (\ idx\: :ref:`int<class_int>`, tooltip\: :ref:`String<class_String>`\ ) :ref:`🔗<class_ItemList_method_set_item_tooltip>`
- Sets the tooltip hint for the item associated with the specified index.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_set_item_tooltip_enabled:
- .. rst-class:: classref-method
- |void| **set_item_tooltip_enabled**\ (\ idx\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_ItemList_method_set_item_tooltip_enabled>`
- Sets whether the tooltip hint is enabled for specified item index.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_method_sort_items_by_text:
- .. rst-class:: classref-method
- |void| **sort_items_by_text**\ (\ ) :ref:`🔗<class_ItemList_method_sort_items_by_text>`
- Sorts items in the list by their text.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Theme Property Descriptions
- ---------------------------
- .. _class_ItemList_theme_color_font_color:
- .. rst-class:: classref-themeproperty
- :ref:`Color<class_Color>` **font_color** = ``Color(0.65, 0.65, 0.65, 1)`` :ref:`🔗<class_ItemList_theme_color_font_color>`
- Default text :ref:`Color<class_Color>` of the item.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_theme_color_font_hovered_color:
- .. rst-class:: classref-themeproperty
- :ref:`Color<class_Color>` **font_hovered_color** = ``Color(0.95, 0.95, 0.95, 1)`` :ref:`🔗<class_ItemList_theme_color_font_hovered_color>`
- Text :ref:`Color<class_Color>` used when the item is hovered and not selected yet.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_theme_color_font_outline_color:
- .. rst-class:: classref-themeproperty
- :ref:`Color<class_Color>` **font_outline_color** = ``Color(0, 0, 0, 1)`` :ref:`🔗<class_ItemList_theme_color_font_outline_color>`
- The tint of text outline of the item.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_theme_color_font_selected_color:
- .. rst-class:: classref-themeproperty
- :ref:`Color<class_Color>` **font_selected_color** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_ItemList_theme_color_font_selected_color>`
- Text :ref:`Color<class_Color>` used when the item is selected.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_theme_color_guide_color:
- .. rst-class:: classref-themeproperty
- :ref:`Color<class_Color>` **guide_color** = ``Color(0.7, 0.7, 0.7, 0.25)`` :ref:`🔗<class_ItemList_theme_color_guide_color>`
- :ref:`Color<class_Color>` of the guideline. The guideline is a line drawn between each row of items.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_theme_constant_h_separation:
- .. rst-class:: classref-themeproperty
- :ref:`int<class_int>` **h_separation** = ``4`` :ref:`🔗<class_ItemList_theme_constant_h_separation>`
- The horizontal spacing between items.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_theme_constant_icon_margin:
- .. rst-class:: classref-themeproperty
- :ref:`int<class_int>` **icon_margin** = ``4`` :ref:`🔗<class_ItemList_theme_constant_icon_margin>`
- The spacing between item's icon and text.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_theme_constant_line_separation:
- .. rst-class:: classref-themeproperty
- :ref:`int<class_int>` **line_separation** = ``2`` :ref:`🔗<class_ItemList_theme_constant_line_separation>`
- The vertical spacing between each line of text.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_theme_constant_outline_size:
- .. rst-class:: classref-themeproperty
- :ref:`int<class_int>` **outline_size** = ``0`` :ref:`🔗<class_ItemList_theme_constant_outline_size>`
- The size of the item text outline.
- \ **Note:** If using a font with :ref:`FontFile.multichannel_signed_distance_field<class_FontFile_property_multichannel_signed_distance_field>` enabled, its :ref:`FontFile.msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` must be set to at least *twice* the value of :ref:`outline_size<class_ItemList_theme_constant_outline_size>` for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_theme_constant_v_separation:
- .. rst-class:: classref-themeproperty
- :ref:`int<class_int>` **v_separation** = ``4`` :ref:`🔗<class_ItemList_theme_constant_v_separation>`
- The vertical spacing between items.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_theme_font_font:
- .. rst-class:: classref-themeproperty
- :ref:`Font<class_Font>` **font** :ref:`🔗<class_ItemList_theme_font_font>`
- :ref:`Font<class_Font>` of the item's text.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_theme_font_size_font_size:
- .. rst-class:: classref-themeproperty
- :ref:`int<class_int>` **font_size** :ref:`🔗<class_ItemList_theme_font_size_font_size>`
- Font size of the item's text.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_theme_style_cursor:
- .. rst-class:: classref-themeproperty
- :ref:`StyleBox<class_StyleBox>` **cursor** :ref:`🔗<class_ItemList_theme_style_cursor>`
- :ref:`StyleBox<class_StyleBox>` used for the cursor, when the **ItemList** is being focused.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_theme_style_cursor_unfocused:
- .. rst-class:: classref-themeproperty
- :ref:`StyleBox<class_StyleBox>` **cursor_unfocused** :ref:`🔗<class_ItemList_theme_style_cursor_unfocused>`
- :ref:`StyleBox<class_StyleBox>` used for the cursor, when the **ItemList** is not being focused.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_theme_style_focus:
- .. rst-class:: classref-themeproperty
- :ref:`StyleBox<class_StyleBox>` **focus** :ref:`🔗<class_ItemList_theme_style_focus>`
- The focused style for the **ItemList**, drawn on top of the background, but below everything else.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_theme_style_hovered:
- .. rst-class:: classref-themeproperty
- :ref:`StyleBox<class_StyleBox>` **hovered** :ref:`🔗<class_ItemList_theme_style_hovered>`
- :ref:`StyleBox<class_StyleBox>` for the hovered, but not selected items.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_theme_style_panel:
- .. rst-class:: classref-themeproperty
- :ref:`StyleBox<class_StyleBox>` **panel** :ref:`🔗<class_ItemList_theme_style_panel>`
- The background style for the **ItemList**.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_theme_style_selected:
- .. rst-class:: classref-themeproperty
- :ref:`StyleBox<class_StyleBox>` **selected** :ref:`🔗<class_ItemList_theme_style_selected>`
- :ref:`StyleBox<class_StyleBox>` for the selected items, used when the **ItemList** is not being focused.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ItemList_theme_style_selected_focus:
- .. rst-class:: classref-themeproperty
- :ref:`StyleBox<class_StyleBox>` **selected_focus** :ref:`🔗<class_ItemList_theme_style_selected_focus>`
- :ref:`StyleBox<class_StyleBox>` for the selected items, used when the **ItemList** is being focused.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
- .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
- .. |void| replace:: :abbr:`void (No return value.)`
|