25 struct builder_tree_view;
155 const int height_modification,
156 const int width_modification_pos = -1,
157 const int height_modification_pos = -1);
167 static const std::string&
type();
172 const auto def = std::find_if(
174 return def !=
node_definitions_.end() ? utils::make_optional(def) : utils::nullopt;
185 template<tree_view_node* (tree_view_node::*func) ()>
188 template<tree_view_node* (tree_view_node::*func) ()>
218 virtual std::unique_ptr<widget>
build()
const override;
A config object defines a single node in a WML file, with access to child nodes.
void set_indentation_step_size(const unsigned indentation_step_size)
void resize_content(const int width_modification, const int height_modification, const int width_modification_pos=-1, const int height_modification_pos=-1)
Resizes the content.
unsigned indentation_step_size_
const tree_view_node * selected_item() const
tree_view_node * selected_item_
void handle_key_right_arrow(SDL_Keymod modifier, bool &handled) override
Inherited from scrollbar_container.
virtual void set_self_active(const bool active) override
See container_base::set_self_active.
static const std::string root_node_id
tree_view_node * get_next_node()
tree_view_node & get_root_node()
tree_view_node * root_node_
virtual void finalize_setup()
Inherited from container_base.
void handle_key_up_arrow(SDL_Keymod modifier, bool &handled) override
Inherited from scrollbar_container.
void handle_key_left_arrow(SDL_Keymod modifier, bool &handled) override
Inherited from scrollbar_container.
static const std::string & type()
Static type getter that does not rely on the widget being constructed.
tree_view_node & add_node(const std::string &id, const widget_data &data, const int index=-1)
utils::optional< decltype(node_definitions_)::const_iterator > get_node_definition(const std::string &id) const
Optionally returns the node definition with the given id, or nullopt if not found.
void signal_handler_left_button_down(const event::ui_event event)
const std::vector< node_definition > node_definitions_
implementation::tree_node node_definition
tree_view_node * selected_item()
virtual const std::string & get_control_type() const override
Inherited from styled_widget, implemented by REGISTER_WIDGET.
void handle_key_down_arrow(SDL_Keymod modifier, bool &handled) override
Inherited from scrollbar_container.
virtual void layout_children() override
See widget::layout_children.
bool handle_up_down_arrow()
std::pair< std::shared_ptr< tree_view_node >, int > remove_node(tree_view_node *node)
Removes the given node as a child of its parent node.
const std::vector< node_definition > & get_node_definitions() const
ui_event
The event sent to the dispatcher.
std::shared_ptr< builder_grid > builder_grid_ptr
std::map< std::string, widget_item > widget_data
Contains the implementation details for lexical_cast and shouldn't be used directly.
std::size_t index(const std::string &str, const std::size_t index)
Codepoint index corresponding to the nth character in a UTF-8 string.
unsigned indentation_step_size
builder_tree_view(const config &cfg)
std::vector< tree_node > nodes
The types of nodes in the tree view.
scrollbar_container::scrollbar_mode vertical_scrollbar_mode
scrollbar_container::scrollbar_mode horizontal_scrollbar_mode
virtual std::unique_ptr< widget > build() const override
tree_node(const config &cfg)
resolution(const config &cfg)
tree_view_definition(const config &cfg)