The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
statistics_dialog Class Reference

#include <statistics_dialog.hpp>

Inheritance diagram for statistics_dialog:
Inheritance graph

Public Member Functions

 statistics_dialog (game_display &disp, const std::string &title, const unsigned int team, const std::string &team_id, const std::string &player)
 
 ~statistics_dialog ()
 
- Public Member Functions inherited from gui::dialog
 dialog (CVideo &video, const std::string &title="", const std::string &message="", const DIALOG_TYPE type=MESSAGE, const style &dialog_style=default_style)
 
virtual ~dialog ()
 
void set_image (dialog_image *const img)
 
void set_image (surface surf, const std::string &caption="")
 
void set_menu (menu *const m)
 
void set_menu (const std::vector< std::string > &menu_items, menu::sorter *sorter=nullptr)
 
void set_menu_items (const std::vector< std::string > &menu_items, bool keep_selection=false)
 Changes (or sets, if not previously set) the dialog's menu items to the provided list. More...
 
void add_pane (preview_pane *const pp)
 
void set_panes (std::vector< preview_pane * > panes)
 
void set_textbox (dialog_textbox *const box)
 
void set_textbox (const std::string &text_widget_label="", const std::string &text_widget_text="", const int text_widget_max_chars=256, const unsigned int text_box_width=font::relative_size(350))
 
void add_button (dialog_button *const btn, BUTTON_LOCATION loc)
 
void add_button (dialog_button_info btn_info, BUTTON_LOCATION loc=BUTTON_EXTRA)
 
void add_option (const std::string &label, bool checked=false, BUTTON_LOCATION loc=BUTTON_CHECKBOX, const std::string &help_string="")
 
virtual dimension_measurements layout (int xloc=-1, int yloc=-1)
 
void set_layout (dimension_measurements &new_dim)
 
dimension_measurements get_layout () const
 
dialog_frameget_frame ()
 
void set_basic_behavior (DIALOG_TYPE type)
 
int show (int xloc, int yloc)
 
int show ()
 
int result () const
 
menuget_menu ()
 
bool done () const
 
std::string textbox_text () const
 
dialog_textboxget_textbox () const
 
bool option_checked (unsigned int option_index=0)
 
CVideoget_video ()
 

Protected Member Functions

void action (gui::dialog_process_info &dp_info)
 
- Protected Member Functions inherited from gui::dialog
void set_result (const int result)
 
void refresh ()
 
labelget_message () const
 

Private Member Functions

const statistics::statscurrent_stats ()
 Picks out the stats structure that was selected for displaying. More...
 
void display_stats (bool campaign)
 Fills in the text to be displayed in the dialog. More...
 
void do_scene_selection ()
 Implements the scenario selection popup. More...
 

Private Attributes

gui::dialog_buttondetail_btn_
 
gui::dialog_buttontoggle_btn_
 
gui::dialog_buttonscene_btn_
 
std::string player_name_
 
const statistics::stats campaign_
 
const statistics::levels scenarios_
 
size_t scenario_index_
 
unsigned int team_num_
 
std::vector< intunit_count_
 

Static Private Attributes

static bool use_campaign_ = false
 

Additional Inherited Members

- Public Types inherited from gui::dialog
enum  BUTTON_LOCATION {
  BUTTON_STANDARD, BUTTON_EXTRA, BUTTON_EXTRA_LEFT, BUTTON_CHECKBOX,
  BUTTON_CHECKBOX_LEFT, BUTTON_HELP, BUTTON_TOP
}
 
typedef dialog_frame::style style
 
- Static Public Member Functions inherited from gui::dialog
static void delete_empty_menu ()
 Explicit freeing of class static resources. More...
 
- Static Public Attributes inherited from gui::dialog
static const styledefault_style = dialog_frame::default_style
 
static const stylemessage_style = dialog_frame::message_style
 
static const style hotkeys_style
 
static const int message_font_size = font::SIZE_PLUS
 
static const int caption_font_size = font::SIZE_LARGE
 
static const int max_menu_width = -1
 
static const size_t left_padding = font::relative_size(10)
 
static const size_t right_padding = font::relative_size(10)
 
static const size_t image_h_pad = font::relative_size( 10)
 
static const size_t top_padding = font::relative_size(10)
 
static const size_t bottom_padding = font::relative_size(10)
 

Detailed Description

Definition at line 27 of file statistics_dialog.hpp.

Constructor & Destructor Documentation

statistics_dialog::statistics_dialog ( game_display disp,
const std::string title,
const unsigned int  team,
const std::string team_id,
const std::string player 
)
statistics_dialog::~statistics_dialog ( )

Definition at line 198 of file statistics_dialog.cpp.

Member Function Documentation

void statistics_dialog::action ( gui::dialog_process_info dp_info)
protectedvirtual
const statistics::stats & statistics_dialog::current_stats ( )
inlineprivate

Picks out the stats structure that was selected for displaying.

Definition at line 92 of file statistics_dialog.cpp.

References campaign_, scenario_index_, scenarios_, and use_campaign_.

Referenced by action(), and display_stats().

void statistics_dialog::display_stats ( bool  campaign)
private
void statistics_dialog::do_scene_selection ( )
private

Implements the scenario selection popup.

Definition at line 311 of file statistics_dialog.cpp.

References display_stats(), gui::dialog::get_video(), i, gui::widget::location(), gui::MESSAGE, scenario_index_, scenarios_, scene_btn_, gui::button::set_label(), and gui::show_dialog().

Referenced by action().

Member Data Documentation

const statistics::stats statistics_dialog::campaign_
private

Definition at line 50 of file statistics_dialog.hpp.

Referenced by current_stats().

gui::dialog_button* statistics_dialog::detail_btn_
private

Definition at line 46 of file statistics_dialog.hpp.

Referenced by action(), and statistics_dialog().

std::string statistics_dialog::player_name_
private

Definition at line 49 of file statistics_dialog.hpp.

Referenced by action().

size_t statistics_dialog::scenario_index_
private

Definition at line 52 of file statistics_dialog.hpp.

Referenced by current_stats(), display_stats(), and do_scene_selection().

const statistics::levels statistics_dialog::scenarios_
private
gui::dialog_button* statistics_dialog::scene_btn_
private

Definition at line 48 of file statistics_dialog.hpp.

Referenced by display_stats(), do_scene_selection(), and statistics_dialog().

unsigned int statistics_dialog::team_num_
private

Definition at line 53 of file statistics_dialog.hpp.

Referenced by action().

gui::dialog_button* statistics_dialog::toggle_btn_
private

Definition at line 47 of file statistics_dialog.hpp.

Referenced by display_stats(), and statistics_dialog().

std::vector<int> statistics_dialog::unit_count_
private

Definition at line 54 of file statistics_dialog.hpp.

Referenced by action(), and display_stats().

bool statistics_dialog::use_campaign_ = false
staticprivate

Definition at line 57 of file statistics_dialog.hpp.

Referenced by action(), current_stats(), display_stats(), and statistics_dialog().


The documentation for this class was generated from the following files: