mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-05 14:10:19 +03:00
1635 lines
82 KiB
ReStructuredText
1635 lines
82 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. _class_ItemList:
|
||
|
||
ItemList
|
||
========
|
||
|
||
**繼承:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
||
|
||
可選專案的垂直列表,可以有一列或多列。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
說明
|
||
----
|
||
|
||
該控制項提供了可選專案的垂直列表,這些專案可能位於單列或多列中,每個專案都有文本和圖示選項。支援工具提示,並且列表中的每個專案可能會有所不同。
|
||
|
||
可以選擇或取消選擇列表中的可選專案,並且可以啟用多項選擇。也可以啟用用滑鼠右鍵進行選擇,以允許使用彈出本文功能表。專案也可以通過按兩下它們,或按 :kbd:`Enter` 來“啟動”。
|
||
|
||
專案文字只支援單行字串。字串中的分行符號(例如 ``\n``\ )不會產生換行。在 :ref:`ICON_MODE_TOP<class_ItemList_constant_ICON_MODE_TOP>` 模式下會啟用文字換行,但預設情況下會調整列的寬度以完全適合其內容。需要將 :ref:`fixed_column_width<class_ItemList_property_fixed_column_width>` 設定得大於零,才能換行文字。
|
||
|
||
所有 ``set_*`` 方法都允許負的專案索引,例如 ``-1`` 存取的是最後一個專案,\ ``-2`` 選擇的是倒數第二個專案,以此類推。
|
||
|
||
\ **差異量搜索:**\ 與 :ref:`PopupMenu<class_PopupMenu>` 和 :ref:`Tree<class_Tree>` 一樣,\ **ItemList** 支援在控制項獲得焦點時在列表內進行搜索。按下與專案名稱的第一個字母配對的鍵,以選擇以給定字母開頭的第一個專案。在該點之後,有兩種方法可以執行差異量搜索: 1) 在超時持續時間之前再次按下相同的鍵,以選擇下一個以相同字母開頭的專案。 2) 在超時時間前,按配對單詞剩餘部分的字母鍵,將直接選擇問題項。如果自上次擊鍵被註冊後,超時持續時間已過,則這兩個動作都將被重設為列表的開頭。可以通過更改 :ref:`ProjectSettings.gui/timers/incremental_search_max_interval_msec<class_ProjectSettings_property_gui/timers/incremental_search_max_interval_msec>` 來調整超時持續時間。
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
屬性
|
||
----
|
||
|
||
.. 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:`ScrollHintMode<enum_ItemList_ScrollHintMode>` | :ref:`scroll_hint_mode<class_ItemList_property_scroll_hint_mode>` | ``0`` |
|
||
+---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :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`` |
|
||
+---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`tile_scroll_hint<class_ItemList_property_tile_scroll_hint>` | ``false`` |
|
||
+---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`wraparound_items<class_ItemList_property_wraparound_items>` | ``true`` |
|
||
+---------------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
方法
|
||
----
|
||
|
||
.. 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:`HScrollBar<class_HScrollBar>` | :ref:`get_h_scroll_bar<class_ItemList_method_get_h_scroll_bar>`\ (\ ) |
|
||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :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
|
||
|
||
主題屬性
|
||
--------
|
||
|
||
.. 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_hovered_selected_color<class_ItemList_theme_color_font_hovered_selected_color>` | ``Color(1, 1, 1, 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:`Texture2D<class_Texture2D>` | :ref:`scroll_hint<class_ItemList_theme_icon_scroll_hint>` | |
|
||
+-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------------+
|
||
| :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:`hovered_selected<class_ItemList_theme_style_hovered_selected>` | |
|
||
+-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------------+
|
||
| :ref:`StyleBox<class_StyleBox>` | :ref:`hovered_selected_focus<class_ItemList_theme_style_hovered_selected_focus>` | |
|
||
+-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------------+
|
||
| :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
|
||
|
||
訊號
|
||
----
|
||
|
||
.. _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
|
||
|
||
列舉
|
||
----
|
||
|
||
.. _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``
|
||
|
||
圖示繪製在文字上方。
|
||
|
||
.. _class_ItemList_constant_ICON_MODE_LEFT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`IconMode<enum_ItemList_IconMode>` **ICON_MODE_LEFT** = ``1``
|
||
|
||
圖示繪製在文字的左側。
|
||
|
||
.. 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``
|
||
|
||
僅允許選擇單個專案。
|
||
|
||
.. _class_ItemList_constant_SELECT_MULTI:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`SelectMode<enum_ItemList_SelectMode>` **SELECT_MULTI** = ``1``
|
||
|
||
允許通過按住 :kbd:`Ctrl` 或 :kbd:`Shift` 來選擇多個專案。
|
||
|
||
.. _class_ItemList_constant_SELECT_TOGGLE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`SelectMode<enum_ItemList_SelectMode>` **SELECT_TOGGLE** = ``2``
|
||
|
||
Allows selecting multiple items by toggling them on and off.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_ItemList_ScrollHintMode:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **ScrollHintMode**: :ref:`🔗<enum_ItemList_ScrollHintMode>`
|
||
|
||
.. _class_ItemList_constant_SCROLL_HINT_MODE_DISABLED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ScrollHintMode<enum_ItemList_ScrollHintMode>` **SCROLL_HINT_MODE_DISABLED** = ``0``
|
||
|
||
Scroll hints will never be shown.
|
||
|
||
.. _class_ItemList_constant_SCROLL_HINT_MODE_BOTH:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ScrollHintMode<enum_ItemList_ScrollHintMode>` **SCROLL_HINT_MODE_BOTH** = ``1``
|
||
|
||
Scroll hints will be shown at the top and bottom.
|
||
|
||
.. _class_ItemList_constant_SCROLL_HINT_MODE_TOP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ScrollHintMode<enum_ItemList_ScrollHintMode>` **SCROLL_HINT_MODE_TOP** = ``2``
|
||
|
||
Only the top scroll hint will be shown.
|
||
|
||
.. _class_ItemList_constant_SCROLL_HINT_MODE_BOTTOM:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ScrollHintMode<enum_ItemList_ScrollHintMode>` **SCROLL_HINT_MODE_BOTTOM** = ``3``
|
||
|
||
Only the bottom scroll hint will be shown.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
屬性說明
|
||
--------
|
||
|
||
.. _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**\ (\ )
|
||
|
||
如果為 ``true``\ ,則可以再次選擇目前選中的專案。
|
||
|
||
.. 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**\ (\ )
|
||
|
||
如果為 ``true``\ ,點擊滑鼠右鍵可以選中專案。
|
||
|
||
.. 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**\ (\ )
|
||
|
||
如果為 ``true``\ ,則允許用字母鍵通過差異量搜索導覽 **ItemList**\ 。
|
||
|
||
.. 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**\ (\ )
|
||
|
||
如果為 ``true``\ ,控制項將自動調整高度以適合其內容。
|
||
|
||
.. 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**\ (\ )
|
||
|
||
所有列的寬度將調整為。
|
||
|
||
零值禁用調整,每個專案的寬度將等於其內容的寬度,列的寬度將不均勻。
|
||
|
||
.. 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**\ (\ )
|
||
|
||
所有圖示將被調整到的尺寸。
|
||
|
||
如果 X 或 Y 分量不大於 0,圖示的大小將不會受到影響。
|
||
|
||
.. 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**\ (\ )
|
||
|
||
圖示的位置,是在文字的上方還是在文字的左邊。參閱 :ref:`IconMode<enum_ItemList_IconMode>` 常數。
|
||
|
||
.. 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**\ (\ )
|
||
|
||
在 :ref:`fixed_icon_size<class_ItemList_property_fixed_icon_size>` 和轉置生效後套用的圖示比例。
|
||
|
||
.. 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**\ (\ )
|
||
|
||
目前列表中的專案數。
|
||
|
||
.. 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**\ (\ )
|
||
|
||
列表將具有的最大列。
|
||
|
||
如果大於零,內容將被拆分為指定列。
|
||
|
||
零值意味著無限列,即所有專案將放在同一行中。
|
||
|
||
.. 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**\ (\ )
|
||
|
||
每個子項中允許的最大文字行數。即使沒有足夠的文字行數來顯示,也會保留空間。
|
||
|
||
\ **注意:**\ 這個屬性只有在 :ref:`icon_mode<class_ItemList_property_icon_mode>` 是 :ref:`ICON_MODE_TOP<class_ItemList_constant_ICON_MODE_TOP>` 時才會生效。要使文字自動換行,\ :ref:`fixed_column_width<class_ItemList_property_fixed_column_width>`\ 應大於零。
|
||
|
||
.. 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**\ (\ )
|
||
|
||
是否所有列的寬度相同。
|
||
|
||
如果為 ``true``\ ,則寬度等於所有列的最大列寬度。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_ItemList_property_scroll_hint_mode:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`ScrollHintMode<enum_ItemList_ScrollHintMode>` **scroll_hint_mode** = ``0`` :ref:`🔗<class_ItemList_property_scroll_hint_mode>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_scroll_hint_mode**\ (\ value\: :ref:`ScrollHintMode<enum_ItemList_ScrollHintMode>`\ )
|
||
- :ref:`ScrollHintMode<enum_ItemList_ScrollHintMode>` **get_scroll_hint_mode**\ (\ )
|
||
|
||
The way which scroll hints (indicators that show that the content can still be scrolled in a certain direction) will be shown.
|
||
|
||
.. 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**\ (\ )
|
||
|
||
允許單選或多選。參閱\ :ref:`SelectMode<enum_ItemList_SelectMode>`\ 常數。
|
||
|
||
.. 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**\ (\ )
|
||
|
||
The clipping behavior when the text exceeds an item's bounding rectangle.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_ItemList_property_tile_scroll_hint:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **tile_scroll_hint** = ``false`` :ref:`🔗<class_ItemList_property_tile_scroll_hint>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_tile_scroll_hint**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_scroll_hint_tiled**\ (\ )
|
||
|
||
If ``true``, the scroll hint texture will be tiled instead of stretched. See :ref:`scroll_hint_mode<class_ItemList_property_scroll_hint_mode>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_ItemList_property_wraparound_items:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **wraparound_items** = ``true`` :ref:`🔗<class_ItemList_property_wraparound_items>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_wraparound_items**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **has_wraparound_items**\ (\ )
|
||
|
||
If ``true``, the control will automatically move items into a new row to fit its content. See also :ref:`HFlowContainer<class_HFlowContainer>` for this behavior.
|
||
|
||
If ``false``, the control will add a horizontal scrollbar to make all items visible.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
方法說明
|
||
--------
|
||
|
||
.. _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>`
|
||
|
||
將一個專案新增到專案列表中,沒有文字,只有一個圖示。返回新增的項的索引。
|
||
|
||
.. 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>`
|
||
|
||
移除列表中的所有專案。
|
||
|
||
.. 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>`
|
||
|
||
確保與指定索引相關的專案不被選中。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_ItemList_method_deselect_all:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **deselect_all**\ (\ ) :ref:`🔗<class_ItemList_method_deselect_all>`
|
||
|
||
確保沒有選擇任何專案。
|
||
|
||
.. 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>`
|
||
|
||
確保目前選擇可見,根據需要調整滾動位置。
|
||
|
||
.. 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>`
|
||
|
||
根據其專案強制更新列表大小。只要專案的大小或其他相關設定(例如 :ref:`auto_height<class_ItemList_property_auto_height>`\ )發生更改,這種情況就會自動發生。該方法可用於在下方一次繪圖前觸發更新。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_ItemList_method_get_h_scroll_bar:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`HScrollBar<class_HScrollBar>` **get_h_scroll_bar**\ (\ ) :ref:`🔗<class_ItemList_method_get_h_scroll_bar>`
|
||
|
||
Returns the horizontal 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_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>`
|
||
|
||
返回位於給定位置 ``position`` 的專案的索引。
|
||
|
||
這個位置沒有專案時,如果 ``exact`` 為 ``true`` 則會返回 -1,否則會返回距離最近的專案的索引。
|
||
|
||
\ **注意:**\ 如果修改 **ItemList** 後立即呼叫,尚未在下一影格中重繪,則返回值不可靠。
|
||
|
||
.. 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>`
|
||
|
||
返回專案的自訂背景色,專案由索引 ``idx`` 指定。
|
||
|
||
.. 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>`
|
||
|
||
返回專案的自訂前景色,專案由索引 ``idx`` 指定。
|
||
|
||
.. 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>`
|
||
|
||
返回與指定索引相關的圖示。
|
||
|
||
.. 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>`
|
||
|
||
返回指定索引處的 :ref:`Color<class_Color>` 顏色調變項的圖示。
|
||
|
||
.. 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>`
|
||
|
||
返回專案圖示的使用區域。如果該區域大小為 0,整個圖示將被使用。
|
||
|
||
.. 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>`
|
||
|
||
返回專案文字的語言程式碼。
|
||
|
||
.. 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>`
|
||
|
||
返回指定索引的中繼資料值。
|
||
|
||
.. 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>`
|
||
|
||
返回具有給定索引的專案的位置和大小,使用 **ItemList** 節點的坐標系。如果 ``expand`` 為 ``true``\ ,則會將最後一列進行擴充,充滿該行剩餘的大小。
|
||
|
||
\ **注意:**\ 如果修改 **ItemList** 後立即呼叫,尚未在下一影格中重繪,則返回值不可靠。
|
||
|
||
.. 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>`
|
||
|
||
返回與指定索引關聯的文字。
|
||
|
||
.. 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>`
|
||
|
||
返回專案文字的基礎書寫方向。
|
||
|
||
.. 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>`
|
||
|
||
返回與指定索引關聯的工具提示。
|
||
|
||
.. 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>`
|
||
|
||
返回一個包含所選專案索引的陣列。
|
||
|
||
.. 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>`
|
||
|
||
返回垂直捲動條。
|
||
|
||
\ **警告:**\ 這是一個必需的內部節點,刪除和釋放它可能會導致當機。如果你希望隱藏它或其任何子項,請使用它們的 :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` 屬性。
|
||
|
||
.. 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>`
|
||
|
||
選中了一個或多個專案時,返回 ``true``\ 。
|
||
|
||
.. 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>`
|
||
|
||
索引所對應的專案被禁用時,返回 ``true``\ 。
|
||
|
||
.. 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>`
|
||
|
||
專案圖示被轉置繪製,即 X 和 Y 軸互換時,返回 ``true``\ 。
|
||
|
||
.. 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>`
|
||
|
||
索引所對應的專案可以被選中時,返回 ``true``\ 。
|
||
|
||
.. 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>`
|
||
|
||
索引所對應的專案已啟用工具提示時,返回 ``true``\ 。
|
||
|
||
.. 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>`
|
||
|
||
索引所對應的專案被選中時,返回 ``true``\ 。
|
||
|
||
.. 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>`
|
||
|
||
將專案從索引 ``from_idx`` 移到 ``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>`
|
||
|
||
從列表中刪除索引 ``idx`` 指定的專案。
|
||
|
||
.. 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>`
|
||
|
||
選擇指定索引處的專案。
|
||
|
||
\ **注意:**\ 此方法不觸發專案選擇訊號。
|
||
|
||
.. 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>`
|
||
|
||
將索引 ``idx`` 指定的專案的背景色設定為指定的 :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>`
|
||
|
||
將索引 ``idx`` 指定的專案的前景色設定為指定的 :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>`
|
||
|
||
禁用(或啟用)指定索引處的專案。
|
||
|
||
禁用的專案不能被選中,也不會觸發(按兩下或按 :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>`
|
||
|
||
設定(或替換)與指定索引關聯的圖示 :ref:`Texture2D<class_Texture2D>`\ 。
|
||
|
||
.. 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>`
|
||
|
||
設定與指定索引相關的專案的調變顏色 :ref:`Color<class_Color>`\ 。
|
||
|
||
.. 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>`
|
||
|
||
設定專案圖示的使用區域。如果該區域大小為 0,將使用整個圖示。
|
||
|
||
.. 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>`
|
||
|
||
設定專案圖示是否將被轉置繪製。
|
||
|
||
.. 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 the language code of the text for the item at the given index to ``language``. This is used for line-breaking and text shaping algorithms. If ``language`` is empty, the current locale is used.
|
||
|
||
.. 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>`
|
||
|
||
設定與指定索引相關的專案儲存的值(任何型別的值)。
|
||
|
||
.. 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>`
|
||
|
||
允許或禁止選擇與指定索引關聯的專案。
|
||
|
||
.. 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>`
|
||
|
||
設定與指定索引相關的專案的文字。
|
||
|
||
.. 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>`
|
||
|
||
設定專案文字的基礎書寫方向。
|
||
|
||
.. 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>`
|
||
|
||
設定與指定索引相關的專案的工具提示。
|
||
|
||
.. 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>`
|
||
|
||
設定是否為指定的專案索引啟用工具提示。
|
||
|
||
.. 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>`
|
||
|
||
按文字對列表中的專案進行排序。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
主題屬性說明
|
||
------------
|
||
|
||
.. _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>`
|
||
|
||
專案的預設文字顏色 :ref:`Color<class_Color>`\ 。
|
||
|
||
.. 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>`
|
||
|
||
專案處於懸停但未選中狀態時使用的文字 :ref:`Color<class_Color>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_ItemList_theme_color_font_hovered_selected_color:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **font_hovered_selected_color** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_ItemList_theme_color_font_hovered_selected_color>`
|
||
|
||
Text :ref:`Color<class_Color>` used when the item is hovered and selected.
|
||
|
||
.. 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>`
|
||
|
||
專案文字輪廓的色調。
|
||
|
||
.. 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, but not hovered.
|
||
|
||
.. 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>`\ 。輔助線是在每行專案之間畫的一條線。
|
||
|
||
.. 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>`
|
||
|
||
專案之間的水平間距。
|
||
|
||
.. 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>`
|
||
|
||
專案的圖示和文字之間的間距。
|
||
|
||
.. 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>`
|
||
|
||
每行文字之間的行距。
|
||
|
||
.. 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>`
|
||
|
||
專案文字輪廓的大小。
|
||
|
||
\ **注意:**\ 如果使用啟用了 :ref:`FontFile.multichannel_signed_distance_field<class_FontFile_property_multichannel_signed_distance_field>` 的字形,其 :ref:`FontFile.msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` 必須至少設定為 :ref:`outline_size<class_ItemList_theme_constant_outline_size>` 的\ *兩倍*\ ,輪廓算繪才能看起來正確。否則,輪廓可能會比預期的更早被切斷。
|
||
|
||
.. 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>`
|
||
|
||
專案選單之間的垂直間距。
|
||
|
||
.. 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>` 。
|
||
|
||
.. 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>`
|
||
|
||
專案文字的字形大小。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_ItemList_theme_icon_scroll_hint:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Texture2D<class_Texture2D>` **scroll_hint** :ref:`🔗<class_ItemList_theme_icon_scroll_hint>`
|
||
|
||
The indicator that will be shown when the content can still be scrolled. See :ref:`scroll_hint_mode<class_ItemList_property_scroll_hint_mode>`.
|
||
|
||
.. 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>`
|
||
|
||
當該 **ItemList** 獲得焦點時,用作游標的樣式盒 :ref:`StyleBox<class_StyleBox>`\ 。
|
||
|
||
.. 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>`
|
||
|
||
當該 **ItemList** 未獲得焦點時,用作游標的樣式盒 :ref:`StyleBox<class_StyleBox>`\ 。
|
||
|
||
.. 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 everything.
|
||
|
||
.. 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>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_ItemList_theme_style_hovered_selected:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`StyleBox<class_StyleBox>` **hovered_selected** :ref:`🔗<class_ItemList_theme_style_hovered_selected>`
|
||
|
||
:ref:`StyleBox<class_StyleBox>` for the hovered and selected items, used when the **ItemList** is not being focused.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_ItemList_theme_style_hovered_selected_focus:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`StyleBox<class_StyleBox>` **hovered_selected_focus** :ref:`🔗<class_ItemList_theme_style_hovered_selected_focus>`
|
||
|
||
:ref:`StyleBox<class_StyleBox>` for the hovered and selected items, used when the **ItemList** is being focused.
|
||
|
||
.. 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>`
|
||
|
||
該 **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>`\ ,當該 **ItemList** 未獲得焦點時使用。
|
||
|
||
.. 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>`\ ,當該 **ItemList** 獲得焦點時使用。
|
||
|
||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要使用者覆寫才能生效。)`
|
||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||
.. |const| replace:: :abbr:`const (本方法沒有副作用。不會修改該實例的任何成員變數。)`
|
||
.. |vararg| replace:: :abbr:`vararg (本方法除了這裡描述的參數外,還可以接受任意數量的參數。)`
|
||
.. |constructor| replace:: :abbr:`constructor (本方法用於建構一個型別。)`
|
||
.. |static| replace:: :abbr:`static (本方法無需實例即可呼叫,因此可以直接使用類別名稱呼叫。)`
|
||
.. |operator| replace:: :abbr:`operator (本方法描述將本型別作為左運算元時可用的有效運算子。)`
|
||
.. |bitfield| replace:: :abbr:`BitField (此值是由下列旗標組成的位元遮罩整數。)`
|
||
.. |void| replace:: :abbr:`void (無回傳值。)`
|