mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-05 14:10:19 +03:00
1407 lines
70 KiB
ReStructuredText
1407 lines
70 KiB
ReStructuredText
: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
|
||
========
|
||
|
||
**继承:** :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>` | 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
|
||
|
||
方法
|
||
----
|
||
|
||
.. 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:`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_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_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
|
||
|
||
信号
|
||
----
|
||
|
||
.. _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>`
|
||
|
||
在列表矩形内的非空白区域点击鼠标时触发。
|
||
|
||
.. 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>`
|
||
|
||
通过双击或按\ :kbd:`回车`\ 键激活指定的列表项时触发。
|
||
|
||
.. 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>`
|
||
|
||
鼠标按键单击指定的列表项时触发。
|
||
|
||
还提供了单击的位置,这样就能够在正确位置弹出相应的上下文菜单。
|
||
|
||
.. 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>`
|
||
|
||
选择指定项目时触发。
|
||
|
||
\ :ref:`allow_reselect<class_ItemList_property_allow_reselect>` 必须启用才能重新选择项目。
|
||
|
||
.. 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>`
|
||
|
||
在允许多选的列表上更改多选时触发。
|
||
|
||
.. 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` 来选择多个项目。
|
||
|
||
.. 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_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_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**\ (\ )
|
||
|
||
设置文本超出项目的边界矩形时的裁剪行为。所有模式的说明见 :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>`\ 。
|
||
|
||
.. 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>`
|
||
|
||
将一个项目添加到项目列表中,并指定文本。返回添加的项目的索引。
|
||
|
||
指定一个 ``icon``\ ,或列表项没有图标时使用 ``null`` 作为 ``icon``\ 。
|
||
|
||
如果 selectable 为 ``true``\ ,则列表项将是可选择的。
|
||
|
||
.. 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_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_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_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>`
|
||
|
||
设置项目文本的语言代码,用于断行和文本塑形算法,如果留空则使用当前区域设置。
|
||
|
||
.. 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_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>`
|
||
|
||
选择项目时使用的文本颜色 :ref:`Color<class_Color>`\ 。
|
||
|
||
.. 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_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>`
|
||
|
||
该 **ItemList** 的焦点样式,绘制在背景之上,但低于其他东西。
|
||
|
||
.. 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_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 (本方法通常需要用户覆盖才能生效。)`
|
||
.. |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 (无返回值。)`
|