#include <tree_view_node.hpp>
Public Types | |
typedef implementation::ttree_node | tnode_definition |
Public Types inherited from gui2::event::tdispatcher | |
enum | tevent_type { pre = 1, child = 2, post = 4 } |
enum | tposition { 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 | tmouse_behavior { all, hit, none } |
The behavior of the mouse events. More... | |
Public Member Functions | |
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) | |
~ttree_view_node () | |
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. More... | |
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. More... | |
bool | is_root_node () const |
Is this node the root node? More... | |
unsigned | get_indention_level () const |
The indention 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 () |
void | unfold () |
virtual iterator::twalker_ * | create_walker () override |
See twidget::create_walker. More... | |
virtual twidget * | find_at (const tpoint &coordinate, const bool must_be_active) override |
See twidget::find_at. More... | |
virtual const twidget * | find_at (const tpoint &coordinate, const bool must_be_active) const override |
See twidget::find_at. More... | |
twidget * | find (const std::string &id, const bool must_be_active) override |
See twidget::find. More... | |
const twidget * | find (const std::string &id, const bool must_be_active) const override |
See twidget::find. More... | |
size_t | size () const |
The "size" of the widget. More... | |
void | clear () |
Removes all child items from the widget. More... | |
ttree_view_node & | parent_node () |
Returns the parent node. More... | |
const ttree_view_node & | parent_node () const |
The const version of parent_node. More... | |
ttree_view & | tree_view () |
const ttree_view & | tree_view () const |
ttree_view_node & | get_child_at (int index) |
std::vector< int > | describe_path () |
calculates the node indicies that we need to get from the root node to this node. More... | |
void | set_callback_state_change (const int scope, std::function< void(twidget &)> callback) |
Inherited from tselectable_. More... | |
ttree_view_node * | get_last_visible_parent_node () |
ttree_view_node * | get_node_above () |
ttree_view_node * | get_node_below () |
ttree_view_node * | get_selectable_node_above () |
ttree_view_node * | get_selectable_node_below () |
void | select_node () |
tgrid & | get_grid () |
void | layout_initialise (const bool full_initialisation) |
How the layout engine works. More... | |
Public Member Functions inherited from gui2::twidget | |
twidget () | |
twidget (const tbuilder_widget &builder) | |
Constructor. More... | |
virtual | ~twidget () override |
void | set_id (const std::string &id) |
const std::string & | id () const |
twindow * | get_window () |
Get the parent window. More... | |
const twindow * | get_window () const |
The constant version of get_window. More... | |
tdialog * | dialog () |
Returns the top-level dialogue. More... | |
void | set_parent (twidget *parent) |
twidget * | parent () |
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... | |
tpoint | 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 tpoint &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 | layout_children () |
Allows a widget to update its children. More... | |
tpoint | get_origin () const |
Returns the screen origin of the widget. More... | |
tpoint | 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 (twindow &caller, std::vector< twidget * > &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 tvisible::scoped_enum visible) |
tvisible::scoped_enum | get_visible () const |
tredraw_action::scoped_enum | get_drawing_action () const |
void | set_debug_border_mode (const unsigned debug_border_mode) |
void | set_debug_border_colour (const unsigned debug_border_colour) |
virtual bool | has_widget (const twidget &widget) const |
Does the widget contain the widget. More... | |
Public Member Functions inherited from gui2::tevent_executor | |
tevent_executor () | |
virtual | ~tevent_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 |
tevent_executor & | set_wants_mouse_right_double_click (const bool click=true) |
bool | wants_mouse_right_double_click () const |
Public Member Functions inherited from gui2::event::tdispatcher | |
tdispatcher () | |
virtual | ~tdispatcher () |
void | connect () |
Connects the dispatcher to the event handler. More... | |
bool | has_event (const tevent event, const tevent_type event_type) |
bool | fire (const tevent event, twidget &target) |
Fires an event which has no extra parameters. More... | |
bool | fire (const tevent event, twidget &target, const tpoint &coordinate) |
Fires an event which takes a coordinate parameter. More... | |
bool | fire (const tevent event, twidget &target, const SDLKey key, const SDLMod modifier, const utf8::string &unicode) |
Fires an event which takes keyboard parameters. More... | |
bool | fire (const tevent event, twidget &target, void *) |
Fires an event which takes notification parameters. More... | |
bool | fire (const tevent event, twidget &target, tmessage &message) |
Fires an event which takes message parameters. More... | |
template<tevent E> | |
boost::enable_if < boost::mpl::has_key < tset_event, boost::mpl::int_ < E > > >::type | connect_signal (const tsignal_function &signal, const tposition position=back_child) |
Connect a signal for callback in tset_event. More... | |
template<tevent E> | |
boost::enable_if < boost::mpl::has_key < tset_event, boost::mpl::int_ < E > > >::type | disconnect_signal (const tsignal_function &signal, const tposition position=back_child) |
Disconnect a signal for callback in tset_event. More... | |
template<tevent E> | |
boost::enable_if < boost::mpl::has_key < tset_event_mouse, boost::mpl::int_< E > > >::type | connect_signal (const tsignal_mouse_function &signal, const tposition position=back_child) |
Connect a signal for callback in tset_event_mouse. More... | |
template<tevent E> | |
boost::enable_if < boost::mpl::has_key < tset_event_mouse, boost::mpl::int_< E > > >::type | disconnect_signal (const tsignal_mouse_function &signal, const tposition position=back_child) |
Disconnect a signal for callback in tset_event_mouse. More... | |
template<tevent E> | |
boost::enable_if < boost::mpl::has_key < tset_event_keyboard, boost::mpl::int_< E > > >::type | connect_signal (const tsignal_keyboard_function &signal, const tposition position=back_child) |
Connect a signal for callback in tset_event_keyboard. More... | |
template<tevent E> | |
boost::enable_if < boost::mpl::has_key < tset_event_keyboard, boost::mpl::int_< E > > >::type | disconnect_signal (const tsignal_keyboard_function &signal, const tposition position=back_child) |
Disconnect a signal for callback in tset_event_keyboard. More... | |
template<tevent E> | |
boost::enable_if < boost::mpl::has_key < tset_event_notification, boost::mpl::int_< E > > >::type | connect_signal (const tsignal_notification_function &signal, const tposition position=back_child) |
Connect a signal for callback in tset_event_notification. More... | |
template<tevent E> | |
boost::enable_if < boost::mpl::has_key < tset_event_notification, boost::mpl::int_< E > > >::type | disconnect_signal (const tsignal_notification_function &signal, const tposition position=back_child) |
Disconnect a signal for callback in tset_event_notification. More... | |
template<tevent E> | |
boost::enable_if < boost::mpl::has_key < tset_event_message, boost::mpl::int_< E > > >::type | connect_signal (const tsignal_message_function &signal, const tposition position=back_child) |
Connect a signal for callback in tset_event_message. More... | |
template<tevent E> | |
boost::enable_if < boost::mpl::has_key < tset_event_message, boost::mpl::int_< E > > >::type | disconnect_signal (const tsignal_message_function &signal, const tposition position=back_child) |
Disconnect a signal for callback in tset_event_message. More... | |
void | capture_mouse () |
Captures the mouse. More... | |
void | release_mouse () |
Releases the mouse capture. More... | |
void | set_mouse_behavior (const tmouse_behavior mouse_behavior) |
tmouse_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 thotkey_function &function) |
Registers a hotkey. More... | |
bool | execute_hotkey (const hotkey::HOTKEY_COMMAND id) |
Executes a hotkey. More... | |
Private Attributes | |
ttree_view_node * | parent_node_ |
Our parent node. More... | |
ttree_view & | tree_view_ |
The tree view that owns us. More... | |
tgrid | grid_ |
Grid holding our contents. More... | |
boost::ptr_vector < ttree_view_node > | children_ |
Our children. More... | |
const std::vector < tnode_definition > & | node_definitions_ |
The node definitions known to use. More... | |
tselectable_ * | toggle_ |
The toggle for the folded state. More... | |
tselectable_ * | label_ |
The label to show our selected state. More... | |
bool | unfolded_ |
std::function< void(twidget &)> | callback_state_change_ |
See tselectable_::set_callback_state_change. More... | |
std::function< void(twidget &)> | callback_state_to_folded_ |
See tselectable_::set_callback_state_change. More... | |
std::function< void(twidget &)> | callback_state_to_unfolded_ |
See tselectable_::set_callback_state_change. More... | |
Friends | |
struct | ttree_view_node_implementation |
class | ttree_view |
Additional Inherited Members | |
Protected Member Functions inherited from gui2::twidget | |
void | set_layout_size (const tpoint &size) |
const tpoint & | layout_size () const |
Definition at line 33 of file tree_view_node.hpp.
Definition at line 39 of file tree_view_node.hpp.
gui2::ttree_view_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 | ||
) |
Definition at line 35 of file tree_view_node.cpp.
References _(), gui2::event::tdispatcher::back_post_child, gui2::event::tdispatcher::connect_signal(), gui2::tgrid::find(), gui2::event::tdispatcher::front_child, gui2::event::tdispatcher::front_pre_child, grid_, gui2::twidget::tvisible::hidden, init_grid(), label_, gui2::event::LEFT_BUTTON_CLICK, node_definitions_, parent_node_, gui2::ttree_view::selected_item_, gui2::twidget::set_parent(), gui2::tselectable_::set_value(), gui2::twidget::set_visible(), signal_handler_label_left_button_click(), signal_handler_left_button_click(), toggle_, tree_view(), unfolded_, VALIDATE, and gui2::twidget::tvisible::visible.
Referenced by add_child().
gui2::ttree_view_node::~ttree_view_node | ( | ) |
Definition at line 129 of file tree_view_node.cpp.
References gui2::ttree_view::selected_item_, and tree_view().
ttree_view_node & gui2::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.
id | The id of the node definition to use for the new node. |
data | The 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. |
index | The item before which to add the new item, 0 == begin, -1 == end. |
Definition at line 136 of file tree_view_node.cpp.
References children_, gui2::tscrollbar_container::content_grid(), get_indention_level(), gui2::twidget::get_size(), gui2::twidget::get_width(), gui2::ttree_view::indention_step_size_, is_folded(), is_root_node(), itor, node_definitions_, gui2::ttree_view::resize_content(), tree_view(), ttree_view_node(), gui2::tpoint::x, and gui2::tpoint::y.
Referenced by gui2::ttree_view::add_node(), add_sibling(), lua_gui2::intf_add_dialog_tree_node(), gui2::tcampaign_selection::pre_show(), and gui2::tlobby_main::update_playerlist().
|
inline |
Adds a sibbling for a node at the end of the list.
id | The id of the node definition to use for the new node. |
data | The 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 83 of file tree_view_node.hpp.
References add_child(), is_root_node(), and parent_node().
|
overrideprivatevirtual |
See twidget::calculate_best_size.
Implements gui2::twidget.
Definition at line 385 of file tree_view_node.cpp.
References tree_view().
Referenced by calculate_best_size().
|
private |
Definition at line 464 of file tree_view_node.cpp.
References calculate_best_size(), children_, DBG_GUI_L, gui2::twidget::get_best_size(), gui2::twidget::get_visible(), grid_, gui2::twidget::tvisible::invisible, is_folded(), itor, gui2::log_gui_layout, LOG_HEADER, log_scope2, LOG_SCOPE_HEADER, gui2::tpoint::x, and gui2::tpoint::y.
|
private |
Definition at line 708 of file tree_view_node.cpp.
References calculate_ypos(), children_, and parent_node_.
Referenced by calculate_ypos(), clear(), fold_internal(), and unfold_internal().
void gui2::ttree_view_node::clear | ( | ) |
Removes all child items from the widget.
Definition at line 279 of file tree_view_node.cpp.
References calculate_ypos(), children_, is_folded(), gui2::ttree_view::resize_content(), and tree_view().
Referenced by gui2::tlobby_main::update_playerlist().
|
inlineoverridevirtual |
Implements gui2::twidget.
Definition at line 138 of file tree_view_node.hpp.
std::vector< int > gui2::ttree_view_node::describe_path | ( | ) |
calculates the node indicies that we need to get from the root node to this node.
Definition at line 690 of file tree_view_node.cpp.
References children_, describe_path(), i, is_root_node(), parent_node_, and size().
Referenced by describe_path().
|
overrideprivatevirtual |
See twidget::disable_click_dismiss.
Implements gui2::twidget.
Definition at line 390 of file tree_view_node.cpp.
|
inline |
Does the node have children?
Definition at line 110 of file tree_view_node.hpp.
References children_.
Referenced by gui2::tsub_player_list::auto_hide(), and gui2::ttree_view::empty().
|
overridevirtual |
See twidget::find.
Reimplemented from gui2::twidget.
Definition at line 355 of file tree_view_node.cpp.
References gui2::tgrid::find(), gui2::twidget::find(), and grid_.
Referenced by find_widget(), and gui2::tcampaign_selection::pre_show().
|
overridevirtual |
See twidget::find.
Reimplemented from gui2::twidget.
Definition at line 361 of file tree_view_node.cpp.
References gui2::tgrid::find(), gui2::twidget::find(), and grid_.
|
overridevirtual |
See twidget::find_at.
Reimplemented from gui2::twidget.
Definition at line 341 of file tree_view_node.cpp.
|
overridevirtual |
See twidget::find_at.
Reimplemented from gui2::twidget.
Definition at line 348 of file tree_view_node.cpp.
void gui2::ttree_view_node::fold | ( | ) |
Definition at line 225 of file tree_view_node.cpp.
References fold_internal(), is_folded(), gui2::tselectable_::set_value(), and toggle_.
Referenced by gui2::ttree_view::handle_key_left_arrow().
|
private |
Definition at line 245 of file tree_view_node.cpp.
References calculate_ypos(), callback_state_to_folded_, get_current_size(), get_folded_size(), get_unfolded_size(), gui2::ttree_view::resize_content(), tree_view(), unfolded_, gui2::tpoint::x, and gui2::tpoint::y.
Referenced by fold(), and signal_handler_left_button_click().
ttree_view_node & gui2::ttree_view_node::get_child_at | ( | int | index | ) |
Definition at line 684 of file tree_view_node.cpp.
References children_.
Referenced by find_widget(), get_node_above(), and get_node_below().
|
private |
Returns the control_type of the ttree_view_node.
This class does not derive from tcontrol but the function behaves similar as tcontrol::get_control_type.
Definition at line 678 of file tree_view_node.cpp.
|
private |
assume_visible | if false (default) it will return 0 if the parent node is folded |
Definition at line 395 of file tree_view_node.cpp.
References children_, get_current_size(), get_folded_size(), gui2::twidget::get_visible(), grid_, gui2::twidget::tvisible::invisible, is_folded(), itor, parent_node_, size(), gui2::tpoint::x, and gui2::tpoint::y.
Referenced by fold_internal(), get_current_size(), get_unfolded_size(), and unfold_internal().
|
private |
Definition at line 426 of file tree_view_node.cpp.
References gui2::twidget::get_best_size(), get_indention_level(), grid_, gui2::ttree_view::indention_step_size_, size(), tree_view(), and gui2::tpoint::x.
Referenced by fold_internal(), get_current_size(), and unfold_internal().
|
inline |
Definition at line 223 of file tree_view_node.hpp.
References grid_.
unsigned gui2::ttree_view_node::get_indention_level | ( | ) | const |
The indention level of the node.
The root node starts at level 0.
Definition at line 180 of file tree_view_node.cpp.
References is_root_node(), and parent_node().
Referenced by add_child(), get_folded_size(), and get_unfolded_size().
ttree_view_node * gui2::ttree_view_node::get_last_visible_parent_node | ( | ) |
Definition at line 722 of file tree_view_node.cpp.
References get_last_visible_parent_node(), is_folded(), and parent_node_.
Referenced by get_last_visible_parent_node(), and gui2::ttree_view::get_next_node().
ttree_view_node * gui2::ttree_view_node::get_node_above | ( | ) |
Definition at line 731 of file tree_view_node.cpp.
References children_, get_child_at(), i, is_folded(), is_root_node(), parent_node_, and size().
Referenced by get_selectable_node_above().
ttree_view_node * gui2::ttree_view_node::get_node_below | ( | ) |
Definition at line 752 of file tree_view_node.cpp.
References children_, get_child_at(), i, is_folded(), is_root_node(), gui2::twidget::parent(), parent_node_, and size().
Referenced by get_selectable_node_below().
ttree_view_node * gui2::ttree_view_node::get_selectable_node_above | ( | ) |
Definition at line 776 of file tree_view_node.cpp.
References get_node_above(), and label_.
ttree_view_node * gui2::ttree_view_node::get_selectable_node_below | ( | ) |
Definition at line 784 of file tree_view_node.cpp.
References get_node_below(), and label_.
|
private |
Definition at line 436 of file tree_view_node.cpp.
References children_, gui2::twidget::get_best_size(), get_current_size(), get_indention_level(), gui2::twidget::get_visible(), grid_, gui2::ttree_view::indention_step_size_, gui2::twidget::tvisible::invisible, itor, size(), tree_view(), gui2::tpoint::x, and gui2::tpoint::y.
Referenced by fold_internal(), and unfold_internal().
|
overrideprivatevirtual |
See twidget::impl_draw_children.
Reimplemented from gui2::twidget.
Definition at line 572 of file tree_view_node.cpp.
References children_, gui2::twidget::draw_children(), grid_, and is_folded().
|
private |
"Inherited" from twidget.
This version needs to call its children, which are it's child nodes.
Definition at line 368 of file tree_view_node.cpp.
References children_, grid_, is_folded(), and gui2::twidget::populate_dirty_list().
Referenced by gui2::ttree_view::child_populate_dirty_list().
|
private |
Definition at line 638 of file tree_view_node.cpp.
References gui2::tgrid::get_cols(), gui2::tgrid::get_rows(), gui2::twidget::id(), itor, gui2::ttoggle_panel::set_child_members(), gui2::tcontrol::set_members(), and gui2::tgrid::widget().
Referenced by ttree_view_node().
bool gui2::ttree_view_node::is_folded | ( | ) | const |
Is the node folded?
Definition at line 220 of file tree_view_node.cpp.
References unfolded_.
Referenced by add_child(), calculate_best_size(), clear(), fold(), get_current_size(), get_last_visible_parent_node(), get_node_above(), get_node_below(), gui2::ttree_view::handle_key_left_arrow(), gui2::ttree_view::handle_key_right_arrow(), impl_draw_children(), impl_populate_dirty_list(), place(), set_visible_rectangle(), signal_handler_left_button_click(), and unfold().
|
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 97 of file tree_view_node.hpp.
References parent_node_.
Referenced by add_child(), add_sibling(), describe_path(), get_indention_level(), get_node_above(), get_node_below(), parent_node(), and place().
|
virtual |
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_initialise 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.
full_initialisation | For widgets with scrollbars it hides them unless the mode is tscrollbar_mode::always_visible. For other widgets this flag is a NOP. |
Reimplemented from gui2::twidget.
Definition at line 810 of file tree_view_node.cpp.
References gui2::event::tdispatcher::child, children_, grid_, gui2::tgrid::layout_initialise(), and gui2::twidget::layout_initialise().
ttree_view_node & gui2::ttree_view_node::parent_node | ( | ) |
Returns the parent node.
Definition at line 193 of file tree_view_node.cpp.
References is_root_node(), and parent_node_.
Referenced by add_sibling(), and get_indention_level().
const ttree_view_node & gui2::ttree_view_node::parent_node | ( | ) | const |
The const version of parent_node.
Definition at line 199 of file tree_view_node.cpp.
References is_root_node(), and parent_node_.
|
overrideprivatevirtual |
See twidget::place.
Reimplemented from gui2::twidget.
Definition at line 510 of file tree_view_node.cpp.
References gui2::ttree_view::layout_children(), gui2::twidget::place(), and tree_view().
Referenced by gui2::ttree_view::layout_children(), and set_origin().
|
private |
Definition at line 518 of file tree_view_node.cpp.
References children_, DBG_GUI_L, gui2::twidget::get_best_size(), grid_, is_folded(), is_root_node(), gui2::log_gui_layout, LOG_HEADER, log_scope2, LOG_SCOPE_HEADER, gui2::tgrid::place(), gui2::twidget::set_size(), gui2::tpoint::x, and gui2::tpoint::y.
|
overrideprivatevirtual |
See twidget::request_reduce_width.
Implements gui2::twidget.
Definition at line 210 of file tree_view_node.cpp.
void gui2::ttree_view_node::select_node | ( | ) |
Definition at line 793 of file tree_view_node.cpp.
References gui2::tselectable_::get_value_bool(), label_, gui2::ttree_view::selected_item_, gui2::ttree_view::selection_change_callback_, gui2::tselectable_::set_value(), gui2::tselectable_::set_value_bool(), and tree_view().
|
inline |
Inherited from tselectable_.
scope | Specifies the scope of the callback event 0 : on both fold and unfold 1 : on unfolded to folded 2 : on folded to unfolded |
Definition at line 202 of file tree_view_node.hpp.
References callback_state_change_, callback_state_to_folded_, and callback_state_to_unfolded_.
See twidget::set_origin.
Reimplemented from gui2::twidget.
Definition at line 501 of file tree_view_node.cpp.
References gui2::twidget::get_size(), place(), gui2::twidget::set_origin(), and tree_view().
|
overrideprivatevirtual |
See twidget::set_visible_rectangle.
Reimplemented from gui2::twidget.
Definition at line 555 of file tree_view_node.cpp.
References children_, DBG_GUI_L, grid_, is_folded(), gui2::log_gui_layout, LOG_HEADER, log_scope2, LOG_SCOPE_HEADER, and gui2::tgrid::set_visible_rectangle().
Referenced by gui2::ttree_view::layout_children().
|
private |
Definition at line 611 of file tree_view_node.cpp.
References DBG_GUI_E, gui2::tselectable_::get_value(), label_, LOG_HEADER, gui2::ttree_view::selected_item_, gui2::ttree_view::selection_change_callback_, gui2::tselectable_::set_value(), and tree_view().
Referenced by ttree_view_node().
|
private |
The code works but feels rather hacky, so better move back to the drawingboard for 1.9.
Definition at line 589 of file tree_view_node.cpp.
References callback_state_change_, DBG_GUI_E, fold_internal(), gui2::tselectable_::get_value_bool(), is_folded(), LOG_HEADER, toggle_, unfold_internal(), and unfolded_.
Referenced by ttree_view_node().
|
inline |
The "size" of the widget.
Definition at line 163 of file tree_view_node.hpp.
References children_.
Referenced by gui2::tsub_player_list::auto_hide(), describe_path(), find_widget(), get_current_size(), get_folded_size(), get_node_above(), get_node_below(), and get_unfolded_size().
ttree_view & gui2::ttree_view_node::tree_view | ( | ) |
Definition at line 205 of file tree_view_node.cpp.
References tree_view_.
Referenced by add_child(), calculate_best_size(), clear(), fold_internal(), get_folded_size(), get_unfolded_size(), place(), select_node(), set_origin(), signal_handler_label_left_button_click(), ttree_view_node(), unfold_internal(), and ~ttree_view_node().
const ttree_view & gui2::ttree_view_node::tree_view | ( | ) | const |
Definition at line 215 of file tree_view_node.cpp.
References tree_view_.
void gui2::ttree_view_node::unfold | ( | ) |
Definition at line 235 of file tree_view_node.cpp.
References is_folded(), gui2::tselectable_::set_value(), toggle_, and unfold_internal().
Referenced by gui2::ttree_view::handle_key_right_arrow().
|
private |
Definition at line 262 of file tree_view_node.cpp.
References calculate_ypos(), callback_state_to_unfolded_, get_current_size(), get_folded_size(), get_unfolded_size(), gui2::ttree_view::resize_content(), tree_view(), unfolded_, gui2::tpoint::x, and gui2::tpoint::y.
Referenced by signal_handler_left_button_click(), and unfold().
|
friend |
Definition at line 36 of file tree_view_node.hpp.
|
friend |
Definition at line 35 of file tree_view_node.hpp.
See tselectable_::set_callback_state_change.
Definition at line 310 of file tree_view_node.hpp.
Referenced by set_callback_state_change(), and signal_handler_left_button_click().
See tselectable_::set_callback_state_change.
Definition at line 313 of file tree_view_node.hpp.
Referenced by fold_internal(), and set_callback_state_change().
See tselectable_::set_callback_state_change.
Definition at line 316 of file tree_view_node.hpp.
Referenced by set_callback_state_change(), and unfold_internal().
|
private |
Our children.
We want the returned child nodes to remain stable so store pointers.
Definition at line 249 of file tree_view_node.hpp.
Referenced by add_child(), calculate_best_size(), calculate_ypos(), clear(), describe_path(), empty(), get_child_at(), get_current_size(), get_node_above(), get_node_below(), get_unfolded_size(), impl_draw_children(), impl_populate_dirty_list(), layout_initialise(), place(), gui2::ttree_view::remove_node(), set_visible_rectangle(), and size().
|
private |
Grid holding our contents.
Definition at line 242 of file tree_view_node.hpp.
Referenced by calculate_best_size(), find(), get_current_size(), get_folded_size(), get_grid(), get_unfolded_size(), impl_draw_children(), impl_populate_dirty_list(), layout_initialise(), place(), set_visible_rectangle(), and ttree_view_node().
|
private |
The label to show our selected state.
Definition at line 265 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 ttree_view_node().
|
private |
The node definitions known to use.
This list is needed to create new nodes.
Definition at line 259 of file tree_view_node.hpp.
Referenced by add_child(), and ttree_view_node().
|
private |
Our parent node.
All nodes except the root node have a parent node.
Definition at line 236 of file tree_view_node.hpp.
Referenced by calculate_ypos(), describe_path(), get_current_size(), get_last_visible_parent_node(), get_node_above(), get_node_below(), is_root_node(), parent_node(), gui2::ttree_view::remove_node(), and ttree_view_node().
|
private |
The toggle for the folded state.
Definition at line 262 of file tree_view_node.hpp.
Referenced by fold(), signal_handler_left_button_click(), ttree_view_node(), and unfold().
|
private |
The tree view that owns us.
Definition at line 239 of file tree_view_node.hpp.
Referenced by tree_view().
|
private |
Definition at line 267 of file tree_view_node.hpp.
Referenced by fold_internal(), is_folded(), signal_handler_left_button_click(), ttree_view_node(), and unfold_internal().