#include <simple_item_selector.hpp>


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_ |
Definition at line 25 of file simple_item_selector.hpp.
| typedef std::string gui2::tsimple_item_selector::item_type |
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.
| 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.
| 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.

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_.

| int gui2::tsimple_item_selector::selected_index | ( | ) | const [inline] |
Returns the selected item index after displaying.
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().

| 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().

| 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().

| 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.
std::string gui2::tsimple_item_selector::cancel_label_ [private] |
Definition at line 65 of file simple_item_selector.hpp.
Referenced by cancel_label(), pre_show(), and set_cancel_label().
int gui2::tsimple_item_selector::index_ [private] |
Definition at line 60 of file simple_item_selector.hpp.
Referenced by post_show(), pre_show(), selected_index(), and set_selected_index().
list_type gui2::tsimple_item_selector::items_ [private] |
Definition at line 63 of file simple_item_selector.hpp.
Referenced by pre_show().
std::string gui2::tsimple_item_selector::ok_label_ [private] |
Definition at line 65 of file simple_item_selector.hpp.
Referenced by ok_label(), pre_show(), and set_ok_label().
bool gui2::tsimple_item_selector::single_button_ [private] |
Definition at line 62 of file simple_item_selector.hpp.
Referenced by pre_show(), set_single_button(), and single_button().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:22:37 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |