#ifndef TREE_H #define TREE_H /* tree.h */ #include "core/object/object.h" #include "scene/main/control.h" class Tree; class HScrollBar; class VScrollBar; class LineEdit; class HSlider; class PopupMenu; class TreeItem : public Object { GDCLASS(TreeItem, Object); public: enum TreeCellMode { CELL_MODE_STRING, ///< just a string CELL_MODE_CHECK, ///< string + check CELL_MODE_RANGE, ///< Contains a range CELL_MODE_ICON, ///< Contains an icon, not editable CELL_MODE_CUSTOM, ///< Contains a custom value, show a string, and an edit button }; enum TextAlign { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT }; private: friend class Tree; struct Cell { TreeCellMode mode; Ref icon; Rect2i icon_region; String text; String suffix; double min, max, step, val; int icon_max_w; bool expr; bool checked; bool editable; bool selected; bool selectable; bool custom_color; Color color; bool custom_bg_color; bool custom_bg_outline; Color bg_color; bool custom_button; bool expand_right; Color icon_color; TextAlign text_align; Variant meta; String tooltip; ObjectID custom_draw_obj; StringName custom_draw_callback; struct Button { int id; bool disabled; Ref texture; Color color; String tooltip; Button() { id = 0; disabled = false; color = Color(1, 1, 1, 1); tooltip = ""; } }; Vector