80 m_children.push_back(t);
123 %
template(TreeModel) TreeNode<std::string>;
175 TreeView(
unsigned int x,
unsigned int y,
unsigned int width,
176 unsigned int height,
const char* label)
177 :
Widget(x, y, width, height, label),
204 void show() { m_visible =
true; }
237 void selectEntry(
const char* name);
void clearChildren()
Clears the list of children. Attention: Does not delete any child data!
Definition: Tree.h:94
TreeNode< T > * getChild(int idx)
Returns the child that has the given index.
Definition: Tree.h:70
~TreeNode()
Definition: Tree.h:118
const char * getSelected()
Returns the currently selected node or nullptr if none is selected.
Definition: Tree.h:235
TreeView(unsigned int x, unsigned int y, unsigned int width, unsigned int height, const char *label)
Definition: Tree.h:175
Represents a single tree node.
Definition: Tree.h:55
void show()
Shows the tree.
Definition: Tree.h:204
float y
Definition: Vector2.h:36
void setAutoSize(bool b)
Configures the tree widget to resize itself according to its content.
Definition: Tree.h:199
The Label class displays a string on the screen.
Definition: Label.h:55
float x
Definition: Vector2.h:35
TreeNode< std::string > m_root
Definition: Tree.h:140
TreeNode()
Definition: Tree.h:117
bool m_autoSize
Definition: Tree.h:139
~TreeView()
Definition: Tree.h:185
T m_data
Definition: Tree.h:58
size_t getNumChildren()
Returns the number of children this node has.
Definition: Tree.h:88
void selectEntry(TreeNode< std::string > *node)
Definition: Tree.h:238
TreeNode< T > * addChild(T data)
Adds a child to the node.
Definition: Tree.h:77
TreeNode< std::string > * m_selected
Definition: Tree.h:141
Label * m_label
Definition: Tree.h:143
void clear()
Clears everything starting at the root node.
Definition: Tree.h:223
T getData()
Returns the data of this node.
Definition: Tree.h:100
bool m_opened
Definition: Tree.h:59
Implements a tree view which displays a multi-way tree of strings while providing callbacks for the s...
Definition: Tree.h:134
bool getAutoSize()
Checks if the tree widget is configured to resize itself according to its content.
Definition: Tree.h:193
void setSize(Vector2 sz)
Definition: Tree.h:245
std::vector< TreeNode< T > * > m_children
Definition: Tree.h:61
TreeNode< std::string > * getTreeModel()
Returns the root node of this tree.
Definition: Tree.h:229
bool isOpen()
Checks if this node is open.
Definition: Tree.h:114
TreeNode(T d)
Definition: Tree.h:116
void setOpen(bool v)
Configures if this node is considered to be opened up. Important for the tree view to decide whether ...
Definition: Tree.h:108