The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
gui2::tree_view_node Class Reference

#include <tree_view_node.hpp>

Inheritance diagram for gui2::tree_view_node:
Inheritance graph

Public Types

using node_children_vector = std::vector< std::unique_ptr< tree_view_node >>
 
- Public Types inherited from gui2::widget
enum  visibility { visibility::visible, visibility::hidden, visibility::invisible }
 Visibility settings done by the user. More...
 
enum  redraw_action { redraw_action::full, redraw_action::partly, redraw_action::none }
 Visibility set by the engine. More...
 
- Public Types inherited from gui2::event::dispatcher
enum  event_queue_type { pre = 1, child = 2, post = 4 }
 
enum  queue_position {
  front_pre_child, back_pre_child, front_child, back_child,
  front_post_child, back_post_child
}
 The position where to add a new callback in the signal handler. More...
 
enum  mouse_behavior { all, hit, none }
 The behavior of the mouse events. More...
 

Public Member Functions

bool operator== (const tree_view_node &node)
 
 tree_view_node (const std::string &id, tree_view_node *parent_node, tree_view &parent_tree_view, const std::map< std::string, string_map > &data)
 
 ~tree_view_node ()
 
tree_view_nodeadd_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. More...
 
tree_view_nodeadd_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. More...
 
bool is_root_node () const
 Is this node the root node? More...
 
unsigned get_indentation_level () const
 The indentation level of the node. More...
 
bool empty () const
 Does the node have children? More...
 
bool is_folded () const
 Is the node folded? More...
 
void fold (const bool recursive=false)
 
void unfold (const bool recursive=false)
 
virtual iteration::walker_basecreate_walker () override
 See widget::create_walker. More...
 
node_children_vectorchildren ()
 
virtual widgetfind_at (const point &coordinate, const bool must_be_active) override
 See widget::find_at. More...
 
virtual const widgetfind_at (const point &coordinate, const bool must_be_active) const override
 See widget::find_at. More...
 
widgetfind (const std::string &id, const bool must_be_active) override
 See widget::find. More...
 
const widgetfind (const std::string &id, const bool must_be_active) const override
 See widget::find. More...
 
size_t count_children () const
 The number of children in this widget. More...
 
void clear ()
 Removes all child items from the widget. More...
 
tree_view_nodeparent_node ()
 Returns the parent node. More...
 
const tree_view_nodeparent_node () const
 The const version of parent_node. More...
 
tree_viewget_tree_view ()
 
const tree_viewget_tree_view () const
 
tree_view_nodeget_child_at (int index)
 
std::vector< int > describe_path ()
 Calculates the node indicies needed to get from the root node to this node. More...
 
tree_view_nodeget_last_visible_parent_node ()
 
tree_view_nodeget_node_above ()
 
tree_view_nodeget_node_below ()
 
tree_view_nodeget_selectable_node_above ()
 
tree_view_nodeget_selectable_node_below ()
 
void select_node (bool expand_parents=false)
 
gridget_grid ()
 
void layout_initialize (const bool full_initialization) override
 How the layout engine works. More...
 
void clear_before_destruct ()
 
- Public Member Functions inherited from gui2::widget
 widget (const widget &)=delete
 
widgetoperator= (const widget &)=delete
 
 widget ()
 
 widget (const builder_widget &builder)
 Constructor. More...
 
virtual ~widget () override
 
void set_id (const std::string &id)
 
const std::string & id () const
 
windowget_window ()
 Get the parent window. More...
 
const windowget_window () const
 The constant version of get_window. More...
 
gridget_parent_grid ()
 Get the parent grid. More...
 
dialogs::modal_dialogdialog ()
 Returns the top-level dialog. More...
 
void set_parent (widget *parent)
 
widgetparent ()
 
virtual void demand_reduce_width (const unsigned maximum_width)
 Tries to reduce the width of a widget. More...
 
virtual void request_reduce_height (const unsigned maximum_height)
 Tries to reduce the height of a widget. More...
 
virtual void demand_reduce_height (const unsigned maximum_height)
 Tries to reduce the height of a widget. More...
 
point get_best_size () const
 Gets the best size for the widget. More...
 
virtual bool can_mouse_focus () const
 Whether the mouse move/click event go 'through' this widget. More...
 
virtual bool can_wrap () const
 Can the widget wrap. More...
 
virtual void set_size (const point &size)
 Sets the size of the widget. More...
 
virtual void move (const int x_offset, const int y_offset)
 Moves a widget. More...
 
virtual void set_horizontal_alignment (const std::string &alignment)
 Sets the horizontal alignment of the widget within its parent grid. More...
 
virtual void set_vertical_alignment (const std::string &alignment)
 Sets the horizontal alignment of the widget within its parent grid. More...
 
virtual void layout_children ()
 Allows a widget to update its children. More...
 
point get_origin () const
 Returns the screen origin of the widget. More...
 
point get_size () const
 Returns the size of the widget. More...
 
SDL_Rect get_rectangle () const
 Gets the bounding rectangle of the widget on the screen. More...
 
int get_x () const
 
int get_y () const
 
unsigned get_width () const
 
unsigned get_height () const
 
void set_linked_group (const std::string &linked_group)
 
SDL_Rect calculate_blitting_rectangle (const int x_offset, const int y_offset)
 Calculates the blitting rectangle of the widget. More...
 
SDL_Rect calculate_clipping_rectangle (const int x_offset, const int y_offset)
 Calculates the clipping rectangle of the widget. More...
 
void draw_background (surface &frame_buffer, int x_offset, int y_offset)
 Draws the background of a widget. More...
 
void draw_children (surface &frame_buffer, int x_offset, int y_offset)
 Draws the children of a widget. More...
 
void draw_foreground (surface &frame_buffer, int x_offset, int y_offset)
 Draws the foreground of the widget. More...
 
void populate_dirty_list (window &caller, std::vector< widget * > &call_stack)
 Adds a widget to the dirty list if it is dirty. More...
 
SDL_Rect get_dirty_rectangle () const
 Gets the dirty rectangle of the widget. More...
 
void set_is_dirty (const bool is_dirty)
 
bool get_is_dirty () const
 
void set_visible (const visibility visible)
 
visibility get_visible () const
 
redraw_action get_drawing_action () const
 
void set_debug_border_mode (const unsigned debug_border_mode)
 
void set_debug_border_color (const color_t debug_border_color)
 
virtual bool has_widget (const widget &widget) const
 Does the widget contain the widget. More...
 
- Public Member Functions inherited from gui2::event_executor
 event_executor ()
 
virtual ~event_executor ()
 
void set_wants_mouse_hover (const bool hover=true)
 
bool wants_mouse_hover () const
 
void set_wants_mouse_left_double_click (const bool click=true)
 
bool wants_mouse_left_double_click () const
 
void set_wants_mouse_middle_double_click (const bool click=true)
 
bool wants_mouse_middle_double_click () const
 
event_executorset_wants_mouse_right_double_click (const bool click=true)
 
bool wants_mouse_right_double_click () const
 
- Public Member Functions inherited from gui2::event::dispatcher
 dispatcher ()
 
virtual ~dispatcher ()
 
void connect ()
 Connects the dispatcher to the event handler. More...
 
bool has_event (const ui_event event, const event_queue_type event_type)
 
bool fire (const ui_event event, widget &target)
 Fires an event which has no extra parameters. More...
 
bool fire (const ui_event event, widget &target, const point &coordinate)
 Fires an event which takes a coordinate parameter. More...
 
bool fire (const ui_event event, widget &target, const SDL_Keycode key, const SDL_Keymod modifier, const utf8::string &unicode)
 Fires an event which takes keyboard parameters. More...
 
bool fire (const ui_event event, widget &target, const point &pos, const point &distance)
 Fires an event which takes touch parameters. More...
 
bool fire (const ui_event event, widget &target, void *)
 Fires an event which takes notification parameters. More...
 
bool fire (const ui_event event, widget &target, message &msg)
 Fires an event which takes message parameters. More...
 
bool fire (const ui_event event, widget &target, const SDL_Event &sdlevent)
 Fires an event that's a raw SDL event. More...
 
bool fire (const ui_event event, widget &target, const std::string &text, int32_t start, int32_t len)
 Fires an event which takes text input parameters. More...
 
template<ui_event E>
utils::enable_if_t< has_key
< set_event, E >::value > 
connect_signal (const signal_function &signal, const queue_position position=back_child)
 Connect a signal for callback in set_event. More...
 
template<ui_event E>
utils::enable_if_t< has_key
< set_event, E >::value > 
disconnect_signal (const signal_function &signal, const queue_position position=back_child)
 Disconnect a signal for callback in set_event. More...
 
template<ui_event E>
utils::enable_if_t< has_key
< set_event_mouse, E >::value > 
connect_signal (const signal_mouse_function &signal, const queue_position position=back_child)
 Connect a signal for callback in set_event_mouse. More...
 
template<ui_event E>
utils::enable_if_t< has_key
< set_event_mouse, E >::value > 
disconnect_signal (const signal_mouse_function &signal, const queue_position position=back_child)
 Disconnect a signal for callback in set_event_mouse. More...
 
template<ui_event E>
utils::enable_if_t< has_key
< set_event_keyboard, E >
::value > 
connect_signal (const signal_keyboard_function &signal, const queue_position position=back_child)
 Connect a signal for callback in set_event_keyboard. More...
 
template<ui_event E>
utils::enable_if_t< has_key
< set_event_keyboard, E >
::value > 
disconnect_signal (const signal_keyboard_function &signal, const queue_position position=back_child)
 Disconnect a signal for callback in set_event_keyboard. More...
 
template<ui_event E>
utils::enable_if_t< has_key
< set_event_touch, E >::value > 
connect_signal (const signal_touch_function &signal, const queue_position position=back_child)
 Connect a signal for callback in set_event_touch. More...
 
template<ui_event E>
utils::enable_if_t< has_key
< set_event_touch, E >::value > 
disconnect_signal (const signal_touch_function &signal, const queue_position position=back_child)
 Disconnect a signal for callback in set_event_touch. More...
 
template<ui_event E>
utils::enable_if_t< has_key
< set_event_notification, E >
::value > 
connect_signal (const signal_notification_function &signal, const queue_position position=back_child)
 Connect a signal for callback in set_event_notification. More...
 
template<ui_event E>
utils::enable_if_t< has_key
< set_event_notification, E >
::value > 
disconnect_signal (const signal_notification_function &signal, const queue_position position=back_child)
 Disconnect a signal for callback in set_event_notification. More...
 
template<ui_event E>
utils::enable_if_t< has_key
< set_event_message, E >
::value > 
connect_signal (const signal_message_function &signal, const queue_position position=back_child)
 Connect a signal for callback in set_event_message. More...
 
template<ui_event E>
utils::enable_if_t< has_key
< set_event_message, E >
::value > 
disconnect_signal (const signal_message_function &signal, const queue_position position=back_child)
 Disconnect a signal for callback in set_event_message. More...
 
template<ui_event E>
utils::enable_if_t< has_key
< set_event_raw_event, E >
::value > 
connect_signal (const signal_raw_event_function &signal, const queue_position position=back_child)
 Connect a signal for callback in set_raw_event. More...
 
template<ui_event E>
utils::enable_if_t< has_key
< set_event_raw_event, E >
::value > 
disconnect_signal (const signal_raw_event_function &signal, const queue_position position=back_child)
 Disconnect a signal for callback in set_raw_event. More...
 
template<ui_event E>
utils::enable_if_t< has_key
< set_event_text_input, E >
::value > 
connect_signal (const signal_text_input_function &signal, const queue_position position=back_child)
 Connect a signal for callback in set_text_input. More...
 
template<ui_event E>
utils::enable_if_t< has_key
< set_event_text_input, E >
::value > 
disconnect_signal (const signal_text_input_function &signal, const queue_position position=back_child)
 Disconnect a signal for callback in set_text_input. More...
 
void capture_mouse ()
 Captures the mouse. More...
 
void release_mouse ()
 Releases the mouse capture. More...
 
void set_mouse_behavior (const mouse_behavior mouse_behavior)
 
mouse_behavior get_mouse_behavior () const
 
void set_want_keyboard_input (const bool want_keyboard_input)
 
bool get_want_keyboard_input () const
 
void register_hotkey (const hotkey::HOTKEY_COMMAND id, const hotkey_function &function)
 Registers a hotkey. More...
 
bool execute_hotkey (const hotkey::HOTKEY_COMMAND id)
 Executes a hotkey. More...
 

Private Member Functions

int calculate_ypos ()
 
virtual void request_reduce_width (const unsigned maximum_width) override
 See widget::request_reduce_width. More...
 
void fold_internal ()
 
void unfold_internal ()
 
void impl_populate_dirty_list (window &caller, const std::vector< widget * > &call_stack)
 "Inherited" from widget. More...
 
virtual point calculate_best_size () const override
 See widget::calculate_best_size. More...
 
bool disable_click_dismiss () const override
 See widget::disable_click_dismiss. More...
 
point calculate_best_size (const int indentation_level, const unsigned indentation_step_size) const
 
point get_current_size (bool assume_visible=false) const
 
point get_folded_size () const
 
point get_unfolded_size () const
 
virtual void set_origin (const point &origin) override
 See widget::set_origin. More...
 
virtual void place (const point &origin, const point &size) override
 See widget::place. More...
 
unsigned place (const unsigned indentation_step_size, point origin, unsigned width)
 
virtual void set_visible_rectangle (const SDL_Rect &rectangle) override
 See widget::set_visible_rectangle. More...
 
virtual void impl_draw_children (surface &frame_buffer, int x_offset, int y_offset) override
 See widget::impl_draw_children. More...
 
void signal_handler_left_button_click (const event::ui_event event)
 
void signal_handler_label_left_button_click (const event::ui_event event, bool &handled, bool &halt)
 
void init_grid (grid *grid, const std::map< std::string, string_map > &data)
 
const std::string & get_control_type () const
 Returns the control_type of the tree_view_node. More...
 

Private Attributes

tree_view_nodeparent_node_
 Our parent node. More...
 
tree_viewtree_view_
 The tree view that owns us. More...
 
grid grid_
 Grid holding our contents. More...
 
node_children_vector children_
 Our children. More...
 
selectable_itemtoggle_
 The toggle for the folded state. More...
 
selectable_itemlabel_
 The label to show our selected state. More...
 
bool unfolded_
 

Friends

struct tree_view_node_implementation
 
class tree_view
 

Additional Inherited Members

- Protected Member Functions inherited from gui2::widget
void set_layout_size (const point &size)
 
const pointlayout_size () const
 
void clear_layout_size ()
 Throws away layout_size_. More...
 

Detailed Description

Definition at line 31 of file tree_view_node.hpp.

Member Typedef Documentation

using gui2::tree_view_node::node_children_vector = std::vector<std::unique_ptr<tree_view_node>>

Definition at line 37 of file tree_view_node.hpp.

Constructor & Destructor Documentation

gui2::tree_view_node::tree_view_node ( const std::string &  id,
tree_view_node parent_node,
tree_view parent_tree_view,
const std::map< std::string, string_map > &  data 
)
gui2::tree_view_node::~tree_view_node ( )

Definition at line 115 of file tree_view_node.cpp.

References get_tree_view(), gui2::tree_view::selected_item_, and tree_view_.

Member Function Documentation

tree_view_node & gui2::tree_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.

Parameters
idThe id of the node definition to use for the new node.
dataThe data to send to the set_members of the widgets. If the member id is not an empty string it is only send to the widget that has the wanted id (if any). If the member id is an empty string, it is send to all members. Having both empty and non-empty id's gives undefined behavior.
indexThe item before which to add the new item, 0 == begin, -1 == end.

Definition at line 130 of file tree_view_node.cpp.

References children_, gui2::scrollbar_container::content_grid(), gui2::widget::get_best_size(), get_indentation_level(), gui2::widget::get_size(), get_tree_view(), gui2::tree_view::indentation_step_size_, utf8::index(), is_folded(), gui2::scrollbar_container::layout_initialize(), gui2::widget::layout_size(), gui2::tree_view::resize_content(), tree_view_node(), gui2::point::x, and gui2::point::y.

Referenced by gui2::dialogs::stuff_list_adder::add(), gui2::add_name_tree_node(), gui2::tree_view::add_node(), gui2::dialogs::mp_options_helper::add_node_and_get_widget(), add_sibling(), gui2::dialogs::mp_options_helper::display_custom_options(), and gui2::dialogs::mp_lobby::update_playerlist().

tree_view_node& gui2::tree_view_node::add_sibling ( const std::string &  id,
const std::map< std::string, string_map > &  data 
)
inline

Adds a sibbling for a node at the end of the list.

Parameters
idThe id of the node definition to use for the new node.
dataThe data to send to the set_members of the widgets. If the member id is not an empty string it is only send to the widget that has the wanted id (if any). If the member id is an empty string, it is send to all members. Having both empty and non-empty id's gives undefined behavior.

Definition at line 86 of file tree_view_node.hpp.

References add_child(), is_root_node(), and parent_node().

Referenced by gui2::dialogs::mp_staging::add_side_node(), and gui2::dialogs::mp_join_game::generate_side_list().

point gui2::tree_view_node::calculate_best_size ( ) const
overrideprivatevirtual

See widget::calculate_best_size.

Implements gui2::widget.

Definition at line 401 of file tree_view_node.cpp.

References get_tree_view().

point gui2::tree_view_node::calculate_best_size ( const int  indentation_level,
const unsigned  indentation_step_size 
) const
private
int gui2::tree_view_node::calculate_ypos ( )
private

Definition at line 695 of file tree_view_node.cpp.

References calculate_ypos(), children_, and parent_node_.

Referenced by calculate_ypos(), clear(), fold_internal(), and unfold_internal().

node_children_vector& gui2::tree_view_node::children ( )
inline

Definition at line 143 of file tree_view_node.hpp.

References children_.

void gui2::tree_view_node::clear ( )

Removes all child items from the widget.

Todo:
Also try to find the optimal width.

Definition at line 273 of file tree_view_node.cpp.

References calculate_ypos(), children_, get_tree_view(), is_folded(), and gui2::tree_view::resize_content().

Referenced by gui2::tree_view::clear(), and gui2::dialogs::mp_lobby::update_playerlist().

void gui2::tree_view_node::clear_before_destruct ( )

Definition at line 122 of file tree_view_node.cpp.

References gui2::event::dispatcher::child, children_, and tree_view_.

Referenced by gui2::tree_view::~tree_view().

size_t gui2::tree_view_node::count_children ( ) const
inline
iteration::walker_base * gui2::tree_view_node::create_walker ( )
overridevirtual

See widget::create_walker.

Todo:
Implement properly.

Implements gui2::widget.

Definition at line 829 of file tree_view_node.cpp.

References children_.

std::vector< int > gui2::tree_view_node::describe_path ( )
bool gui2::tree_view_node::disable_click_dismiss ( ) const
overrideprivatevirtual

See widget::disable_click_dismiss.

Implements gui2::widget.

Definition at line 406 of file tree_view_node.cpp.

bool gui2::tree_view_node::empty ( ) const
inline

Does the node have children?

Definition at line 113 of file tree_view_node.hpp.

References children_.

Referenced by gui2::tree_view::empty().

widget * gui2::tree_view_node::find ( const std::string &  id,
const bool  must_be_active 
)
overridevirtual
const widget * gui2::tree_view_node::find ( const std::string &  id,
const bool  must_be_active 
) const
overridevirtual
widget * gui2::tree_view_node::find_at ( const point coordinate,
const bool  must_be_active 
)
overridevirtual

See widget::find_at.

Reimplemented from gui2::widget.

Definition at line 332 of file tree_view_node.cpp.

const widget * gui2::tree_view_node::find_at ( const point coordinate,
const bool  must_be_active 
) const
overridevirtual

See widget::find_at.

Reimplemented from gui2::widget.

Definition at line 337 of file tree_view_node.cpp.

void gui2::tree_view_node::fold ( const bool  recursive = false)
void gui2::tree_view_node::fold_internal ( )
private
tree_view_node & gui2::tree_view_node::get_child_at ( int  index)

Definition at line 671 of file tree_view_node.cpp.

References children_, and utf8::index().

Referenced by find_widget(), get_node_above(), and get_node_below().

const std::string & gui2::tree_view_node::get_control_type ( ) const
private

Returns the control_type of the tree_view_node.

This class does not derive from styled_widget but the function behaves similar as styled_widget::get_control_type.

Definition at line 665 of file tree_view_node.cpp.

point gui2::tree_view_node::get_current_size ( bool  assume_visible = false) const
private
Parameters
assume_visibleif false (default) it will return 0 if the parent node is folded

Definition at line 411 of file tree_view_node.cpp.

References children_, get_folded_size(), gui2::widget::invisible, is_folded(), parent_node_, utf8::size(), gui2::point::x, and gui2::point::y.

Referenced by fold_internal(), and unfold_internal().

point gui2::tree_view_node::get_folded_size ( ) const
private
grid& gui2::tree_view_node::get_grid ( )
inline
unsigned gui2::tree_view_node::get_indentation_level ( ) const

The indentation level of the node.

The root node starts at level 0.

Definition at line 185 of file tree_view_node.cpp.

References is_root_node(), game_config::images::level, and parent_node().

Referenced by add_child(), get_folded_size(), and get_unfolded_size().

tree_view_node * gui2::tree_view_node::get_last_visible_parent_node ( )
tree_view_node * gui2::tree_view_node::get_node_above ( )
tree_view_node * gui2::tree_view_node::get_node_below ( )
tree_view_node * gui2::tree_view_node::get_selectable_node_above ( )

Definition at line 775 of file tree_view_node.cpp.

References get_node_above(), and label_.

tree_view_node * gui2::tree_view_node::get_selectable_node_below ( )

Definition at line 784 of file tree_view_node.cpp.

References get_node_below(), and label_.

tree_view& gui2::tree_view_node::get_tree_view ( )
inline
const tree_view& gui2::tree_view_node::get_tree_view ( ) const
inline

Definition at line 193 of file tree_view_node.hpp.

References tree_view_.

point gui2::tree_view_node::get_unfolded_size ( ) const
private
void gui2::tree_view_node::impl_draw_children ( surface frame_buffer,
int  x_offset,
int  y_offset 
)
overrideprivatevirtual

See widget::impl_draw_children.

Reimplemented from gui2::widget.

Definition at line 567 of file tree_view_node.cpp.

References children_, gui2::widget::draw_children(), grid_, and is_folded().

void gui2::tree_view_node::impl_populate_dirty_list ( window caller,
const std::vector< widget * > &  call_stack 
)
private

"Inherited" from widget.

This version needs to call its children, which are it's child nodes.

Definition at line 386 of file tree_view_node.cpp.

References wfl::call_stack, children_, grid_, is_folded(), and gui2::widget::populate_dirty_list().

Referenced by gui2::tree_view::child_populate_dirty_list().

void gui2::tree_view_node::init_grid ( grid grid,
const std::map< std::string, string_map > &  data 
)
private
bool gui2::tree_view_node::is_folded ( ) const
inline
bool gui2::tree_view_node::is_root_node ( ) const
inline

Is this node the root node?

When the parent tree view is created it adds one special node, the root node. This node has no parent node and some other special features so several code paths need to check whether they are the parent node.

Definition at line 100 of file tree_view_node.hpp.

References parent_node_.

Referenced by add_sibling(), describe_path(), get_indentation_level(), get_node_above(), get_node_below(), parent_node(), and place().

void gui2::tree_view_node::layout_initialize ( const bool  full_initialization)
overridevirtual

How the layout engine works.

Every widget has a member layout_size_ which holds the best size in the current layout phase. When the windows starts the layout phase it calls layout_initialize which resets this value.

Every widget has two function to get the best size. get_best_size tests whether layout_size_ is set and if so returns that value otherwise it calls calculate_best_size so the size can be updated.

During the layout phase some functions can modify layout_size_ so the next call to get_best_size returns the currently best size. This means that after the layout phase get_best_size still returns this value. Initialises the layout phase.

Clears the initial best size for the widgets.

See Layout algorithm for more information.

Parameters
full_initializationFor widgets with scrollbars it hides them unless the mode is scrollbar_mode::ALWAYS_VISIBLE. For other widgets this flag is a NOP.

Reimplemented from gui2::widget.

Definition at line 817 of file tree_view_node.cpp.

References gui2::event::dispatcher::child, children_, grid_, gui2::grid::layout_initialize(), and gui2::widget::layout_initialize().

bool gui2::tree_view_node::operator== ( const tree_view_node node)
inline

Definition at line 39 of file tree_view_node.hpp.

tree_view_node & gui2::tree_view_node::parent_node ( )

Returns the parent node.

Precondition
is_root_node() == false.

Definition at line 198 of file tree_view_node.cpp.

References is_root_node(), and parent_node_.

Referenced by add_sibling(), and get_indentation_level().

const tree_view_node & gui2::tree_view_node::parent_node ( ) const

The const version of parent_node.

Definition at line 204 of file tree_view_node.cpp.

References is_root_node(), and parent_node_.

void gui2::tree_view_node::place ( const point origin,
const point size 
)
overrideprivatevirtual
unsigned gui2::tree_view_node::place ( const unsigned  indentation_step_size,
point  origin,
unsigned  width 
)
private
void gui2::tree_view_node::request_reduce_width ( const unsigned  maximum_width)
overrideprivatevirtual

See widget::request_reduce_width.

Implements gui2::widget.

Definition at line 210 of file tree_view_node.cpp.

void gui2::tree_view_node::select_node ( bool  expand_parents = false)
void gui2::tree_view_node::set_origin ( const point origin)
overrideprivatevirtual
void gui2::tree_view_node::set_visible_rectangle ( const SDL_Rect &  rectangle)
overrideprivatevirtual
void gui2::tree_view_node::signal_handler_label_left_button_click ( const event::ui_event  event,
bool &  handled,
bool &  halt 
)
private
void gui2::tree_view_node::signal_handler_left_button_click ( const event::ui_event  event)
private
Todo:
Rewrite this sizing code for the folding/unfolding.

The code works but feels rather hacky, so better move back to the drawingboard for 1.9.

Definition at line 582 of file tree_view_node.cpp.

References DBG_GUI_E, gui2::event::dispatcher::fire(), fold_internal(), gui2::selectable_item::get_value_bool(), is_folded(), LOG_HEADER, gui2::event::NOTIFY_MODIFIED, toggle_, unfold_internal(), and unfolded_.

Referenced by tree_view_node().

void gui2::tree_view_node::unfold ( const bool  recursive = false)
void gui2::tree_view_node::unfold_internal ( )
private

Friends And Related Function Documentation

friend class tree_view
friend

Definition at line 34 of file tree_view_node.hpp.

friend struct tree_view_node_implementation
friend

Definition at line 33 of file tree_view_node.hpp.

Member Data Documentation

node_children_vector gui2::tree_view_node::children_
private
grid gui2::tree_view_node::grid_
private
selectable_item* gui2::tree_view_node::label_
private

The label to show our selected state.

Definition at line 246 of file tree_view_node.hpp.

Referenced by get_selectable_node_above(), get_selectable_node_below(), select_node(), signal_handler_label_left_button_click(), and tree_view_node().

tree_view_node* gui2::tree_view_node::parent_node_
private
selectable_item* gui2::tree_view_node::toggle_
private

The toggle for the folded state.

Definition at line 243 of file tree_view_node.hpp.

Referenced by fold(), signal_handler_left_button_click(), tree_view_node(), and unfold().

tree_view* gui2::tree_view_node::tree_view_
private

The tree view that owns us.

Definition at line 230 of file tree_view_node.hpp.

Referenced by clear_before_destruct(), get_tree_view(), and ~tree_view_node().

bool gui2::tree_view_node::unfolded_
private

The documentation for this class was generated from the following files: