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

#include <custom_tod.hpp>

Inheritance diagram for gui2::tcustom_tod:
Inheritance graph

Public Member Functions

 tcustom_tod (editor::editor_display *display, const std::vector< time_of_day > &tods)
 
- Public Member Functions inherited from gui2::tdialog
 tdialog ()
 
virtual ~tdialog ()
 
bool show (CVideo &video, const unsigned auto_close_time=0)
 Shows the window. More...
 
int get_retval () const
 
void set_always_save_fields (const bool always_save_fields)
 
void set_restore (const bool restore)
 

Static Public Member Functions

static bool execute (editor::editor_display *display, const std::vector< time_of_day > &tods, CVideo &video)
 

Private Member Functions

void do_next_tod (twindow &window)
 Callback for the next tod button. More...
 
void do_prev_tod (twindow &window)
 
void do_new_tod (twindow &window)
 
void do_delete_tod (twindow &window)
 
void select_file (const std::string &filename, const std::string &default_dir, const std::string &attribute, twindow &window)
 
void update_tod_display (twindow &window)
 
void update_lawful_bonus (twindow &window)
 
void set_selected_tod (time_of_day tod)
 
const time_of_dayget_selected_tod () const
 
void update_selected_tod_info (twindow &window)
 
virtual const std::stringwindow_id () const
 Inherited from tdialog, implemented by REGISTER_DIALOG. More...
 
void pre_show (twindow &window)
 Inherited from tdialog. More...
 
void post_show (twindow &window)
 Inherited from tdialog. More...
 

Private Attributes

std::vector< time_of_daytods_
 Available time_of_days. More...
 
int current_tod_
 Current map generator index. More...
 
ttext_boxcurrent_tod_name_
 Text boxes for name and id. More...
 
ttext_boxcurrent_tod_id_
 
timage * current_tod_image_
 Images for the current tod. More...
 
timage * current_tod_mask_
 
tlabelcurrent_tod_sound_
 Labels for the current tod. More...
 
tlabelcurrent_tod_number_
 
tfield_integerlawful_bonus_field_
 
tslidertod_red_field_
 
tslidertod_green_field_
 
tslidertod_blue_field_
 
editor::editor_displaydisplay_
 The display to update when the ToD changes. More...
 

Additional Inherited Members

- Protected Member Functions inherited from gui2::tdialog
tfield_boolregister_bool (const std::string &id, const bool mandatory, const std::function< bool()> &callback_load_value=std::function< bool()>(), const std::function< void(const bool)> &callback_save_value=std::function< void(const bool)>(), const std::function< void(twidget &)> &callback_change=std::function< void(twidget &)>())
 Creates a new boolean field. More...
 
tfield_boolregister_bool (const std::string &id, const bool mandatory, bool &linked_variable, const std::function< void(twidget &)> &callback_change=std::function< void(twidget &)>())
 Creates a new boolean field. More...
 
tfield_integerregister_integer (const std::string &id, const bool mandatory, const std::function< int()> &callback_load_value=std::function< int()>(), const std::function< void(const int)> &callback_save_value=std::function< void(const int)>())
 Creates a new integer field. More...
 
tfield_integerregister_integer (const std::string &id, const bool mandatory, int &linked_variable)
 Creates a new integer field. More...
 
tfield_textregister_text (const std::string &id, const bool mandatory, const std::function< std::string()> &callback_load_value=std::function< std::string()>(), const std::function< void(const std::string &)> &callback_save_value=std::function< void(const std::string &)>(), const bool capture_focus=false)
 Creates a new text field. More...
 
tfield_textregister_text (const std::string &id, const bool mandatory, std::string &linked_variable, const bool capture_focus=false)
 Creates a new text field. More...
 
tfield_labelregister_label (const std::string &id, const bool mandatory, const std::string &text, const bool use_markup=false)
 Registers a new control as a label. More...
 
tfield_labelregister_image (const std::string &id, const bool mandatory, const std::string &filename)
 Registers a new control as image. More...
 

Detailed Description

Definition at line 42 of file custom_tod.hpp.

Constructor & Destructor Documentation

gui2::tcustom_tod::tcustom_tod ( editor::editor_display display,
const std::vector< time_of_day > &  tods 
)

Definition at line 88 of file custom_tod.cpp.

Referenced by execute().

Member Function Documentation

void gui2::tcustom_tod::do_delete_tod ( twindow window)
private

Definition at line 149 of file custom_tod.cpp.

References current_tod_, tods_, and update_selected_tod_info().

Referenced by pre_show().

void gui2::tcustom_tod::do_new_tod ( twindow window)
private

Definition at line 143 of file custom_tod.cpp.

References current_tod_, tods_, and update_selected_tod_info().

Referenced by pre_show().

void gui2::tcustom_tod::do_next_tod ( twindow window)
private

Callback for the next tod button.

Definition at line 131 of file custom_tod.cpp.

References current_tod_, tods_, and update_selected_tod_info().

Referenced by pre_show().

void gui2::tcustom_tod::do_prev_tod ( twindow window)
private

Definition at line 137 of file custom_tod.cpp.

References current_tod_, tods_, and update_selected_tod_info().

Referenced by pre_show().

static bool gui2::tcustom_tod::execute ( editor::editor_display display,
const std::vector< time_of_day > &  tods,
CVideo video 
)
inlinestatic

Definition at line 48 of file custom_tod.hpp.

References tcustom_tod().

Referenced by editor::editor_controller::custom_tods_dialog().

const time_of_day & gui2::tcustom_tod::get_selected_tod ( ) const
private

Definition at line 164 of file custom_tod.cpp.

References current_tod_, and tods_.

Referenced by pre_show(), and update_selected_tod_info().

void gui2::tcustom_tod::post_show ( twindow window)
privatevirtual

Inherited from tdialog.

Reimplemented from gui2::tdialog.

Definition at line 339 of file custom_tod.cpp.

References gui2::tdialog::get_retval(), gui2::twindow::OK, and update_tod_display().

void gui2::tcustom_tod::pre_show ( twindow window)
privatevirtual
void gui2::tcustom_tod::select_file ( const std::string filename,
const std::string default_dir,
const std::string attribute,
twindow window 
)
private
void gui2::tcustom_tod::set_selected_tod ( time_of_day  tod)
private
void gui2::tcustom_tod::update_lawful_bonus ( twindow window)
private
void gui2::tcustom_tod::update_selected_tod_info ( twindow window)
private
void gui2::tcustom_tod::update_tod_display ( twindow window)
private
virtual const std::string& gui2::tcustom_tod::window_id ( ) const
privatevirtual

Inherited from tdialog, implemented by REGISTER_DIALOG.

Implements gui2::tdialog.

Member Data Documentation

int gui2::tcustom_tod::current_tod_
private
ttext_box* gui2::tcustom_tod::current_tod_id_
private

Definition at line 94 of file custom_tod.hpp.

Referenced by pre_show(), and update_selected_tod_info().

timage* gui2::tcustom_tod::current_tod_image_
private

Images for the current tod.

Definition at line 97 of file custom_tod.hpp.

Referenced by pre_show(), and update_selected_tod_info().

timage* gui2::tcustom_tod::current_tod_mask_
private

Definition at line 98 of file custom_tod.hpp.

Referenced by pre_show(), and update_selected_tod_info().

ttext_box* gui2::tcustom_tod::current_tod_name_
private

Text boxes for name and id.

Definition at line 93 of file custom_tod.hpp.

Referenced by pre_show(), and update_selected_tod_info().

tlabel* gui2::tcustom_tod::current_tod_number_
private

Definition at line 102 of file custom_tod.hpp.

Referenced by pre_show(), and update_selected_tod_info().

tlabel* gui2::tcustom_tod::current_tod_sound_
private

Labels for the current tod.

Definition at line 101 of file custom_tod.hpp.

Referenced by pre_show(), and update_selected_tod_info().

editor::editor_display* gui2::tcustom_tod::display_
private

The display to update when the ToD changes.

The pointer may be nullptr, in the unit tests, but normally it should be a pointer to a valid object.

Definition at line 115 of file custom_tod.hpp.

Referenced by select_file(), and update_tod_display().

tfield_integer* gui2::tcustom_tod::lawful_bonus_field_
private

Definition at line 104 of file custom_tod.hpp.

Referenced by pre_show(), update_lawful_bonus(), and update_selected_tod_info().

tslider* gui2::tcustom_tod::tod_blue_field_
private

Definition at line 107 of file custom_tod.hpp.

Referenced by pre_show(), update_selected_tod_info(), and update_tod_display().

tslider* gui2::tcustom_tod::tod_green_field_
private

Definition at line 106 of file custom_tod.hpp.

Referenced by pre_show(), update_selected_tod_info(), and update_tod_display().

tslider* gui2::tcustom_tod::tod_red_field_
private

Definition at line 105 of file custom_tod.hpp.

Referenced by pre_show(), update_selected_tod_info(), and update_tod_display().

std::vector<time_of_day> gui2::tcustom_tod::tods_
private

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