Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends

gui2::ttree_view Class Reference

#include <tree_view.hpp>

Inheritance diagram for gui2::ttree_view:
Inheritance graph
[legend]
Collaboration diagram for gui2::ttree_view:
Collaboration graph
[legend]

List of all members.

Public Types

typedef
implementation::tbuilder_tree_view::tnode 
tnode_definition

Public Member Functions

 ttree_view (const std::vector< tnode_definition > &node_definitions)
 Constructor.
ttree_view_nodeget_root_node ()
ttree_view_nodeadd_node (const std::string &id, const std::map< std::string, string_map > &data)
void remove_node (ttree_view_node *tree_view_node)
void child_populate_dirty_list (twindow &caller, const std::vector< twidget * > &call_stack)
 Inherited from tscrollbar_container.
void set_self_active (const bool)
 Inherited from tcontainer_.
bool empty () const
void layout_children ()
 Inherited from tscrollbar_container.
void set_indention_step_size (const unsigned indention_step_size)
ttree_view_nodeselected_item ()
const ttree_view_nodeselected_item () const
void set_selection_change_callback (boost::function< void()> callback)

Private Member Functions

void resize_content (const int width_modification, const int height_modification)
 Resizes the content.
void layout_children (const bool force)
 Layouts the children if needed.
virtual void finalize_setup ()
 Inherited from tcontainer_.
const std::string & get_control_type () const
 Inherited from tcontrol.
void signal_handler_left_button_down (const event::tevent event)

Private Attributes

const std::vector
< tnode_definition
node_definitions_
unsigned indention_step_size_
bool need_layout_
ttree_view_noderoot_node_
ttree_view_nodeselected_item_
boost::function< void()> selection_change_callback_

Friends

struct implementation::tbuilder_tree_view
class ttree_view_node

Detailed Description

Definition at line 26 of file tree_view.hpp.


Member Typedef Documentation

Definition at line 33 of file tree_view.hpp.


Constructor & Destructor Documentation

gui2::ttree_view::ttree_view ( const std::vector< tnode_definition > &  node_definitions  )  [explicit]

Constructor.

Parameters:
has_minimum Does the listbox need to have one item selected.
has_maximum Can the listbox only have one item selected.
placement How are the items placed.
select Select an item when selected, if false it changes the visible state instead.

Definition at line 36 of file tree_view.cpp.

References signal_handler_left_button_down().

Here is the call graph for this function:


Member Function Documentation

ttree_view_node & gui2::ttree_view::add_node ( const std::string &  id,
const std::map< std::string, string_map > &  data 
)

Definition at line 58 of file tree_view.cpp.

References gui2::ttree_view_node::add_child(), and get_root_node().

Here is the call graph for this function:

void gui2::ttree_view::child_populate_dirty_list ( twindow caller,
const std::vector< twidget * > &  call_stack 
) [virtual]

Inherited from tscrollbar_container.

Reimplemented from gui2::tscrollbar_container.

Definition at line 90 of file tree_view.cpp.

References gui2::ttree_view_node::impl_populate_dirty_list(), and root_node_.

Here is the call graph for this function:

bool gui2::ttree_view::empty (  )  const

Definition at line 100 of file tree_view.cpp.

References gui2::ttree_view_node::empty(), and root_node_.

Referenced by gui2::tcampaign_selection::campaign_selected().

Here is the call graph for this function:

Here is the caller graph for this function:

void gui2::ttree_view::finalize_setup (  )  [private, virtual]
const std::string & gui2::ttree_view::get_control_type (  )  const [private, virtual]

Inherited from tcontrol.

Reimplemented from gui2::tscrollbar_container.

Definition at line 171 of file tree_view.cpp.

References type.

ttree_view_node& gui2::ttree_view::get_root_node (  )  [inline]

Definition at line 50 of file tree_view.hpp.

References root_node_.

Referenced by add_node().

Here is the caller graph for this function:

void gui2::ttree_view::layout_children ( const bool  force  )  [private]
void gui2::ttree_view::layout_children (  )  [virtual]

Inherited from tscrollbar_container.

Reimplemented from gui2::tscrollbar_container.

Definition at line 105 of file tree_view.cpp.

Referenced by gui2::ttree_view_node::place().

Here is the caller graph for this function:

void gui2::ttree_view::remove_node ( ttree_view_node tree_view_node  ) 

Definition at line 64 of file tree_view.cpp.

References gui2::ttree_view_node::children_, gui2::twidget::get_size(), gui2::ttree_view_node::parent_node_, resize_content(), root_node_, and gui2::tpoint::y.

Here is the call graph for this function:

void gui2::ttree_view::resize_content ( const int  width_modification,
const int  height_modification 
) [private]

Resizes the content.

The resize either happens due to resizing the content or invalidate the layout of the window.

Parameters:
width_modification The wanted modification to the width: * negative values reduce width. * zero leave width as is. * positive values increase width.
height_modification The wanted modification to the height: * negative values reduce height. * zero leave height as is. * positive values increase height.

Definition at line 110 of file tree_view.cpp.

References gui2::tscrollbar_container::content_grid(), gui2::tscrollbar_container::content_resize_request(), DBG_GUI_L, gui2::twidget::get_size(), LOG_HEADER, need_layout_, gui2::twidget::set_dirty(), gui2::twidget::set_size(), gui2::tpoint::x, and gui2::tpoint::y.

Referenced by gui2::ttree_view_node::add_child(), gui2::ttree_view_node::clear(), remove_node(), and gui2::ttree_view_node::signal_handler_left_button_click().

Here is the call graph for this function:

Here is the caller graph for this function:

ttree_view_node* gui2::ttree_view::selected_item (  )  [inline]

Definition at line 77 of file tree_view.hpp.

References selected_item_.

Referenced by gui2::tcampaign_selection::campaign_selected().

Here is the caller graph for this function:

const ttree_view_node* gui2::ttree_view::selected_item (  )  const [inline]

Definition at line 79 of file tree_view.hpp.

References selected_item_.

void gui2::ttree_view::set_indention_step_size ( const unsigned  indention_step_size  )  [inline]

Definition at line 72 of file tree_view.hpp.

References indention_step_size_.

void gui2::ttree_view::set_selection_change_callback ( boost::function< void()>  callback  )  [inline]

Definition at line 81 of file tree_view.hpp.

References selection_change_callback_.

void gui2::ttree_view::set_self_active ( const   bool  )  [inline, virtual]

Inherited from tcontainer_.

Implements gui2::tcontainer_.

Definition at line 62 of file tree_view.hpp.

void gui2::ttree_view::signal_handler_left_button_down ( const event::tevent  event  )  [private]

Definition at line 177 of file tree_view.cpp.

References DBG_GUI_E, gui2::twidget::get_window(), gui2::twindow::keyboard_capture(), and LOG_HEADER.

Referenced by ttree_view().

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend struct implementation::tbuilder_tree_view [friend]

Definition at line 29 of file tree_view.hpp.

friend class ttree_view_node [friend]

Definition at line 30 of file tree_view.hpp.


Member Data Documentation

Definition at line 114 of file tree_view.hpp.

Referenced by layout_children(), and resize_content().

Todo:
evaluate which way the dependancy should go.

We no depend on the implementation, maybe the implementation should depend on us instead.

Definition at line 110 of file tree_view.hpp.

boost::function<void ()> gui2::ttree_view::selection_change_callback_ [private]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:23:35 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs