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

gui2::tsimple_item_selector Class Reference

#include <simple_item_selector.hpp>

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

List of all members.

Public Types

typedef std::vector< std::string > list_type
typedef std::string item_type

Public Member Functions

 tsimple_item_selector (const std::string &title, const std::string &message, list_type const &items, bool title_uses_markup=false, bool message_uses_markup=false)
int selected_index () const
 Returns the selected item index after displaying.
void set_selected_index (int index)
 Sets the initially selected item index (-1 by default).
void set_ok_label (const std::string &s)
 Sets the caption for the OK button.
const std::string & ok_label () const
void set_cancel_label (const std::string &s)
 Sets the caption for the Cancel button.
const std::string & cancel_label () const
void set_single_button (bool value)
 Sets whether the Cancel button should be hidden or not.
bool single_button () const

Private Member Functions

virtual const std::string & window_id () const
 Inherited from tdialog, implemented by REGISTER_DIALOG.
void pre_show (CVideo &video, twindow &window)
 Inherited from tdialog.
void post_show (twindow &window)
 Inherited from tdialog.

Private Attributes

int index_
bool single_button_
list_type items_
std::string ok_label_
std::string cancel_label_

Detailed Description

Definition at line 25 of file simple_item_selector.hpp.


Member Typedef Documentation

Definition at line 29 of file simple_item_selector.hpp.

typedef std::vector< std::string > gui2::tsimple_item_selector::list_type

Definition at line 28 of file simple_item_selector.hpp.


Constructor & Destructor Documentation

gui2::tsimple_item_selector::tsimple_item_selector ( const std::string &  title,
const std::string &  message,
list_type const &  items,
bool  title_uses_markup = false,
bool  message_uses_markup = false 
)

Definition at line 66 of file simple_item_selector.cpp.


Member Function Documentation

const std::string& gui2::tsimple_item_selector::cancel_label (  )  const [inline]

Definition at line 53 of file simple_item_selector.hpp.

References cancel_label_.

const std::string& gui2::tsimple_item_selector::ok_label (  )  const [inline]

Definition at line 49 of file simple_item_selector.hpp.

References ok_label_.

void gui2::tsimple_item_selector::post_show ( twindow window  )  [private, virtual]

Inherited from tdialog.

Reimplemented from gui2::tdialog.

Definition at line 114 of file simple_item_selector.cpp.

References gui2::tdialog::get_retval(), gui2::tlistbox::get_selected_row(), index_, and gui2::twindow::OK.

Here is the call graph for this function:

void gui2::tsimple_item_selector::pre_show ( CVideo video,
twindow window 
) [private, virtual]

Inherited from tdialog.

Reimplemented from gui2::tdialog.

Definition at line 77 of file simple_item_selector.cpp.

References gui2::tlistbox::add_row(), cancel_label_, gui2::tlistbox::get_item_count(), index_, gui2::twidget::INVISIBLE, items_, ok_label_, gui2::tlistbox::select_row(), gui2::tcontrol::set_label(), and single_button_.

Here is the call graph for this function:

int gui2::tsimple_item_selector::selected_index (  )  const [inline]

Returns the selected item index after displaying.

Returns:
-1 if the dialog was cancelled.

Definition at line 42 of file simple_item_selector.hpp.

References index_.

Referenced by events::console_handler::do_choose_level(), and turn_info::process_network_data().

Here is the caller graph for this function:

void gui2::tsimple_item_selector::set_cancel_label ( const std::string &  s  )  [inline]

Sets the caption for the Cancel button.

Definition at line 52 of file simple_item_selector.hpp.

References cancel_label_.

void gui2::tsimple_item_selector::set_ok_label ( const std::string &  s  )  [inline]

Sets the caption for the OK button.

Definition at line 48 of file simple_item_selector.hpp.

References ok_label_.

void gui2::tsimple_item_selector::set_selected_index ( int  index  )  [inline]

Sets the initially selected item index (-1 by default).

Definition at line 45 of file simple_item_selector.hpp.

References index_.

Referenced by events::console_handler::do_choose_level().

Here is the caller graph for this function:

void gui2::tsimple_item_selector::set_single_button ( bool  value  )  [inline]

Sets whether the Cancel button should be hidden or not.

Definition at line 56 of file simple_item_selector.hpp.

References single_button_.

Referenced by turn_info::process_network_data().

Here is the caller graph for this function:

bool gui2::tsimple_item_selector::single_button (  )  const [inline]

Definition at line 57 of file simple_item_selector.hpp.

References single_button_.

virtual const std::string& gui2::tsimple_item_selector::window_id (  )  const [private, virtual]

Inherited from tdialog, implemented by REGISTER_DIALOG.

Implements gui2::tdialog.


Member Data Documentation

Definition at line 65 of file simple_item_selector.hpp.

Referenced by cancel_label(), pre_show(), and set_cancel_label().

Definition at line 60 of file simple_item_selector.hpp.

Referenced by post_show(), pre_show(), selected_index(), and set_selected_index().

Definition at line 63 of file simple_item_selector.hpp.

Referenced by pre_show().

Definition at line 65 of file simple_item_selector.hpp.

Referenced by ok_label(), pre_show(), and set_ok_label().

Definition at line 62 of file simple_item_selector.hpp.

Referenced by pre_show(), set_single_button(), and single_button().


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