| 
									
										
										
										
											2023-01-05 13:25:55 +01:00
										 |  |  | /**************************************************************************/ | 
					
						
							|  |  |  | /*  item_list.h                                                           */ | 
					
						
							|  |  |  | /**************************************************************************/ | 
					
						
							|  |  |  | /*                         This file is part of:                          */ | 
					
						
							|  |  |  | /*                             GODOT ENGINE                               */ | 
					
						
							|  |  |  | /*                        https://godotengine.org                         */ | 
					
						
							|  |  |  | /**************************************************************************/ | 
					
						
							|  |  |  | /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ | 
					
						
							|  |  |  | /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                  */ | 
					
						
							|  |  |  | /*                                                                        */ | 
					
						
							|  |  |  | /* Permission is hereby granted, free of charge, to any person obtaining  */ | 
					
						
							|  |  |  | /* a copy of this software and associated documentation files (the        */ | 
					
						
							|  |  |  | /* "Software"), to deal in the Software without restriction, including    */ | 
					
						
							|  |  |  | /* without limitation the rights to use, copy, modify, merge, publish,    */ | 
					
						
							|  |  |  | /* distribute, sublicense, and/or sell copies of the Software, and to     */ | 
					
						
							|  |  |  | /* permit persons to whom the Software is furnished to do so, subject to  */ | 
					
						
							|  |  |  | /* the following conditions:                                              */ | 
					
						
							|  |  |  | /*                                                                        */ | 
					
						
							|  |  |  | /* The above copyright notice and this permission notice shall be         */ | 
					
						
							|  |  |  | /* included in all copies or substantial portions of the Software.        */ | 
					
						
							|  |  |  | /*                                                                        */ | 
					
						
							|  |  |  | /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,        */ | 
					
						
							|  |  |  | /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF     */ | 
					
						
							|  |  |  | /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ | 
					
						
							|  |  |  | /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY   */ | 
					
						
							|  |  |  | /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,   */ | 
					
						
							|  |  |  | /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE      */ | 
					
						
							|  |  |  | /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                 */ | 
					
						
							|  |  |  | /**************************************************************************/ | 
					
						
							| 
									
										
										
										
											2018-01-05 00:50:27 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-23 23:41:51 +02:00
										 |  |  | #ifndef ITEM_LIST_H
 | 
					
						
							|  |  |  | #define ITEM_LIST_H
 | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include "scene/gui/control.h"
 | 
					
						
							|  |  |  | #include "scene/gui/scroll_bar.h"
 | 
					
						
							| 
									
										
										
										
											2023-11-08 23:16:17 +01:00
										 |  |  | #include "scene/property_list_helper.h"
 | 
					
						
							| 
									
										
										
										
											2020-09-03 14:22:16 +03:00
										 |  |  | #include "scene/resources/text_paragraph.h"
 | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | class ItemList : public Control { | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	GDCLASS(ItemList, Control); | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 	enum IconMode { | 
					
						
							|  |  |  | 		ICON_MODE_TOP, | 
					
						
							|  |  |  | 		ICON_MODE_LEFT | 
					
						
							|  |  |  | 	}; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	enum SelectMode { | 
					
						
							|  |  |  | 		SELECT_SINGLE, | 
					
						
							| 
									
										
										
										
											2024-11-11 20:54:37 +01:00
										 |  |  | 		SELECT_MULTI, | 
					
						
							|  |  |  | 		SELECT_TOGGLE, | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 	}; | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | private: | 
					
						
							|  |  |  | 	struct Item { | 
					
						
							| 
									
										
										
										
											2019-06-11 15:43:37 -03:00
										 |  |  | 		Ref<Texture2D> icon; | 
					
						
							| 
									
										
										
										
											2021-02-09 18:24:36 +01:00
										 |  |  | 		bool icon_transposed = false; | 
					
						
							| 
									
										
										
										
											2016-03-13 12:23:49 -03:00
										 |  |  | 		Rect2i icon_region; | 
					
						
							| 
									
										
										
										
											2021-10-27 18:29:44 +02:00
										 |  |  | 		Color icon_modulate = Color(1, 1, 1, 1); | 
					
						
							| 
									
										
										
										
											2019-06-11 15:43:37 -03:00
										 |  |  | 		Ref<Texture2D> tag_icon; | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 		String text; | 
					
						
							| 
									
										
										
										
											2023-10-18 21:06:28 +02:00
										 |  |  | 		String xl_text; | 
					
						
							| 
									
										
										
										
											2020-09-03 14:22:16 +03:00
										 |  |  | 		Ref<TextParagraph> text_buf; | 
					
						
							|  |  |  | 		String language; | 
					
						
							|  |  |  | 		TextDirection text_direction = TEXT_DIRECTION_AUTO; | 
					
						
							| 
									
										
										
										
											2024-09-27 10:11:09 +08:00
										 |  |  | 		AutoTranslateMode auto_translate_mode = AUTO_TRANSLATE_MODE_INHERIT; | 
					
						
							| 
									
										
										
										
											2020-09-03 14:22:16 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-07 23:26:27 +01:00
										 |  |  | 		bool selectable = true; | 
					
						
							| 
									
										
										
										
											2021-02-09 18:24:36 +01:00
										 |  |  | 		bool selected = false; | 
					
						
							|  |  |  | 		bool disabled = false; | 
					
						
							| 
									
										
										
										
											2021-10-27 18:29:44 +02:00
										 |  |  | 		bool tooltip_enabled = true; | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 		Variant metadata; | 
					
						
							|  |  |  | 		String tooltip; | 
					
						
							| 
									
										
										
										
											2017-09-03 02:44:59 -05:00
										 |  |  | 		Color custom_fg; | 
					
						
							| 
									
										
										
										
											2021-10-27 18:29:44 +02:00
										 |  |  | 		Color custom_bg = Color(0.0, 0.0, 0.0, 0.0); | 
					
						
							| 
									
										
										
										
											2015-06-22 00:03:19 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-09 12:57:59 +01:00
										 |  |  | 		int column = 0; | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 		Rect2 rect_cache; | 
					
						
							| 
									
										
										
										
											2016-05-27 22:42:51 +03:00
										 |  |  | 		Rect2 min_rect_cache; | 
					
						
							| 
									
										
										
										
											2015-06-22 00:03:19 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-13 12:23:49 -03:00
										 |  |  | 		Size2 get_icon_size() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 		bool operator<(const Item &p_another) const { return text < p_another.text; } | 
					
						
							| 
									
										
										
										
											2021-10-27 18:29:44 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		Item() { | 
					
						
							|  |  |  | 			text_buf.instantiate(); | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2023-11-08 23:16:17 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		Item(bool p_dummy) {} | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 	}; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-11 12:09:55 +01:00
										 |  |  | 	static inline PropertyListHelper base_property_helper; | 
					
						
							| 
									
										
										
										
											2023-11-08 23:16:17 +01:00
										 |  |  | 	PropertyListHelper property_helper; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-09 18:24:36 +01:00
										 |  |  | 	int current = -1; | 
					
						
							| 
									
										
										
										
											2023-03-10 19:28:35 +01:00
										 |  |  | 	int hovered = -1; | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-09 18:24:36 +01:00
										 |  |  | 	bool shape_changed = true; | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-09 18:24:36 +01:00
										 |  |  | 	bool ensure_selected_visible = false; | 
					
						
							|  |  |  | 	bool same_column_width = false; | 
					
						
							| 
									
										
										
										
											2023-04-17 23:50:24 -07:00
										 |  |  | 	bool allow_search = true; | 
					
						
							| 
									
										
										
										
											2015-08-23 20:15:56 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-17 17:58:59 +02:00
										 |  |  | 	bool auto_width = false; | 
					
						
							|  |  |  | 	float auto_width_value = 0.0; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-09 18:24:36 +01:00
										 |  |  | 	bool auto_height = false; | 
					
						
							|  |  |  | 	float auto_height_value = 0.0; | 
					
						
							| 
									
										
										
										
											2017-07-21 13:17:06 +07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-01 11:28:22 +02:00
										 |  |  | 	bool wraparound_items = true; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 	Vector<Item> items; | 
					
						
							|  |  |  | 	Vector<int> separators; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-09 18:24:36 +01:00
										 |  |  | 	SelectMode select_mode = SELECT_SINGLE; | 
					
						
							|  |  |  | 	IconMode icon_mode = ICON_MODE_LEFT; | 
					
						
							| 
									
										
										
										
											2024-10-01 11:28:22 +02:00
										 |  |  | 	VScrollBar *scroll_bar_v = nullptr; | 
					
						
							|  |  |  | 	HScrollBar *scroll_bar_h = nullptr; | 
					
						
							| 
									
										
										
										
											2022-06-15 11:01:45 +03:00
										 |  |  | 	TextServer::OverrunBehavior text_overrun_behavior = TextServer::OVERRUN_TRIM_ELLIPSIS; | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-09 18:24:36 +01:00
										 |  |  | 	uint64_t search_time_msec = 0; | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 	String search_string; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-09 18:24:36 +01:00
										 |  |  | 	int current_columns = 1; | 
					
						
							|  |  |  | 	int fixed_column_width = 0; | 
					
						
							|  |  |  | 	int max_text_lines = 1; | 
					
						
							|  |  |  | 	int max_columns = 1; | 
					
						
							| 
									
										
										
										
											2016-05-27 22:42:51 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-12 16:51:27 -03:00
										 |  |  | 	Size2 fixed_icon_size; | 
					
						
							| 
									
										
										
										
											2016-05-27 22:42:51 +03:00
										 |  |  | 	Size2 max_item_size_cache; | 
					
						
							| 
									
										
										
										
											2024-06-01 21:15:16 -04:00
										 |  |  | 	Size2 fixed_tag_icon_size; | 
					
						
							| 
									
										
										
										
											2016-05-27 22:42:51 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-09 18:24:36 +01:00
										 |  |  | 	int defer_select_single = -1; | 
					
						
							|  |  |  | 	bool allow_rmb_select = false; | 
					
						
							|  |  |  | 	bool allow_reselect = false; | 
					
						
							| 
									
										
										
										
											2018-02-14 01:24:57 -02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-09 18:24:36 +01:00
										 |  |  | 	real_t icon_scale = 1.0; | 
					
						
							| 
									
										
										
										
											2016-05-27 18:54:46 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-09 18:24:36 +01:00
										 |  |  | 	bool do_autoscroll_to_bottom = false; | 
					
						
							| 
									
										
										
										
											2017-12-18 01:16:11 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-31 15:02:40 +03:00
										 |  |  | 	struct ThemeCache { | 
					
						
							|  |  |  | 		int h_separation = 0; | 
					
						
							|  |  |  | 		int v_separation = 0; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-06 20:09:32 +03:00
										 |  |  | 		Ref<StyleBox> panel_style; | 
					
						
							|  |  |  | 		Ref<StyleBox> focus_style; | 
					
						
							| 
									
										
										
										
											2022-08-31 15:02:40 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		Ref<Font> font; | 
					
						
							|  |  |  | 		int font_size = 0; | 
					
						
							|  |  |  | 		Color font_color; | 
					
						
							| 
									
										
										
										
											2023-03-10 19:28:35 +01:00
										 |  |  | 		Color font_hovered_color; | 
					
						
							| 
									
										
										
										
											2024-11-11 19:38:46 +01:00
										 |  |  | 		Color font_hovered_selected_color; | 
					
						
							| 
									
										
										
										
											2022-08-31 15:02:40 +03:00
										 |  |  | 		Color font_selected_color; | 
					
						
							|  |  |  | 		int font_outline_size = 0; | 
					
						
							|  |  |  | 		Color font_outline_color; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		int line_separation = 0; | 
					
						
							|  |  |  | 		int icon_margin = 0; | 
					
						
							| 
									
										
										
										
											2023-03-10 19:28:35 +01:00
										 |  |  | 		Ref<StyleBox> hovered_style; | 
					
						
							| 
									
										
										
										
											2024-11-11 19:38:46 +01:00
										 |  |  | 		Ref<StyleBox> hovered_selected_style; | 
					
						
							|  |  |  | 		Ref<StyleBox> hovered_selected_focus_style; | 
					
						
							| 
									
										
										
										
											2022-08-31 15:02:40 +03:00
										 |  |  | 		Ref<StyleBox> selected_style; | 
					
						
							|  |  |  | 		Ref<StyleBox> selected_focus_style; | 
					
						
							|  |  |  | 		Ref<StyleBox> cursor_style; | 
					
						
							|  |  |  | 		Ref<StyleBox> cursor_focus_style; | 
					
						
							|  |  |  | 		Color guide_color; | 
					
						
							|  |  |  | 	} theme_cache; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 	void _scroll_changed(double); | 
					
						
							| 
									
										
										
										
											2023-03-09 12:57:59 +01:00
										 |  |  | 	void _shape_text(int p_idx); | 
					
						
							| 
									
										
										
										
											2023-03-10 19:28:35 +01:00
										 |  |  | 	void _mouse_exited(); | 
					
						
							| 
									
										
										
										
											2016-06-12 16:51:27 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-27 10:11:09 +08:00
										 |  |  | 	String _atr(int p_idx, const String &p_text) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | protected: | 
					
						
							|  |  |  | 	void _notification(int p_what); | 
					
						
							| 
									
										
										
										
											2021-10-27 18:29:44 +02:00
										 |  |  | 	bool _set(const StringName &p_name, const Variant &p_value); | 
					
						
							| 
									
										
										
										
											2024-02-11 12:09:55 +01:00
										 |  |  | 	bool _get(const StringName &p_name, Variant &r_ret) const { return property_helper.property_get_value(p_name, r_ret); } | 
					
						
							| 
									
										
										
										
											2024-05-23 17:10:55 +02:00
										 |  |  | 	void _get_property_list(List<PropertyInfo> *p_list) const { property_helper.get_property_list(p_list); } | 
					
						
							| 
									
										
										
										
											2024-02-11 12:09:55 +01:00
										 |  |  | 	bool _property_can_revert(const StringName &p_name) const { return property_helper.property_can_revert(p_name); } | 
					
						
							|  |  |  | 	bool _property_get_revert(const StringName &p_name, Variant &r_property) const { return property_helper.property_get_revert(p_name, r_property); } | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 	static void _bind_methods(); | 
					
						
							| 
									
										
										
										
											2016-05-03 11:10:28 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2021-08-22 12:37:22 -03:00
										 |  |  | 	virtual void gui_input(const Ref<InputEvent> &p_event) override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-17 22:45:08 +01:00
										 |  |  | 	int add_item(const String &p_item, const Ref<Texture2D> &p_texture = Ref<Texture2D>(), bool p_selectable = true); | 
					
						
							|  |  |  | 	int add_icon_item(const Ref<Texture2D> &p_item, bool p_selectable = true); | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	void set_item_text(int p_idx, const String &p_text); | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 	String get_item_text(int p_idx) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-03 14:22:16 +03:00
										 |  |  | 	void set_item_text_direction(int p_idx, TextDirection p_text_direction); | 
					
						
							|  |  |  | 	TextDirection get_item_text_direction(int p_idx) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	void set_item_language(int p_idx, const String &p_language); | 
					
						
							|  |  |  | 	String get_item_language(int p_idx) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-27 10:11:09 +08:00
										 |  |  | 	void set_item_auto_translate_mode(int p_idx, AutoTranslateMode p_mode); | 
					
						
							|  |  |  | 	AutoTranslateMode get_item_auto_translate_mode(int p_idx) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-11 15:43:37 -03:00
										 |  |  | 	void set_item_icon(int p_idx, const Ref<Texture2D> &p_icon); | 
					
						
							|  |  |  | 	Ref<Texture2D> get_item_icon(int p_idx) const; | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-29 17:16:18 +01:00
										 |  |  | 	void set_item_icon_transposed(int p_idx, const bool transposed); | 
					
						
							|  |  |  | 	bool is_item_icon_transposed(int p_idx) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	void set_item_icon_region(int p_idx, const Rect2 &p_region); | 
					
						
							| 
									
										
										
										
											2016-03-13 12:23:49 -03:00
										 |  |  | 	Rect2 get_item_icon_region(int p_idx) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-11 21:59:50 +07:00
										 |  |  | 	void set_item_icon_modulate(int p_idx, const Color &p_modulate); | 
					
						
							|  |  |  | 	Color get_item_icon_modulate(int p_idx) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	void set_item_selectable(int p_idx, bool p_selectable); | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 	bool is_item_selectable(int p_idx) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	void set_item_disabled(int p_idx, bool p_disabled); | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 	bool is_item_disabled(int p_idx) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	void set_item_metadata(int p_idx, const Variant &p_metadata); | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 	Variant get_item_metadata(int p_idx) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-11 15:43:37 -03:00
										 |  |  | 	void set_item_tag_icon(int p_idx, const Ref<Texture2D> &p_tag_icon); | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-07 16:21:20 +01:00
										 |  |  | 	void set_item_tooltip_enabled(int p_idx, const bool p_enabled); | 
					
						
							|  |  |  | 	bool is_item_tooltip_enabled(int p_idx) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	void set_item_tooltip(int p_idx, const String &p_tooltip); | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 	String get_item_tooltip(int p_idx) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	void set_item_custom_bg_color(int p_idx, const Color &p_custom_bg_color); | 
					
						
							| 
									
										
										
										
											2015-06-22 00:03:19 -03:00
										 |  |  | 	Color get_item_custom_bg_color(int p_idx) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-03 02:44:59 -05:00
										 |  |  | 	void set_item_custom_fg_color(int p_idx, const Color &p_custom_fg_color); | 
					
						
							|  |  |  | 	Color get_item_custom_fg_color(int p_idx) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-08 09:57:49 +02:00
										 |  |  | 	Rect2 get_item_rect(int p_idx, bool p_expand = true) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-06-15 11:01:45 +03:00
										 |  |  | 	void set_text_overrun_behavior(TextServer::OverrunBehavior p_behavior); | 
					
						
							|  |  |  | 	TextServer::OverrunBehavior get_text_overrun_behavior() const; | 
					
						
							| 
									
										
										
										
											2021-08-21 00:22:09 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	void select(int p_idx, bool p_single = true); | 
					
						
							| 
									
										
										
										
											2020-12-21 10:26:41 +00:00
										 |  |  | 	void deselect(int p_idx); | 
					
						
							|  |  |  | 	void deselect_all(); | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 	bool is_selected(int p_idx) const; | 
					
						
							| 
									
										
										
										
											2016-06-28 14:09:17 -03:00
										 |  |  | 	Vector<int> get_selected_items(); | 
					
						
							| 
									
										
										
										
											2017-11-24 16:39:02 +03:00
										 |  |  | 	bool is_anything_selected(); | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	void set_current(int p_current); | 
					
						
							|  |  |  | 	int get_current() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-13 15:19:04 +01:00
										 |  |  | 	void move_item(int p_from_idx, int p_to_idx); | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-27 18:29:44 +02:00
										 |  |  | 	void set_item_count(int p_count); | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 	int get_item_count() const; | 
					
						
							|  |  |  | 	void remove_item(int p_idx); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	void clear(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	void set_fixed_column_width(int p_size); | 
					
						
							|  |  |  | 	int get_fixed_column_width() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-27 22:42:51 +03:00
										 |  |  | 	void set_same_column_width(bool p_enable); | 
					
						
							| 
									
										
										
										
											2017-08-11 13:34:06 +02:00
										 |  |  | 	bool is_same_column_width() const; | 
					
						
							| 
									
										
										
										
											2016-05-27 22:42:51 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-08-11 15:10:05 -04:00
										 |  |  | 	void set_max_text_lines(int p_lines); | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 	int get_max_text_lines() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	void set_max_columns(int p_amount); | 
					
						
							|  |  |  | 	int get_max_columns() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	void set_select_mode(SelectMode p_mode); | 
					
						
							|  |  |  | 	SelectMode get_select_mode() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	void set_icon_mode(IconMode p_mode); | 
					
						
							|  |  |  | 	IconMode get_icon_mode() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-13 14:22:07 -03:00
										 |  |  | 	void set_fixed_icon_size(const Size2i &p_size); | 
					
						
							|  |  |  | 	Size2i get_fixed_icon_size() const; | 
					
						
							| 
									
										
										
										
											2016-05-14 23:48:23 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-01 21:15:16 -04:00
										 |  |  | 	void set_fixed_tag_icon_size(const Size2i &p_size); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-15 20:25:51 -03:00
										 |  |  | 	void set_allow_rmb_select(bool p_allow); | 
					
						
							|  |  |  | 	bool get_allow_rmb_select() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-14 01:24:57 -02:00
										 |  |  | 	void set_allow_reselect(bool p_allow); | 
					
						
							|  |  |  | 	bool get_allow_reselect() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-17 23:50:24 -07:00
										 |  |  | 	void set_allow_search(bool p_allow); | 
					
						
							|  |  |  | 	bool get_allow_search() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 	void ensure_current_is_visible(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-06-22 00:03:19 -03:00
										 |  |  | 	void sort_items_by_text(); | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	int find_metadata(const Variant &p_metadata) const; | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-10 11:34:39 +01:00
										 |  |  | 	virtual String get_tooltip(const Point2 &p_pos) const override; | 
					
						
							| 
									
										
										
										
											2017-09-10 15:37:49 +02:00
										 |  |  | 	int get_item_at_position(const Point2 &p_pos, bool p_exact = false) const; | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	bool is_pos_at_end_of_items(const Point2 &p_pos) const; | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-27 18:54:46 +02:00
										 |  |  | 	void set_icon_scale(real_t p_scale); | 
					
						
							|  |  |  | 	real_t get_icon_scale() const; | 
					
						
							| 
									
										
										
										
											2016-05-24 19:09:58 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-17 17:58:59 +02:00
										 |  |  | 	void set_auto_width(bool p_enable); | 
					
						
							|  |  |  | 	bool has_auto_width() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-21 13:17:06 +07:00
										 |  |  | 	void set_auto_height(bool p_enable); | 
					
						
							|  |  |  | 	bool has_auto_height() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-01 11:28:22 +02:00
										 |  |  | 	void set_wraparound_items(bool p_enable); | 
					
						
							|  |  |  | 	bool has_wraparound_items() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-10 11:34:39 +01:00
										 |  |  | 	Size2 get_minimum_size() const override; | 
					
						
							| 
									
										
										
										
											2017-07-21 13:17:06 +07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-18 01:16:11 +03:00
										 |  |  | 	void set_autoscroll_to_bottom(const bool p_enable); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-29 12:49:14 -04:00
										 |  |  | 	void force_update_list_size(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-01 11:28:22 +02:00
										 |  |  | 	VScrollBar *get_v_scroll_bar() { return scroll_bar_v; } | 
					
						
							|  |  |  | 	HScrollBar *get_h_scroll_bar() { return scroll_bar_h; } | 
					
						
							| 
									
										
										
										
											2016-09-09 15:20:57 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-06-06 09:44:38 -03:00
										 |  |  | 	ItemList(); | 
					
						
							|  |  |  | 	~ItemList(); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | VARIANT_ENUM_CAST(ItemList::SelectMode); | 
					
						
							|  |  |  | VARIANT_ENUM_CAST(ItemList::IconMode); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-23 23:41:51 +02:00
										 |  |  | #endif // ITEM_LIST_H
 |