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

gui2::tmulti_page Class Reference

The multi page class. More...

#include <multi_page.hpp>

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

List of all members.

Public Member Functions

 tmulti_page ()
void add_page (const string_map &item)
 Adds single page to the grid.
void add_page (const std::map< std::string, string_map > &data)
 Adds single page to the grid.
void remove_page (const unsigned page, unsigned count=1)
 Removes a page in the multi page.
void clear ()
 Removes all pages in the multi page, clearing it.
unsigned get_page_count () const
 Returns the number of pages.
void select_page (const unsigned page, const bool select=true)
 Selectes a page.
int get_selected_page () const
 Returns the selected page.
const tgridpage_grid (const unsigned page) const
 Returns the grid for the page.
tgridpage_grid (const unsigned page)
 Returns the grid for the page.
bool get_active () const
 Inherited from tcontrol.
unsigned get_state () const
 Inherited from tcontrol.
void set_page_builder (tbuilder_grid_ptr page_builder)

Private Member Functions

void finalize (const std::vector< string_map > &page_data)
 Finishes the building initialization of the widget.
void impl_draw_background (surface &)
 Inherited from tcontrol.
void impl_draw_background (surface &, int, int)
const std::string & get_control_type () const
 Inherited from tcontrol.
void set_self_active (const bool)
 Inherited from tcontainer_.

Private Attributes

tgenerator_generator_
 Contains a pointer to the generator.
tbuilder_grid_const_ptr page_builder_
 Contains the builder for the new items.

Friends

struct implementation::tbuilder_multi_page
class tdebug_layout_graph

Detailed Description

The multi page class.

Definition at line 31 of file multi_page.hpp.


Constructor & Destructor Documentation

gui2::tmulti_page::tmulti_page (  ) 

Definition at line 30 of file multi_page.cpp.

References gui2::tgenerator_::build(), and gui2::tgenerator_::independent.

Here is the call graph for this function:


Member Function Documentation

void gui2::tmulti_page::add_page ( const string_map item  ) 

Adds single page to the grid.

This function expect a page to one multiple widget.

Parameters:
item The data to send to the set_members of the widget.

Definition at line 39 of file multi_page.cpp.

References gui2::tgenerator_::create_item(), generator_, and page_builder_.

Referenced by gui2::ttitle_screen::pre_show(), and gui2::tlobby_main::search_create_window().

Here is the call graph for this function:

Here is the caller graph for this function:

void gui2::tmulti_page::add_page ( const std::map< std::string, string_map > &  data  ) 

Adds single page to the grid.

This function expect a page to have multiple widgets (either multiple columns or one column with multiple widgets).

Parameters:
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 behaviour.

Definition at line 45 of file multi_page.cpp.

References gui2::tgenerator_::create_item(), generator_, and page_builder_.

Here is the call graph for this function:

void gui2::tmulti_page::clear (  ) 

Removes all pages in the multi page, clearing it.

Definition at line 69 of file multi_page.cpp.

References gui2::tgenerator_::clear(), and generator_.

Here is the call graph for this function:

void gui2::tmulti_page::finalize ( const std::vector< string_map > &  page_data  )  [private]

Finishes the building initialization of the widget.

Parameters:
page_data The initial data to fill the widget with.

Definition at line 138 of file multi_page.cpp.

References gui2::tgenerator_::create_items(), generator_, gui2::tcontainer_::grid(), and page_builder_.

Here is the call graph for this function:

bool gui2::tmulti_page::get_active (  )  const [inline, virtual]

Inherited from tcontrol.

Implements gui2::tcontrol.

Definition at line 126 of file multi_page.hpp.

const std::string & gui2::tmulti_page::get_control_type (  )  const [private, virtual]

Inherited from tcontrol.

Implements gui2::tcontrol.

Definition at line 146 of file multi_page.cpp.

References type.

unsigned gui2::tmulti_page::get_page_count (  )  const

Returns the number of pages.

Definition at line 75 of file multi_page.cpp.

References generator_, and gui2::tgenerator_::get_item_count().

Referenced by remove_page(), and gui2::ttitle_screen::update_tip().

Here is the call graph for this function:

Here is the caller graph for this function:

int gui2::tmulti_page::get_selected_page (  )  const

Returns the selected page.

Returns:
The selected page.
Return values:
-1 No page selected.

Definition at line 87 of file multi_page.cpp.

References generator_, and gui2::tgenerator_::get_selected_item().

Referenced by gui2::ttitle_screen::update_tip().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned gui2::tmulti_page::get_state (  )  const [inline, virtual]

Inherited from tcontrol.

Implements gui2::tcontrol.

Definition at line 129 of file multi_page.hpp.

void gui2::tmulti_page::impl_draw_background ( surface ,
int  ,
int   
) [inline, private, virtual]

Reimplemented from gui2::tcontrol.

Definition at line 163 of file multi_page.hpp.

void gui2::tmulti_page::impl_draw_background ( surface  )  [inline, private, virtual]

Inherited from tcontrol.

Since we're always empty the draw does nothing.

Reimplemented from gui2::tcontrol.

Definition at line 162 of file multi_page.hpp.

const tgrid & gui2::tmulti_page::page_grid ( const unsigned  page  )  const

Returns the grid for the page.

Parameters:
page The page to get the grid from, the caller has to make sure the page is a valid page.
Returns:
The grid of the wanted page.

Definition at line 93 of file multi_page.cpp.

References generator_, and gui2::tgenerator_::item().

Referenced by gui2::tlobby_main::active_window_changed(), and gui2::tlobby_main::append_to_chatbox().

Here is the call graph for this function:

Here is the caller graph for this function:

tgrid & gui2::tmulti_page::page_grid ( const unsigned  page  ) 

Returns the grid for the page.

Parameters:
page The page to get the grid from, the caller has to make sure the page is a valid page.
Returns:
The grid of the wanted page.

Definition at line 99 of file multi_page.cpp.

References generator_, and gui2::tgenerator_::item().

Here is the call graph for this function:

void gui2::tmulti_page::remove_page ( const unsigned  page,
unsigned  count = 1 
)

Removes a page in the multi page.

Parameters:
page The page to remove, when not in range the function is ignored.
count The number of pages to remove, 0 means all pages (starting from page).

Definition at line 52 of file multi_page.cpp.

References gui2::tgenerator_::delete_item(), generator_, and get_page_count().

Referenced by gui2::tlobby_main::close_window().

Here is the call graph for this function:

Here is the caller graph for this function:

void gui2::tmulti_page::select_page ( const unsigned  page,
const bool  select = true 
)

Selectes a page.

Parameters:
page The page to select.
select Select or deselect the page.

Definition at line 81 of file multi_page.cpp.

References generator_, and gui2::tgenerator_::select_item().

Referenced by gui2::tlobby_main::close_window(), gui2::tlobby_main::switch_to_window(), and gui2::ttitle_screen::update_tip().

Here is the call graph for this function:

Here is the caller graph for this function:

void gui2::tmulti_page::set_page_builder ( tbuilder_grid_ptr  page_builder  )  [inline]

Definition at line 133 of file multi_page.hpp.

References page_builder_.

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

Inherited from tcontainer_.

Implements gui2::tcontainer_.

Definition at line 172 of file multi_page.hpp.


Friends And Related Function Documentation

friend struct implementation::tbuilder_multi_page [friend]

Definition at line 34 of file multi_page.hpp.

friend class tdebug_layout_graph [friend]

Reimplemented from gui2::tcontainer_.

Definition at line 35 of file multi_page.hpp.


Member Data Documentation

Contains a pointer to the generator.

The pointer is not owned by this class, it's stored in the content_grid_ of the tscrollbar_container super class and freed when it's grid is freed.

Definition at line 152 of file multi_page.hpp.

Referenced by add_page(), clear(), finalize(), get_page_count(), get_selected_page(), page_grid(), remove_page(), and select_page().

Contains the builder for the new items.

Definition at line 155 of file multi_page.hpp.

Referenced by add_page(), finalize(), and set_page_builder().


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:04 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs