32 #include "scene/gui/control.h" 33 #include "scene/gui/popup_menu.h" 34 #include "scene/gui/line_edit.h" 35 #include "scene/gui/scroll_bar.h" 36 #include "scene/gui/slider.h" 70 double min,max,step,val;
84 ObjectID custom_draw_obj;
91 Button() {
id=0; disabled=
false; }
109 custom_bg_color=
false;
115 Size2 get_icon_size()
const;
116 void draw_icon(
const RID& p_where,
const Point2& p_pos,
const Size2& p_size=
Size2())
const;
134 void _changed_notify(
int p_cell);
135 void _changed_notify();
136 void _cell_selected(
int p_cell);
137 void _cell_deselected(
int p_cell);
140 static void _bind_methods();
142 Dictionary _get_range_config(
int p_column ) {
145 get_range_config(p_column,min,max,step);
153 void _remove_child(
Object *p_child) { remove_child( p_child->cast_to<
TreeItem>() ); }
157 void set_cell_mode(
int p_column,
TreeCellMode p_mode );
161 void set_checked(
int p_column,
bool p_checked);
162 bool is_checked(
int p_column)
const;
164 void set_text(
int p_column,
String p_text);
165 String get_text(
int p_column)
const;
170 void set_icon_region(
int p_column,
const Rect2& p_icon_region);
171 Rect2 get_icon_region(
int p_column)
const;
173 void set_icon_max_width(
int p_column,
int p_max);
174 int get_icon_max_width(
int p_column)
const;
176 void add_button(
int p_column,
const Ref<Texture>& p_button,
int p_id=-1,
bool p_disabled=
false);
177 int get_button_count(
int p_column)
const;
179 int get_button_id(
int p_column,
int p_idx)
const;
180 void erase_button(
int p_column,
int p_idx);
181 int get_button_by_id(
int p_column,
int p_id)
const;
182 bool is_button_disabled(
int p_column,
int p_idx)
const;
183 void set_button(
int p_column,
int p_idx,
const Ref<Texture>& p_button);
187 void set_range(
int p_column,
double p_value);
188 double get_range(
int p_column)
const;
190 void set_range_config(
int p_column,
double p_min,
double p_max,
double p_step,
bool p_exp=
false);
191 void get_range_config(
int p_column,
double& r_min,
double& r_max,
double &r_step)
const;
192 bool is_range_exponential(
int p_column)
const;
194 void set_metadata(
int p_column,
const Variant& p_meta);
195 Variant get_metadata(
int p_column)
const;
197 void set_custom_draw(
int p_column,
Object *p_object,
const StringName& p_callback);
199 void set_collapsed(
bool p_collapsed);
210 void remove_child(
TreeItem *p_item);
212 void set_selectable(
int p_column,
bool p_selectable);
213 bool is_selectable(
int p_column)
const;
215 bool is_selected(
int p_column);
216 void select(
int p_column);
217 void deselect(
int p_column);
218 void set_as_cursor(
int p_column);
220 void set_editable(
int p_column,
bool p_editable);
221 bool is_editable(
int p_column);
223 void set_custom_color(
int p_column,
const Color& p_color);
224 void clear_custom_color(
int p_column);
226 void set_custom_bg_color(
int p_column,
const Color& p_color);
227 void clear_custom_bg_color(
int p_column);
228 Color get_custom_bg_color(
int p_column)
const;
230 void set_tooltip(
int p_column,
const String& p_tooltip);
231 String get_tooltip(
int p_column)
const;
234 void clear_children();
237 void move_to_bottom();
267 bool pressing_for_editor;
268 String pressing_for_editor_text;
270 Rect2 pressing_item_rect;
272 float range_drag_base;
273 bool range_drag_enabled;
274 Vector2 range_drag_capture_pos;
280 Rect2 custom_popup_rect;
283 int popup_edited_item_col;
285 SelectMode select_mode;
294 ColumnInfo() { min_width=1; expand=
true; }
297 bool show_column_titles;
300 bool updating_value_editor;
301 uint32_t focus_in_id;
306 Timer *range_click_timer;
309 void _range_click_timeout();
311 int compute_item_height(
TreeItem *p_item)
const;
312 int get_item_height(
TreeItem *p_item)
const;
314 void draw_item_rect(
const TreeItem::Cell& p_cell,
const Rect2i& p_rect,
const Color& p_color);
316 void select_single_item(
TreeItem *p_selected,
TreeItem *p_current,
int p_col,
TreeItem *p_prev=NULL,
bool *r_in_range=NULL);
318 void text_editor_enter(
String p_text);
319 void _text_editor_modal_close();
320 void value_editor_changed(
double p_value);
322 void popup_select(
int p_option);
325 void _notification(
int p_what);
327 Size2 get_minimum_size()
const;
329 void item_edited(
int p_column,
TreeItem *p_item);
330 void item_changed(
int p_column,
TreeItem *p_item);
331 void item_selected(
int p_column,
TreeItem *p_item);
332 void item_deselected(
int p_column,
TreeItem *p_item);
334 void propagate_set_columns(
TreeItem *p_item);
349 Color title_button_color;
359 Color font_color_selected;
375 ClickType click_type;
376 ClickType hover_type;
386 int _get_title_button_height()
const;
388 void _scroll_moved(
float p_value);
392 Size2 get_internal_min_size()
const;
394 void update_scrollbars();
398 uint64_t last_keypress;
400 bool cursor_can_exit_tree;
401 void _do_incr_search(
const String& p_add);
403 TreeItem* _search_item_text(
TreeItem *p_at,
const String& p_find,
int *r_col,
bool p_selectable,
bool p_backwards=
false);
419 bool drag_touching_deaccel;
425 static void _bind_methods();
430 Rect2 _get_item_rect(
Object *p_item,
int p_column)
const {
return get_item_rect(p_item->cast_to<
TreeItem>(),p_column ); }
441 void set_column_min_width(
int p_column,
int p_min_width);
442 void set_column_expand(
int p_column,
bool p_expand);
443 int get_column_width(
int p_column)
const;
445 void set_hide_root(
bool p_eanbled);
448 int get_selected_column()
const;
449 int get_pressed_button()
const;
450 void set_select_mode(SelectMode p_mode);
452 void set_columns(
int p_columns);
453 int get_columns()
const;
455 void set_column_title(
int p_column,
const String& p_title);
456 String get_column_title(
int p_column)
const;
458 void set_column_titles_visible(
bool p_show);
459 bool are_column_titles_visible()
const;
462 int get_edited_column()
const;
464 void ensure_cursor_is_visible();
466 Rect2 get_custom_popup_rect()
const;
468 int get_item_offset(
TreeItem *p_item)
const;
470 bool edit_selected();
472 TreeItem* search_item_text(
const String& p_find,
int *r_col=NULL,
bool p_selectable=
false);
474 Point2 get_scroll()
const;
476 void set_cursor_can_exit_tree(
bool p_enable);
477 bool can_cursor_exit_tree()
const;
479 VScrollBar *get_vscroll_bar() {
return v_scroll; }
481 void set_hide_folding(
bool p_hide);
482 bool is_folding_hidden()
const;
491 VARIANT_ENUM_CAST( Tree::SelectMode );
Contains a range.
Definition: tree.h:54
Definition: math_2d.h:422
Definition: math_2d.h:369
Definition: math_2d.h:204
just a string
Definition: tree.h:52
Definition: string_db.h:48
string + check
Definition: tree.h:53
Contains a custom value, show a string, and an edit button.
Definition: tree.h:56
Definition: dictionary.h:42
Contains a icon, not editable.
Definition: tree.h:55
TreeCellMode
Definition: tree.h:50
Definition: line_edit.h:36