16 #ifndef GUI_DIALOGS_PREFERENCES_DIALOG_HPP_INCLUDED
17 #define GUI_DIALOGS_PREFERENCES_DIALOG_HPP_INCLUDED
29 struct hotkey_command;
111 const bool start_value,
112 std::function<
void(
bool)> callback,
114 const bool inverted =
false);
117 std::function<
void(
bool)> setter,
118 const bool inverted);
128 const bool toggle_start_value,
129 const int slider_state_value,
130 std::function<
void(
bool)> toggle_callback,
131 std::function<
void(
int)> slider_callback,
135 tslider& slider_widget, std::function<
void(
bool)> setter);
143 const int start_value,
144 std::function<
void(
int)> slider_callback,
148 std::function<
void(
int)> setter);
150 typedef std::pair<std::vector<std::string>, std::vector<std::string> >
combo_data;
158 const unsigned start_value,
163 std::function<
void(
std::string)> setter, std::vector<std::string>& vec);
173 template <
typename T>
177 const int start_value,
179 std::function<
void(
int)> callback,
182 template <
typename T>
185 std::function<
void(
int)> setter);
190 template <
typename T>
202 template <
typename T>
213 std::vector<
std::pair<
int,
int> > resolutions_;
std::vector< const hotkey::hotkey_command * > t_visible_hotkeys
void setup_toggle_slider_pair(const std::string &toggle_widget, const std::string &slider_widget, const bool toggle_start_value, const int slider_state_value, std::function< void(bool)> toggle_callback, std::function< void(int)> slider_callback, twidget &find_in)
Sets the initial state and callback for a bool-state toggle button/slider pair.
void setup_combobox(const std::string &widget_id, const combo_data &options, const unsigned start_value, std::function< void(std::string)> callback, twidget &find_in)
Sets the initial state and callback for a combobox.
void simple_combobox_callback(const tcombobox &widget, std::function< void(std::string)> setter, std::vector< std::string > &vec)
void default_hotkey_callback(twindow &window)
void accl_speed_slider_callback(tslider &slider)
std::pair< std::vector< std::string >, std::vector< std::string > > combo_data
#define MAKE_ENUM(NAME, CONTENT)
void fullscreen_toggle_callback(twindow &window)
std::vector< std::string > friend_names_
void set_selected_index(std::pair< int, int > index)
void initialize_members(twindow &window)
Initializers.
void setup_friends_list(twindow &window)
tgroup< preferences::LOBBY_JOINS > lobby_joins_group
Sets the a radio button group Since (so far) there is only one group of these, the code is speciliaze...
void set_visible_page(twindow &window, unsigned int page, const std::string &pager_id)
void remove_friend_list_entry(tlistbox &friends_list, ttext_box &textbox, twindow &window)
void on_tab_select(twindow &window)
Class for a single line text area.
void toggle_radio_callback(tgroup< T > &group, std::function< void(int)> setter)
MAKE_ENUM(ADVANCED_PREF_TYPE,(TOGGLE,"boolean")(SLIDER,"int")(COMBO,"combo")(SPECIAL,"custom")) std std::vector< config > adv_preferences_cfg_
Definitions for the interface to Wesnoth Markup Language (WML).
void bind_status_label(T &parent, const std::string &label_id, twidget &find_in)
Sets up a label that always displays the value of another widget.
void add_friend_list_entry(const bool is_friend, ttext_box &textbox, twindow &window)
void add_hotkey_callback(tlistbox &hotkeys)
Keyboard shortcuts for game actions.
void post_show(twindow &)
Actions to be taken after the window has been shown.
void setup_single_toggle(const std::string &widget_id, const bool start_value, std::function< void(bool)> callback, twidget &find_in, const bool inverted=false)
Sets the initial state and callback for a simple bool-state toggle button In the callback, the bool value of the widget is passeed to the setter.
base class of top level items, the only item which needs to store the final canvases to draw on ...
void setup_single_slider(const std::string &widget_id, const int start_value, std::function< void(int)> slider_callback, twidget &find_in)
Sets the initial state and callback for a standalone slider In the callback, int value of the widget ...
A class inherited from ttext_box that displays its input as stars.
void single_toggle_callback(const ttoggle_button &widget, std::function< void(bool)> setter, const bool inverted)
bool is_friend(const std::string &nick)
std::pair< int, int > index_
Abstract base class for all dialogs.
void remove_hotkey_callback(tlistbox &hotkeys)
void edit_friend_list_entry(tlistbox &friends, ttext_box &textbox)
void handle_res_select(twindow &window)
Special callback functions.
void single_slider_callback(const tslider &widget, std::function< void(int)> setter)
void status_label_callback(T &parent_widget, tcontrol &label_widget, const std::string &suffix="")
void font_scaling_slider_callback(tslider &slider)
t_visible_hotkeys visible_hotkeys_
void animate_map_toggle_callback(ttoggle_button &toggle, ttoggle_button &toggle_water)
static bool display(CVideo &video, const config &game_cfg)
The display function – see tdialog for more information.
tpreferences(CVideo &video, const config &game_cfg)
Constructor.
void on_advanced_prefs_list_select(tlistbox &tree, twindow &window)
void initialize_tabs(twindow &window, tlistbox &selector, const int index)
Base class for all visible items.
void max_autosaves_slider_callback(tslider &slider, tcontrol &status_label)
void setup_hotkey_list(twindow &window)
void toggle_slider_pair_callback(const ttoggle_button &toggle_widget, tslider &slider_widget, std::function< void(bool)> setter)
void add_tab(tlistbox &tab_bar, const std::string &label)
virtual const std::string & window_id() const
Inherited from tdialog, implemented by REGISTER_DIALOG.
std::vector< t_string > accl_speeds_
void setup_radio_toggle(const std::string &toggle_id, const T &enum_value, const int start_value, tgroup< T > &group, std::function< void(int)> callback, twindow &window)
void add_pager_row(tlistbox &selector, const std::string &icon, const std::string &label)
void on_page_select(twindow &window)
Callback for selection changes.
A config object defines a single node in a WML file, with access to child nodes.
Defines the MAKE_ENUM macro.
GLsizei const GLcharARB ** string
void pre_show(twindow &window)
Inherited from tdialog.