15 #ifndef GUI_WIDGETS_TREE_VIEW_NODE_HPP_INCLUDED
16 #define GUI_WIDGETS_TREE_VIEW_NODE_HPP_INCLUDED
21 #include <boost/ptr_container/ptr_vector.hpp>
42 const std::vector<tnode_definition>& node_definitions,
45 const std::map<std::string /* widget id */, string_map>&
data);
66 const std::map<std::string /* widget id */, string_map>&
data,
67 const int index = -1);
84 const std::map<std::string /* widget id */, string_map>&
data)
145 const bool must_be_active)
override;
149 const bool must_be_active)
const override;
156 const bool must_be_active)
const override;
203 const int scope, std::function<
void(
twidget&)> callback)
277 const std::vector<twidget*>& call_stack);
286 const unsigned indention_step_size)
const;
307 int y_offset)
override;
327 const std::map<std::string /* widget id */, string_map>&
data);
std::vector< int > describe_path()
calculates the node indicies that we need to get from the root node to this node. ...
tgrid grid_
Grid holding our contents.
ttree_view_node * get_selectable_node_above()
ttree_view_node & add_sibling(const std::string &id, const std::map< std::string, string_map > &data)
Adds a sibbling for a node at the end of the list.
void signal_handler_label_left_button_click(const event::tevent event, bool &handled, bool &halt)
size_t size() const
The "size" of the widget.
ttree_view_node & parent_node()
Returns the parent node.
tselectable_ * toggle_
The toggle for the folded state.
const std::vector< tnode_definition > & node_definitions_
The node definitions known to use.
bool empty() const
Does the node have children?
scope
Available hotkey scopes.
bool is_folded() const
Is the node folded?
virtual void request_reduce_width(const unsigned maximum_width) override
See twidget::request_reduce_width.
void set_callback_state_change(const int scope, std::function< void(twidget &)> callback)
Inherited from tselectable_.
virtual iterator::twalker_ * create_walker() override
See twidget::create_walker.
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
tpoint get_current_size(bool assume_visible=false) const
ttree_view_node & add_child(const std::string &id, const std::map< std::string, string_map > &data, const int index=-1)
Adds a child item to the list of child nodes.
tpoint get_unfolded_size() const
ttree_view_node * get_selectable_node_below()
base class of top level items, the only item which needs to store the final canvases to draw on ...
A class inherited from ttext_box that displays its input as stars.
virtual tpoint calculate_best_size() const override
See twidget::calculate_best_size.
virtual void set_visible_rectangle(const SDL_Rect &rectangle) override
See twidget::set_visible_rectangle.
boost::ptr_vector< ttree_view_node > children_
Our children.
void signal_handler_left_button_click(const event::tevent event)
void impl_populate_dirty_list(twindow &caller, const std::vector< twidget * > &call_stack)
"Inherited" from twidget.
std::function< void(twidget &)> callback_state_to_unfolded_
See tselectable_::set_callback_state_change.
tevent
The event send to the dispatcher.
implementation::ttree_node tnode_definition
std::function< void(twidget &)> callback_state_change_
See tselectable_::set_callback_state_change.
ttree_view_node * get_node_above()
Small abstract helper class.
void init_grid(tgrid *grid, const std::map< std::string, string_map > &data)
ttree_view_node * get_node_below()
tselectable_ * label_
The label to show our selected state.
unsigned get_indention_level() const
The indention level of the node.
virtual twidget * find_at(const tpoint &coordinate, const bool must_be_active) override
See twidget::find_at.
bool is_root_node() const
Is this node the root node?
virtual void place(const tpoint &origin, const tpoint &size) override
See twidget::place.
twidget * find(const std::string &id, const bool must_be_active) override
See twidget::find.
ttree_view & tree_view_
The tree view that owns us.
tpoint get_folded_size() const
bool disable_click_dismiss() const override
See twidget::disable_click_dismiss.
const std::string & get_control_type() const
Returns the control_type of the ttree_view_node.
virtual void set_origin(const tpoint &origin) override
See twidget::set_origin.
std::function< void(twidget &)> callback_state_to_folded_
See tselectable_::set_callback_state_change.
ttree_view_node * parent_node_
Our parent node.
GLint GLint GLint GLint GLint GLint GLsizei width
The walker abstract base class.
ttree_view_node & get_child_at(int index)
ttree_view_node * get_last_visible_parent_node()
ttree_view_node(const std::string &id, const std::vector< tnode_definition > &node_definitions, ttree_view_node *parent_node, ttree_view &parent_tree_view, const std::map< std::string, string_map > &data)
GLsizei const GLcharARB ** string
Contains the implementation details for lexical_cast and shouldn't be used directly.
virtual void impl_draw_children(surface &frame_buffer, int x_offset, int y_offset) override
See twidget::impl_draw_children.
void clear()
Removes all child items from the widget.
void layout_initialise(const bool full_initialisation)
How the layout engine works.