A class inherited from ttext_box that displays its input as stars. More...
Namespaces | |
event | |
implementation | |
iterator | |
policy | |
Contains the policies for the tgenerator class. | |
settings | |
This namespace contains the 'global' settings. | |
tip | |
tips | |
Classes | |
class | event_mode_controller |
Controller for WML event and menu item handler views. More... | |
struct | lobby_delay_gamelist_update_guard |
class | side_controller |
class | single_mode_controller |
class | taddon_connect |
Addon connect dialog. More... | |
class | taddon_description |
class | taddon_filter_options |
class | taddon_list |
Shows the list of addons on the server. More... | |
class | taddon_uninstall_list |
class | tadvanced_graphics_options |
struct | tbuilder_grid |
struct | tbuilder_widget |
Contains the info needed to instantiate a widget. More... | |
class | tbutton |
Simple push button. More... | |
struct | tbutton_definition |
class | tcampaign_difficulty |
class | tcampaign_selection |
class | tcampaign_settings |
class | tcanvas |
A simple canvas which can be drawn upon. More... | |
class | tchat_log |
class | tclickable_ |
Small concept class. More... | |
class | tcombobox |
Simple push button. More... | |
struct | tcombobox_definition |
class | tcontainer_ |
A generic container base class. More... | |
class | tcontrol |
Base class for all visible items. More... | |
struct | tcontrol_definition |
class | tcontrol_NEW |
class | tcore_selection |
class | tcustom_tod |
class | tdebug_clock |
Clock to test the draw events. More... | |
class | tdepcheck_confirm_change |
class | tdepcheck_select_new |
class | tdialog |
Abstract base class for all dialogs. More... | |
class | tdrawing |
A widget to draw upon. More... | |
struct | tdrawing_definition |
class | tdrop_down_list |
Used by the combobox widget. More... | |
class | team_mode_controller |
class | tedit_label |
class | tedit_text |
class | teditor_edit_label |
class | teditor_edit_scenario |
class | teditor_edit_side |
class | teditor_generate_map |
The dialog for selecting which random generator to use in the editor. More... | |
class | teditor_new_map |
class | teditor_resize_map |
class | teditor_set_starting_position |
class | tevent_executor |
Event execution calls. More... | |
class | texecutor |
Helper to make removing a timer in a callback safe. More... | |
class | tfield |
Template class to implement the generic field implementation. More... | |
class | tfield_ |
Abstract base class for the fields. More... | |
class | tfield_bool |
Specialized field class for boolean. More... | |
class | tfield_label |
Specialized field class for a control, used for labels and images. More... | |
class | tfield_text |
Specialized field class for text. More... | |
class | tfolder_create |
class | tformula |
Template class can hold a value or a formula to calculate the value. More... | |
class | tformula_debugger |
class | tgame_cache_options |
class | tgame_delete |
class | tgame_load |
class | tgame_save |
class | tgame_save_message |
class | tgame_save_oos |
class | tgame_version |
class | tgamestate_inspector |
class | tgenerator |
Basic template class to generate new items. More... | |
class | tgenerator_ |
Abstract base class for the generator. More... | |
class | tgrid |
Base container class. More... | |
struct | tgrid_implementation |
Helper to implement private functions without modifying the header. More... | |
class | tgroup |
struct | tgui_definition |
class | thorizontal_scrollbar |
A horizontal scrollbar. More... | |
struct | thorizontal_scrollbar_definition |
class | timage |
An image. More... | |
struct | timage_definition |
class | tinteger_selector_ |
Small abstract helper class. More... | |
struct | tkey |
Key type for the cache. More... | |
class | tlabel |
Label showing a text. More... | |
struct | tlabel_definition |
class | tlabel_settings |
class | tlanguage_selection |
struct | tlayout_exception_height_resize_failed |
Exception thrown when the height resizing has failed. More... | |
struct | tlayout_exception_resize_failed |
Basic exception when the layout doesn't fit. More... | |
struct | tlayout_exception_width_modified |
Exception thrown when the width has been modified during resizing. More... | |
struct | tlayout_exception_width_resize_failed |
Exception thrown when the width resizing has failed. More... | |
class | tlegacy_menu_item |
Implements simple parsing of legacy GUI1 item markup. More... | |
class | tlistbox |
The listbox class. More... | |
struct | tlistbox_definition |
class | tloadscreen |
struct | tlobby_chat_window |
class | tlobby_main |
class | tlobby_player_info |
class | tlogging |
class | tlua_interpreter |
class | tmatrix |
The matrix class. More... | |
struct | tmatrix_definition |
class | tmessage |
Main class to show messages to the user. More... | |
struct | tmessage_implementation |
Helper to implement private functions without modifying the header. More... | |
class | tminimap |
The basic minimap class. More... | |
struct | tminimap_definition |
class | tmp_alerts_options |
class | tmp_change_control |
class | tmp_cmd_wrapper |
class | tmp_connect |
class | tmp_create_game |
class | tmp_create_game_set_password |
class | tmp_host_game_prompt |
class | tmp_join_game_password_prompt |
class | tmp_login |
class | tmp_method_selection |
class | tmulti_page |
The multi page class. More... | |
struct | tmulti_page_definition |
class | tnetwork_transmission |
Dialog that tracks network transmissions. More... | |
class | tnotifiee |
Helper class to implement callbacks with lifetime management. More... | |
class | tnotifier |
Helper class to implement callbacks with lifetime management. More... | |
class | tpane |
struct | tpane_implementation |
Helper to implement private functions without modifying the header. More... | |
class | tpanel |
Visible container to hold multiple widgets. More... | |
struct | tpanel_definition |
class | tpassword_box |
class | tplacer_ |
Base class for the placement helper. More... | |
struct | tplayer_list |
struct | tpoint |
Holds a 2D point. More... | |
class | tpopup |
The popup class shows windows that are shown non-modal. More... | |
class | tpreferences |
class | tprogress_bar |
struct | tprogress_bar_definition |
class | trepeating_button |
struct | trepeating_button_definition |
struct | tresolution_definition_ |
Base class of a resolution, contains the common keys for a resolution. More... | |
class | tscreenshot_notification |
class | tscroll_label |
Label showing a text. More... | |
struct | tscroll_label_definition |
class | tscrollbar_ |
Base class for a scroll bar. More... | |
class | tscrollbar_container |
Base class for creating containers with one or two scrollbar(s). More... | |
struct | tscrollbar_container_implementation |
Helper to implement private functions without modifying the header. More... | |
class | tscrollbar_panel |
Visible container to hold multiple widgets. More... | |
struct | tscrollbar_panel_definition |
class | tselect_orb_colors |
class | tselectable_ |
Small abstract helper class. More... | |
class | tsimple_item_selector |
class | tslider |
A slider. More... | |
struct | tslider_definition |
class | tspacer |
An empty widget. More... | |
struct | tspacer_definition |
class | tstacked_widget |
struct | tstacked_widget_definition |
class | tstate_default |
struct | tstate_definition |
Contains the state info for a resolution. More... | |
struct | tsub_player_list |
class | tsynced_choice_wait |
class | ttext_ |
Abstract base class for text items. More... | |
class | ttext_box |
Class for a single line text area. More... | |
struct | ttext_box_definition |
class | ttext_history |
Class for text input history. More... | |
class | ttheme_list |
struct | ttimer |
class | ttip |
The tips of day structure. More... | |
class | ttitle_screen |
This class implements the title screen. More... | |
class | ttoggle_button |
Class for a toggle button. More... | |
struct | ttoggle_button_definition |
class | ttoggle_panel |
Class for a toggle button. More... | |
struct | ttoggle_panel_definition |
class | ttransient_message |
Shows a transient message. More... | |
class | ttree_view |
struct | ttree_view_definition |
class | ttree_view_node |
struct | ttree_view_node_implementation |
class | tunit_attack |
class | tunit_create |
class | tunit_preview_pane |
struct | tunit_preview_pane_definition |
class | tunit_recruit |
class | tunit_test_access_only |
Special helper class to get the list of registered windows. More... | |
struct | tvalue |
Value type for the cache. More... | |
class | tvertical_scrollbar |
A vertical scrollbar. More... | |
struct | tvertical_scrollbar_definition |
class | tviewport |
struct | tviewport_implementation |
Helper to implement private functions without modifying the header. More... | |
class | twidget |
Base class for all widgets. More... | |
class | twindow |
base class of top level items, the only item which needs to store the final canvases to draw on More... | |
class | twindow_builder |
struct | twindow_builder_invalid_id |
Helper struct to signal that get_window_builder failed. More... | |
struct | twindow_definition |
struct | twindow_implementation |
Helper to implement private functions without modifying the header. More... | |
class | twml_error |
WML preprocessor/parser error report dialog. More... | |
class | twml_message_ |
Base class for the wml generated messages. More... | |
class | twml_message_left |
Shows a dialog with the portrait on the left side. More... | |
class | twml_message_option |
Helper class for message options. More... | |
class | twml_message_right |
Shows a dialog with the portrait on the right side. More... | |
class | unit_mode_controller |
class | variable_mode_controller |
Typedefs | |
typedef tfield< int, tinteger_selector_ > | tfield_integer |
typedef boost::intrusive_ptr < tresolution_definition_ > | tresolution_definition_ptr |
typedef boost::intrusive_ptr < const tresolution_definition_ > | tresolution_definition_const_ptr |
typedef boost::intrusive_ptr < tcontrol_definition > | tcontrol_definition_ptr |
typedef boost::intrusive_ptr < tbuilder_widget > | tbuilder_widget_ptr |
typedef boost::intrusive_ptr < const tbuilder_widget > | const_tbuilder_widget_ptr |
typedef boost::intrusive_ptr < tbuilder_grid > | tbuilder_grid_ptr |
typedef boost::intrusive_ptr < const tbuilder_grid > | tbuilder_grid_const_ptr |
typedef std::function< void(twindow &)> | dialog_member_func_type |
typedef tcontrol_NEW < tstate_default > | tbase |
typedef std::map< tkey, tvalue > | tcache |
The cache. More... | |
typedef std::map< std::string, std::function< void(tgui_definition &, const std::string &, const config &, const char *key)> > | tregistered_widget_type |
Functions | |
template<class T > | |
bool | sort (const tpane::titem &lhs, const tpane::titem &rhs, const std::string &tag, const bool ascending) |
bool | contains (const tpane::titem &item, const std::string &tag, const ttext_box &text_box) |
A filter testing whether a search string is used in a text. More... | |
template<class T > | |
T & | get_parent (twidget &widget) |
Returns the first parent of a widget with a certain type. More... | |
template<class T > | |
T * | find_widget (typename utils::tconst_clone< twidget, T >::pointer widget, const std::string &id, const bool must_be_active, const bool must_exist) |
Gets a widget with the wanted id. More... | |
template<class T > | |
T & | find_widget (typename utils::tconst_clone< twidget, T >::pointer widget, const std::string &id, const bool must_be_active) |
Gets a widget with the wanted id. More... | |
bool | is_in_dialog () |
Is a dialog open? More... | |
std::ostream & | operator<< (std::ostream &stream, const tpoint &point) |
static Uint32 | timer_callback (Uint32, void *id) |
size_t | add_timer (const Uint32 interval, const std::function< void(size_t id)> &callback, const bool repeat=false) |
Adds a new timer. More... | |
bool | remove_timer (const size_t id) |
Removes a timer. More... | |
bool | execute_timer (const size_t id) |
Executes a timer. More... | |
template<class T > | |
const T & | cast (tresolution_definition_const_ptr ptr) |
Casts a tresolution_definition_const_ptr to another type. More... | |
static std::map< std::string, std::function < tbuilder_widget_ptr(config)> > & | builder_widget_lookup () |
twindow * | build (CVideo &video, const twindow_builder::tresolution *res) |
Builds a window. More... | |
twindow * | build (CVideo &video, const std::string &type) |
Builds a window. More... | |
void | register_builder_widget (const std::string &id, std::function< tbuilder_widget_ptr(config)> functor) |
Registers a widget to be build. More... | |
tbuilder_widget_ptr | create_builder_widget (const config &cfg) |
Create a widget builder. More... | |
template<class T > | |
tbuilder_widget_ptr | build_widget (const config &cfg) |
Helper to generate a widget from a WML widget instance. More... | |
static std::string | colorify_addon_state_string (const std::string &str, const addon_tracking_info &state, bool verbose=false) |
static std::string | describe_status_simple (const addon_tracking_info &info) |
static std::string | describe_status_verbose (const addon_tracking_info &state) |
static std::string | format_addon_time (time_t time) |
static int | resize_grid_xy_to_idx (const int x, const int y) |
Convert a coordinate on a 3 by 3 grid to an index, return 9 for out of bounds. More... | |
static bool | get_dont_ask_again () |
Helper to invert preferences::ask_delete_saves. More... | |
static void | set_dont_ask_again (const bool ask_again) |
Helper to invert preferences::set_ask_delete_saves. More... | |
template<class D , class V , void(V::*)() fptr> | |
void | dialog_view_callback (twidget &caller) |
Template for dialog callbacks for dialogs using model-view-controller architecture pattern. More... | |
template<class D , void(D::*)(twindow &) fptr> | |
void | dialog_callback (twidget &caller) |
Template for dialog callbacks. More... | |
void | make_dialog_callback_helper (const dialog_member_func_type &t, twidget &caller) |
std::function< void(twidget &)> | make_dialog_callback (dialog_member_func_type func) |
REGISTER_DIALOG (label_settings) | |
static bool | fullscreen (CVideo &video) |
void | show_message (CVideo &video, const std::string &title, const std::string &message, const std::string &button_caption="", const bool auto_close=true, const bool message_use_markup=false) |
Shows a message to the user. More... | |
int | show_message (CVideo &video, const std::string &title, const std::string &message, const tmessage::tbutton_style button_style, bool message_use_markup=false, bool title_use_markup=false) |
Shows a message to the user. More... | |
void | show_error_message (CVideo &video, const std::string &message, bool message_use_markup=false) |
Shows an error message to the user. More... | |
static ttoggle_button * | setup_pref_toggle_button (const std::string &id, bool def, twindow &window) |
static void | setup_item (const std::string &item, twindow &window) |
static void | set_pref_and_button (const std::string &id, bool value, twindow &window) |
static void | revert_to_default_pref_values (twindow &window) |
static void | show_server_list (CVideo &video, twindow &window, tfield_text *host_name) |
static bool | get_do_not_show_again () |
Helper for preferences::ask_delete_saves. More... | |
static void | set_do_not_show_again (const bool do_not_show_again) |
Helper for preferences::set_ask_delete_saves. More... | |
static std::string | disambiguate_widget_value (const ttoggle_button &parent_widget) |
static std::string | disambiguate_widget_value (const tcombobox &parent_widget) |
static std::string | disambiguate_widget_value (const tslider &parent_widget) |
static std::string | get_max_autosaves_status_label (const tslider &slider) |
static void | set_resolution_list (tcombobox &res_list, CVideo &video) |
static tgrid * | get_advanced_row_grid (tlistbox &list, const int selected_row) |
static int | index_in_pager_range (const int &first, const tstacked_widget &pager) |
REGISTER_DIALOG (select_orb_colors) | |
static bool | hotkey (twindow &window, const ttitle_screen::tresult result) |
static bool | fullscreen (CVideo &video) |
static bool | launch_lua_console (twindow &window) |
void | show_transient_message (CVideo &video, const std::string &title, const std::string &message, const std::string &image=std::string(), const bool message_use_markup=false, const bool title_use_markup=false, const bool restore_background=false) |
Shows a transient message to the user. More... | |
void | show_transient_error_message (CVideo &video, const std::string &message, const std::string &image=std::string(), const bool message_use_markup=false) |
Shows a transient error message to the user. More... | |
template<class T > | |
static void | set_label (twindow &window, const std::string &id, const std::string &label) |
static std::string | format_stats (const unit &u) |
static std::string | get_image_mods (const unit &u) |
static void | set_attacker_info (twindow &window, const unit &u) |
static void | set_defender_info (twindow &window, const unit &u) |
static void | set_weapon_info (twindow &window, const std::vector< battle_context > &weapons, const int best_weapon) |
static std::string | can_afford_unit (const std::string &text, const bool can_afford) |
int | show_wml_message (const bool left_side, CVideo &video, const std::string &title, const std::string &message, const std::string &portrait, const bool mirror, const bool has_input, const std::string &input_caption, std::string *input_text, const unsigned maximum_length, const std::vector< twml_message_option > &option_list, int *chosen_option) |
Helper function to show a portrait. More... | |
void | set_single_child (tgrid &grid, twidget *widget) |
Sets the single child in a grid. More... | |
bool | init () |
Initializes the gui subsystems. More... | |
SDL_Rect | create_rect (const tpoint &origin, const tpoint &size) |
Creates a rectangle. More... | |
unsigned | decode_font_style (const std::string &style) |
Converts a font style string to a font style. More... | |
boost::uint32_t | decode_color (const std::string &color) |
Converts a color string to a color. More... | |
PangoAlignment | decode_text_alignment (const std::string &alignment) |
Converts a text alignment string to a text alignment. More... | |
std::string | encode_text_alignment (const PangoAlignment alignment) |
Converts a text alignment to its string representation. More... | |
t_string | missing_widget (const std::string &id) |
Returns a default error message if a mandatory widget is omitted. More... | |
void | get_screen_size_variables (game_logic::map_formula_callable &variable) |
Gets a formula object with the screen size. More... | |
game_logic::map_formula_callable | get_screen_size_variables () |
Gets a formula object with the screen size. More... | |
tpoint | get_mouse_position () |
Returns the current mouse position. More... | |
std::string | debug_truncate (const std::string &text) |
Returns a truncated version of the text. More... | |
template<class R , class F > | |
R | function_wrapper (const R result, const F &function) |
Helper for function wrappers. More... | |
static bool | operator< (const tkey &lhs, const tkey &rhs) |
static bool | compare (const std::pair< unsigned, tcache::iterator > &lhs, const std::pair< unsigned, tcache::iterator > &rhs) |
static void | shrink_cache () |
static void | set_scrollbar_mode (tgrid *scrollbar_grid, tscrollbar_ *scrollbar, tscrollbar_container::tscrollbar_mode &scrollbar_mode, const unsigned items, const unsigned visible_items) |
static bool | is_inserted_before (unsigned insertion_pos, unsigned old_item_count, unsigned old_position, unsigned visible_items) |
static void | adjust_scrollbar_mode (tgrid *scrollbar_grid, tscrollbar_ *scrollbar, tscrollbar_container::tscrollbar_mode &scrollbar_mode, const unsigned items_before, const unsigned items_after, const int insertion_pos, const unsigned visible_items) |
static std::vector< std::string > & | registered_window_types () |
Returns the list of registered windows. More... | |
static tregistered_widget_type & | registred_widget_type () |
void | register_window (const std::string &id) |
Registers a window. More... | |
void | load_settings () |
Loads the setting for the theme. More... | |
void | register_widget (const std::string &id, std::function< void(tgui_definition &gui_definition,const std::string &definition_type,const config &cfg,const char *key)> functor) |
Registers a widgets. More... | |
void | load_widget_definitions (tgui_definition &gui_definition, const std::string &definition_type, const std::vector< tcontrol_definition_ptr > &definitions) |
Loads the definitions of a widget. More... | |
tresolution_definition_ptr | get_control (const std::string &control_type, const std::string &definition) |
std::vector < twindow_builder::tresolution > ::const_iterator | get_window_builder (const std::string &type) |
Returns an interator to the requested builder. More... | |
template<class T > | |
void | load_widget_definitions (tgui_definition &gui_definition, const std::string &definition_type, const config &cfg, const char *key) |
Loads the definitions of a widget. More... | |
static t_string | default_value_label_generator (const std::vector< t_string > &value_labels, int item_position, int max) |
std::vector< std::string > & | unit_test_registered_window_list () |
std::string | unit_test_mark_as_tested (const tdialog &dialog) |
std::string | unit_test_mark_popup_as_tested (const tpopup &dialog) |
twindow * | unit_test_window (const tpopup &dialog) |
tdialog * | unit_test_mp_server_list () |
Variables | |
lg::log_domain | log_gui_draw ("gui/draw") |
lg::log_domain | log_gui_event ("gui/event") |
lg::log_domain | log_gui_general ("gui/general") |
lg::log_domain | log_gui_iterator ("gui/iterator") |
lg::log_domain | log_gui_lifetime ("gui/lifetime") |
lg::log_domain | log_gui_layout ("gui/layout") |
lg::log_domain | log_gui_parse ("gui/parse") |
static size_t | id = 0 |
Ids for the timers. More... | |
static std::map< size_t, ttimer > | timers |
The active timers. More... | |
static size_t | executing_id = 0 |
The id of the event being executed, 0 if none. More... | |
static bool | executing_id_removed = false |
Did somebody try to remove the timer during its execution? More... | |
bool | show_debug_clock_button = false |
Do we wish to show the button for the debug clock. More... | |
static const size_t | cache_max_size = 100 |
Maximum number of items in the cache (multiple of 4). More... | |
static const ::config * | terrain = nullptr |
The terrain used to create the cache. More... | |
static tcache | cache |
bool | new_widgets = false |
Do we wish to use the new library or not. More... | |
static std::map< std::string, twindow_builder > | windows |
Map with all known windows, (the builder class builds a window). More... | |
static std::map< std::string, tgui_definition > | guis |
Map with all known guis. More... | |
static std::map< std::string, tgui_definition > ::const_iterator | current_gui = guis.end() |
Points to the current gui. More... | |
A class inherited from ttext_box that displays its input as stars.
typedef boost::intrusive_ptr<const tbuilder_widget> gui2::const_tbuilder_widget_ptr |
Definition at line 77 of file window_builder.hpp.
typedef std::function<void(twindow &)> gui2::dialog_member_func_type |
Definition at line 40 of file helper.hpp.
typedef tcontrol_NEW<tstate_default> gui2::tbase |
Definition at line 98 of file matrix.hpp.
typedef boost::intrusive_ptr< const tbuilder_grid > gui2::tbuilder_grid_const_ptr |
Definition at line 151 of file window_builder.hpp.
Definition at line 150 of file window_builder.hpp.
Definition at line 76 of file window_builder.hpp.
typedef std::map<tkey, tvalue> gui2::tcache |
The cache.
Definition at line 138 of file minimap.cpp.
Definition at line 109 of file widget_definition.hpp.
typedef tfield<int, tinteger_selector_> gui2::tfield_integer |
Definition at line 37 of file field-fwd.hpp.
typedef std::map<std::string, std::function<void(tgui_definition&, const std::string&, const config&, const char* key)> > gui2::tregistered_widget_type |
Definition at line 90 of file settings.cpp.
Definition at line 70 of file widget_definition.hpp.
Definition at line 67 of file widget_definition.hpp.
size_t gui2::add_timer | ( | const Uint32 | interval, |
const std::function< void(size_t id)> & | callback, | ||
const bool | repeat = false |
||
) |
Adds a new timer.
interval | The timer interval in ms. |
callback | The function to call when the timer expires, the id send as parameter is the id of the timer. |
repeat | If true the timer will restart after it expires. |
[0] | Failed to create a timer. |
Definition at line 112 of file timer.cpp.
References gui2::ttimer::callback, DBG_GUI_E, id, gui2::ttimer::interval, gui2::ttimer::sdl_id, timer_callback(), and WRN_GUI_E.
Referenced by gui2::tloadscreen::pre_show(), gui2::tlobby_main::pre_show(), gui2::trepeating_button::signal_handler_left_button_down(), and gui2::event::tmouse_motion::start_hover_timer().
|
static |
Definition at line 378 of file scrollbar_container.cpp.
References gui2::tscrollbar_container::always_invisible, gui2::tscrollbar_container::auto_visible, gui2::tscrollbar_::get_item_count(), gui2::tscrollbar_::get_item_position(), gui2::twidget::tvisible::hidden, gui2::twidget::tvisible::invisible, is_inserted_before(), gui2::tscrollbar_::set_item_count(), gui2::tscrollbar_::set_item_position(), set_scrollbar_mode(), gui2::twidget::set_visible(), gui2::tscrollbar_::set_visible_items(), and gui2::twidget::tvisible::visible.
Referenced by gui2::tscrollbar_container::content_resize_height(), and gui2::tscrollbar_container::content_resize_width().
Builds a window.
Definition at line 74 of file window_builder.cpp.
References gui2::twindow::add_to_keyboard_chain(), gui2::twindow_builder::tresolution::automatic_placement, gui2::twindow_builder::tresolution::click_dismiss, gui2::tcontrol::config(), gui2::twindow_builder::tresolution::definition, gui2::twindow::finalize(), gui2::twindow_builder::tresolution::functions, gui2::twindow_builder::tresolution::grid, gui2::twindow::has_linked_size_group(), gui2::twindow_builder::tresolution::height, gui2::twindow_builder::tresolution::helptip, gui2::twindow_builder::tresolution::horizontal_placement, gui2::tcontainer_::init_grid(), gui2::twindow::init_linked_size_group(), gui2::twindow_builder::tresolution::linked_groups, gui2::twindow_builder::tresolution::maximum_height, gui2::twindow_builder::tresolution::maximum_width, game_logic::msg(), gui2::twindow_builder::tresolution::reevaluate_best_size, gui2::twindow::set_click_dismiss(), gui2::twindow_builder::tresolution::tooltip, VALIDATE, gui2::twindow_builder::tresolution::vertical_placement, vgettext(), gui2::twindow_builder::tresolution::width, gui2::twindow_builder::tresolution::x, and gui2::twindow_builder::tresolution::y.
Referenced by build(), gui2::tchat_log::build_window(), gui2::tlua_interpreter::build_window(), gui2::tloadscreen::build_window(), gui2::tpopup::build_window(), gui2::tdialog::build_window(), config_callable::get_value(), and lua_gui2::show_dialog().
twindow * gui2::build | ( | CVideo & | video, |
const std::string & | type | ||
) |
Builds a window.
video | The frame buffer to draw upon. |
type | The type id string of the window, this window must be registered at startup. |
Definition at line 129 of file window_builder.cpp.
References build(), get_window_builder(), and gui2::twidget::set_id().
tbuilder_widget_ptr gui2::build_widget | ( | const config & | cfg | ) |
Helper to generate a widget from a WML widget instance.
Mainly used as functor for register_builder_widget.
cfg | The config with the information to Instantiate the widget. |
Definition at line 116 of file window_builder.hpp.
|
static |
Definition at line 54 of file window_builder.cpp.
Referenced by create_builder_widget(), and register_builder_widget().
|
static |
Definition at line 53 of file unit_recruit.cpp.
Referenced by gui2::tunit_recruit::pre_show().
const T& gui2::cast | ( | tresolution_definition_const_ptr | ptr | ) |
Casts a tresolution_definition_const_ptr to another type.
T | The type to cast to, the non const version. |
ptr | The pointer to cast. |
Definition at line 82 of file widget_definition.hpp.
|
static |
Definition at line 250 of file list.cpp.
References ADDON_INSTALLED, ADDON_INSTALLED_BROKEN, ADDON_INSTALLED_OUTDATED, ADDON_INSTALLED_UPGRADABLE, ADDON_NONE, ADDON_NOT_TRACKED, and addon_tracking_info::state.
Referenced by describe_status_simple(), and describe_status_verbose().
|
static |
Definition at line 141 of file minimap.cpp.
Referenced by shrink_cache().
|
inline |
A filter testing whether a search string is used in a text.
The comparison is a lower-case comparison.
The function is expected to be used as a functor for gui2::tpane::filter().
item | The pane item to search in. |
tag | The tag of the field containing the text to search in. |
text_box | A text box object whose text is the search string. The text in the text box will be converted to lower-cased text before the comparison is done. |
Definition at line 66 of file filter.hpp.
References utf8::lowercase(), gui2::tpane::titem::tags, and gui2::ttext_::text().
Referenced by mp::gamebrowser::game_matches_filter(), and arrow::path_contains().
tbuilder_widget_ptr gui2::create_builder_widget | ( | const config & | cfg | ) |
Create a widget builder.
This object holds the instance builder for a single widget.
cfg | The config object holding the information regarding the widget instance. |
Definition at line 155 of file window_builder.cpp.
References config::all_children_range(), builder_widget_lookup(), config::child(), ERROR_LOG, TRY, and VALIDATE.
Referenced by gui2::tbuilder_grid::tbuilder_grid().
SDL_Rect gui2::create_rect | ( | const tpoint & | origin, |
const tpoint & | size | ||
) |
Creates a rectangle.
origin | The top left corner. |
size | The width (x) and height (y). |
Definition at line 50 of file helper.cpp.
References sdl::create_rect(), gui2::tpoint::x, and gui2::tpoint::y.
Referenced by gui2::twidget::get_rectangle().
std::string gui2::debug_truncate | ( | const std::string & | text | ) |
Returns a truncated version of the text.
For debugging it's sometimes useful to get a part of the label of the widget. This function shows the first part.
text | The text to truncate. |
Definition at line 157 of file helper.cpp.
Referenced by gui2::tcontrol::calculate_best_size(), gui2::tcontrol::get_best_text_size(), gui2::tcontrol::impl_draw_background(), font::ttext::recalculate(), and gui2::tcontrol::request_reduce_width().
boost::uint32_t gui2::decode_color | ( | const std::string & | color | ) |
Converts a color string to a color.
color | A color string see http://www.wesnoth.org/wiki/GUIVariable for more info. |
Definition at line 73 of file helper.cpp.
References i, and utils::split().
unsigned gui2::decode_font_style | ( | const std::string & | style | ) |
Converts a font style string to a font style.
style | A font style string see http://www.wesnoth.org/wiki/GUIVariable for more info. |
Definition at line 55 of file helper.cpp.
References ERR_GUI_G.
PangoAlignment gui2::decode_text_alignment | ( | const std::string & | alignment | ) |
Converts a text alignment string to a text alignment.
alignment | An alignment string see http://www.wesnoth.org/wiki/GUIVariable for more info. |
Definition at line 92 of file helper.cpp.
References ERR_GUI_E.
Referenced by gui2::tformula< T >::convert(), gui2::tformula< T >::execute(), and gui2::tcontrol::set_members().
|
static |
Definition at line 290 of file slider.cpp.
Referenced by gui2::tslider::set_value_labels().
|
static |
Definition at line 283 of file list.cpp.
References _(), ADDON_INSTALLED, ADDON_INSTALLED_BROKEN, ADDON_INSTALLED_OUTDATED, ADDON_INSTALLED_UPGRADABLE, ADDON_NONE, ADDON_NOT_TRACKED, addon_tracking_info::can_publish, colorify_addon_state_string(), and addon_tracking_info::state.
Referenced by gui2::taddon_list::pre_show().
|
static |
Definition at line 319 of file list.cpp.
References _(), ADDON_INSTALLED, ADDON_INSTALLED_BROKEN, ADDON_INSTALLED_OUTDATED, ADDON_INSTALLED_UPGRADABLE, ADDON_NONE, ADDON_NOT_TRACKED, addon_tracking_info::can_publish, colorify_addon_state_string(), addon_tracking_info::installed_version, utils::interpolate_variables_into_string(), addon_tracking_info::state, and version_info::str().
Referenced by gui2::taddon_list::on_addon_select().
void gui2::dialog_callback | ( | twidget & | caller | ) |
Template for dialog callbacks.
Example usage: widget->set_callback(dialog_callback<my_dialog_class, &my_dialog_class::member_function>);
Definition at line 31 of file helper.hpp.
References gui2::twidget::dialog(), and gui2::twidget::get_window().
Referenced by gui2::tpreferences::initialize_tabs(), lua_gui2::intf_set_dialog_callback(), gui2::tcore_selection::pre_show(), gui2::tcampaign_selection::pre_show(), gui2::tpreferences::pre_show(), gui2::teditor_resize_map::pre_show(), and gui2::tlobby_main::pre_show().
void gui2::dialog_view_callback | ( | twidget & | caller | ) |
Template for dialog callbacks for dialogs using model-view-controller architecture pattern.
It allows delegating of the callback to a private view class, which should be accessible via dialog->get_view() (and return a pointer to the view class). Example usage: widget->set_callback(dialog_callback<my_dialog_class, my_dialog_class::inner_view_class &my_dialog_class::inner_view_class::member_function>);
Definition at line 122 of file gamestate_inspector.cpp.
References gui2::twidget::dialog().
Referenced by gui2::tmp_change_control::view::bind(), and gui2::tgamestate_inspector::view::bind().
|
static |
Definition at line 134 of file preferences_dialog.cpp.
References gui2::tselectable_::get_value_bool().
Referenced by gui2::tpreferences::bind_status_label(), get_max_autosaves_status_label(), and gui2::tpreferences::status_label_callback().
|
static |
Definition at line 139 of file preferences_dialog.cpp.
References gui2::tcombobox::get_value_string().
|
static |
Definition at line 144 of file preferences_dialog.cpp.
References gui2::tslider::get_value_label().
std::string gui2::encode_text_alignment | ( | const PangoAlignment | alignment | ) |
Converts a text alignment to its string representation.
alignment | An alignment. |
Definition at line 107 of file helper.cpp.
Referenced by gui2::tcontrol::update_canvas().
bool gui2::execute_timer | ( | const size_t | id | ) |
Executes a timer.
id | The id of the timer to execute, this is the id returned by add_timer. |
Definition at line 175 of file timer.cpp.
References DBG_GUI_E, itor, and LOG_GUI_E.
Referenced by gui2::event::thandler::handle_event().
T* gui2::find_widget | ( | typename utils::tconst_clone< twidget, T >::pointer | widget, |
const std::string & | id, | ||
const bool | must_be_active, | ||
const bool | must_exist | ||
) |
Gets a widget with the wanted id.
This template function doesn't return a pointer to a generic widget but returns the wanted type and tests for its existence if required.
widget | The widget test or find a child with the wanted id. |
id | The id of the widget to find. |
must_be_active | The widget should be active, not all widgets have an active flag, those who don't ignore flag. |
must_exist | The widget should be exist, the function will fail if the widget doesn't exist or is inactive and must be active. Upon failure a wml_error is thrown. |
Definition at line 69 of file find_widget.hpp.
References missing_widget(), and VALIDATE.
T& gui2::find_widget | ( | typename utils::tconst_clone< twidget, T >::pointer | widget, |
const std::string & | id, | ||
const bool | must_be_active | ||
) |
Gets a widget with the wanted id.
This template function doesn't return a reference to a generic widget but returns a reference to the wanted type
widget | The widget test or find a child with the wanted id. |
id | The id of the widget to find. |
must_be_active | The widget should be active, not all widgets have an active flag, those who don't ignore flag. |
Definition at line 96 of file find_widget.hpp.
References id.
|
static |
Definition at line 524 of file list.cpp.
References util::strftime(), utils::unicode_em_dash, and preferences::use_twelve_hour_clock_format().
Referenced by gui2::taddon_list::on_addon_select(), and gui2::taddon_description::taddon_description().
|
static |
Definition at line 97 of file unit_attack.cpp.
References _(), unit::alignment(), t_string::empty(), unit::experience(), unit::hitpoints(), unit::hp_color(), unit::level(), unit::max_experience(), unit::max_hitpoints(), unit::name(), font::span_color(), unit::trait_names(), unit::type_name(), and unit::xp_color().
Referenced by set_attacker_info(), and set_defender_info().
|
static |
Definition at line 143 of file title_screen.cpp.
References preferences::fullscreen(), and CVideo::set_fullscreen().
|
static |
Definition at line 400 of file lobby.cpp.
References preferences::fullscreen(), and CVideo::set_fullscreen().
Referenced by gui2::tpreferences::initialize_members(), gui2::ttitle_screen::post_build(), and gui2::tlobby_main::post_build().
R gui2::function_wrapper | ( | const R | result, |
const F & | function | ||
) |
Helper for function wrappers.
For boost bind the a function sometimes needs to return a value although the function called doesn't return one. This wrapper function can return a fixed result for a certain functor.
R | The return type. |
F | The type of the functor. |
result | The result value. |
function | The functor to call. |
Definition at line 172 of file helper.hpp.
Referenced by gui2::ttitle_screen::post_build(), and gui2::tlobby_main::post_build().
Definition at line 425 of file preferences_dialog.cpp.
References gui2::tgrid::find(), and gui2::tlistbox::get_row_grid().
Referenced by gui2::tpreferences::initialize_members(), and gui2::tpreferences::on_advanced_prefs_list_select().
tresolution_definition_ptr gui2::get_control | ( | const std::string & | control_type, |
const std::string & | definition | ||
) |
Definition at line 576 of file settings.cpp.
References ASSERT_LOG, ERROR_LOG, itor, LOG_GUI_G, gui2::settings::screen_height, and gui2::settings::screen_width.
Referenced by gui2::tcontrol::definition_load_configuration().
|
static |
Helper for preferences::ask_delete_saves.
Definition at line 45 of file mp_host_game_prompt.cpp.
References preferences::mp_server_warning_disabled().
Referenced by gui2::tmp_host_game_prompt::tmp_host_game_prompt().
|
static |
Helper to invert preferences::ask_delete_saves.
The value stored and the way shown is inverted.
Definition at line 46 of file game_delete.cpp.
References preferences::ask_delete_saves().
Referenced by gui2::tgame_delete::tgame_delete().
|
static |
Definition at line 134 of file unit_attack.cpp.
References unit::can_recruit(), team::get_side_color_index(), unit::leader_crown(), unit::overlays(), unit::side(), and unit::team_color().
Referenced by set_attacker_info(), and set_defender_info().
|
static |
Definition at line 150 of file preferences_dialog.cpp.
References _(), disambiguate_widget_value(), gui2::tslider::get_value(), and preferences::INFINITE_AUTO_SAVES.
Referenced by gui2::tpreferences::initialize_members(), and gui2::tpreferences::max_autosaves_slider_callback().
tpoint gui2::get_mouse_position | ( | ) |
Returns the current mouse position.
Definition at line 149 of file helper.cpp.
Referenced by gui2::event::thandler::handle_event(), gui2::event::init_mouse_location(), gui2::twindow::layout(), gui2::event::tmouse_motion::mouse_enter(), gui2::tlabel::signal_handler_left_button_click(), gui2::ttext_box::signal_handler_left_button_down(), gui2::tscrollbar_::signal_handler_left_button_down(), gui2::tscrollbar_::signal_handler_left_button_up(), gui2::tscrollbar_::signal_handler_mouse_enter(), and gui2::tlabel::signal_handler_right_button_click().
T& gui2::get_parent | ( | twidget & | widget | ) |
Returns the first parent of a widget with a certain type.
widget | The widget to get the parent from, |
T | The class of the widget to return. |
Definition at line 35 of file find_widget.hpp.
References gui2::twidget::parent().
void gui2::get_screen_size_variables | ( | game_logic::map_formula_callable & | variable | ) |
Gets a formula object with the screen size.
variable | A formula object in which the screen_width, screen_height, gamemap_width and gamemap_height variable will set to the current values of these in settings. It modifies the object send. |
Definition at line 132 of file helper.cpp.
References game_logic::map_formula_callable::add(), gui2::settings::gamemap_height, gui2::settings::gamemap_width, gui2::settings::gamemap_x_offset, gui2::settings::screen_height, and gui2::settings::screen_width.
Referenced by gui2::implementation::tbuilder_spacer::build(), gui2::implementation::tbuilder_drawing::build(), gui2::tcanvas::draw(), get_screen_size_variables(), and gui2::twindow::layout().
game_logic::map_formula_callable gui2::get_screen_size_variables | ( | ) |
Gets a formula object with the screen size.
Definition at line 141 of file helper.cpp.
References get_screen_size_variables().
std::vector< twindow_builder::tresolution >::const_iterator gui2::get_window_builder | ( | const std::string & | type | ) |
Returns an interator to the requested builder.
The builder is determined by the type
and the current screen resolution.
type
at the current resolution.twindow_builder_invalid_id | When the precondition is violated. |
type | The type of builder window to get. |
Definition at line 624 of file settings.cpp.
References ERROR_LOG, itor, and gui2::twindow::update_screen_size().
Referenced by build().
|
static |
Definition at line 127 of file title_screen.cpp.
Definition at line 1106 of file preferences_dialog.cpp.
References gui2::tstacked_widget::get_layer_count().
Referenced by gui2::tpreferences::pre_show().
bool gui2::init | ( | ) |
Initializes the gui subsystems.
This function needs to be called before other parts of the gui engine are used.
Definition at line 37 of file helper.cpp.
References initialized_, and load_settings().
Referenced by config::clear(), do_gameloop(), test_utils::game_config_manager::game_config_manager(), handle_luainit(), gui2::tgenerator< minimum_selection, maximum_selection, placement, select_action >::init(), ll_loadlib(), lmemfind(), luaV_execute(), match(), ai::manager::set_ai_info(), gui2::tcontrol::set_definition(), str_find_aux(), and wesnoth_global_fixture::wesnoth_global_fixture().
bool gui2::is_in_dialog | ( | ) |
Is a dialog open?
Definition at line 960 of file handler.cpp.
References gui2::event::thandler::dispatchers_, and gui2::event::handler.
Referenced by gui::dialog_manager::dialog_manager(), gui::in_dialog(), and gui::dialog_manager::~dialog_manager().
|
static |
Definition at line 365 of file scrollbar_container.cpp.
Referenced by adjust_scrollbar_mode().
|
static |
Definition at line 151 of file title_screen.cpp.
References gui2::tlua_interpreter::APP, gui2::tlua_interpreter::display(), and gui2::twindow::video().
Referenced by gui2::ttitle_screen::post_build().
void gui2::load_settings | ( | ) |
Loads the setting for the theme.
Definition at line 484 of file settings.cpp.
References _(), config::child_range(), e, ERR_GUI_P, filesystem::get_wml_location(), game_config::config_cache::instance(), LOG_GUI_G, game::error::message, preprocess_file(), read(), gui2::twindow::update_screen_size(), VALIDATE, and game::error::what().
Referenced by init().
void gui2::load_widget_definitions | ( | tgui_definition & | gui_definition, |
const std::string & | definition_type, | ||
const config & | cfg, | ||
const char * | key | ||
) |
Loads the definitions of a widget.
This function is templated and kept small so only loads the definitions from the config and then lets the real job be done by the load_widget_definitions above.
gui_definition | The gui definition the widget definition belongs to. |
definition_type | The type of the widget whose definitions are to be loaded. |
cfg | The config to serialise the definitions from. |
key | Optional id of the definition to load. |
Definition at line 120 of file settings.hpp.
References config::child_range(), and load_widget_definitions().
void gui2::load_widget_definitions | ( | tgui_definition & | gui_definition, |
const std::string & | definition_type, | ||
const std::vector< tcontrol_definition_ptr > & | definitions | ||
) |
Loads the definitions of a widget.
gui_definition | The gui definition the widget definition belongs to. |
definition_type | The type of the widget whose definitions are to be loaded. |
definitions | The definitions serialized from a config object. |
Definition at line 568 of file settings.cpp.
References DBG_GUI_P, and gui2::tgui_definition::load_widget_definitions().
Referenced by load_widget_definitions().
Definition at line 50 of file helper.hpp.
References make_dialog_callback_helper().
Referenced by gui2::tpreferences::initialize_members().
|
inline |
Definition at line 42 of file helper.hpp.
References gui2::twidget::get_window().
Referenced by make_dialog_callback().
t_string gui2::missing_widget | ( | const std::string & | id | ) |
Returns a default error message if a mandatory widget is omitted.
id | The id of the omitted widget. |
Definition at line 123 of file helper.cpp.
References id, and vgettext().
Referenced by find_widget(), and gui2::tcampaign_selection::pre_show().
|
static |
Definition at line 83 of file minimap.cpp.
References gui2::tkey::h, gui2::tkey::map_data, and gui2::tkey::w.
std::ostream & gui2::operator<< | ( | std::ostream & | stream, |
const tpoint & | point | ||
) |
Definition at line 38 of file point.cpp.
References gui2::tpoint::x, and gui2::tpoint::y.
void gui2::register_builder_widget | ( | const std::string & | id, |
std::function< tbuilder_widget_ptr(config)> | functor | ||
) |
Registers a widget to be build.
id | The id of the widget as used in WML. |
functor | The functor to create the widget. |
Definition at line 149 of file window_builder.cpp.
References builder_widget_lookup(), and functor().
gui2::REGISTER_DIALOG | ( | select_orb_colors | ) |
gui2::REGISTER_DIALOG | ( | label_settings | ) |
void gui2::register_widget | ( | const std::string & | id, |
std::function< void(tgui_definition &gui_definition, const std::string &definition_type, const config &cfg, const char *key)> | functor | ||
) |
Registers a widgets.
This function registers the available widgets defined in WML. All widgets need to register themselves before gui2::init) is called.
id | The id of the widget to register. |
functor | The function to load the definitions. |
Definition at line 558 of file settings.cpp.
References functor(), and registred_widget_type().
void gui2::register_window | ( | const std::string & | id | ) |
Registers a window.
This function registers the available windows defined in WML. All windows need to register themselves before gui2::init) is called.
id | The id of the window to register. |
Definition at line 467 of file settings.cpp.
References gui2::event::find(), itor, and registered_window_types().
|
static |
Returns the list of registered windows.
The function can be used the look for registered windows or to add them.
Definition at line 79 of file settings.cpp.
Referenced by gui2::tunit_test_access_only::get_registered_window_list(), gui2::tgui_definition::read(), and register_window().
|
static |
Definition at line 92 of file settings.cpp.
Referenced by gui2::tgui_definition::read(), and register_widget().
bool gui2::remove_timer | ( | const size_t | id | ) |
Removes a timer.
It's save to remove a timer in its own callback, only the value returned might not be accurate. The destruction is postponed until the execution is finished and the return value is whether the postponing was successful.
id | The id of the timer to remove, this is the id returned by add_timer. |
Definition at line 144 of file timer.cpp.
References DBG_GUI_E, itor, and LOG_GUI_E.
Referenced by gui2::tloadscreen::post_show(), gui2::tlobby_main::post_show(), gui2::trepeating_button::set_state(), gui2::trepeating_button::signal_handler_left_button_up(), gui2::event::tmouse_motion::stop_hover_timer(), gui2::texecutor::~texecutor(), gui2::tlobby_main::~tlobby_main(), and gui2::trepeating_button::~trepeating_button().
Convert a coordinate on a 3 by 3 grid to an index, return 9 for out of bounds.
Definition at line 141 of file resize_map.cpp.
Referenced by gui2::teditor_resize_map::update_expand_direction().
|
static |
Definition at line 111 of file mp_alerts_options.cpp.
References mp_ui_alerts::get_def_pref_lobby(), mp_ui_alerts::get_def_pref_notif(), mp_ui_alerts::get_def_pref_sound(), i, mp_ui_alerts::items, and set_pref_and_button().
Referenced by gui2::tmp_alerts_options::pre_show().
Definition at line 150 of file unit_attack.cpp.
References unit::absolute_image(), format_stats(), get_image_mods(), and gui2::tcontrol::set_use_markup().
Referenced by gui2::tunit_attack::pre_show().
Definition at line 161 of file unit_attack.cpp.
References unit::absolute_image(), format_stats(), get_image_mods(), and gui2::tcontrol::set_use_markup().
Referenced by gui2::tunit_attack::pre_show().
|
static |
Helper for preferences::set_ask_delete_saves.
Definition at line 53 of file mp_host_game_prompt.cpp.
References preferences::set_mp_server_warning_disabled().
Referenced by gui2::tmp_host_game_prompt::tmp_host_game_prompt().
|
static |
Helper to invert preferences::set_ask_delete_saves.
The value stored and the way shown is inverted.
Definition at line 56 of file game_delete.cpp.
References preferences::set_ask_delete_saves().
Referenced by gui2::tgame_delete::tgame_delete().
|
static |
Definition at line 89 of file unit_attack.cpp.
References id.
Referenced by gui2::tpreferences::add_hotkey_callback(), gui2::tgame_load::display_savegame(), gui2::tpreferences::initialize_members(), gui2::taddon_list::on_addon_select(), gui2::tformula_debugger::pre_show(), gui2::tlobby_player_info::pre_show(), gui2::ttip::pre_show(), gui2::tpreferences::remove_hotkey_callback(), gui2::timage::set_image(), and gui2::tlobby_main::update_gamelist_header().
|
static |
Definition at line 104 of file mp_alerts_options.cpp.
References id, preferences::set(), and gui2::ttoggle_button::set_value().
Referenced by revert_to_default_pref_values().
Definition at line 167 of file preferences_dialog.cpp.
References CVideo::current_resolution(), gui2::event::find(), CVideo::get_available_resolutions(), preferences::options(), gui2::tcombobox::set_values(), and utils::unicode_multiplication_sign.
Referenced by gui2::tpreferences::fullscreen_toggle_callback(), gui2::tpreferences::handle_res_select(), and gui2::tpreferences::initialize_members().
|
static |
Definition at line 339 of file scrollbar_container.cpp.
References gui2::tscrollbar_container::always_invisible, gui2::tscrollbar_container::auto_visible, gui2::twidget::tvisible::hidden, gui2::twidget::tvisible::invisible, gui2::tscrollbar_::set_item_count(), gui2::tscrollbar_::set_item_position(), gui2::twidget::set_visible(), gui2::tscrollbar_::set_visible_items(), and gui2::twidget::tvisible::visible.
Referenced by adjust_scrollbar_mode(), and gui2::tscrollbar_container::place().
void gui2::set_single_child | ( | tgrid & | grid, |
twidget * | widget | ||
) |
Sets the single child in a grid.
The function initializes the grid to 1 x 1 and adds the widget with the grow to client flags.
grid | The grid to add the child to. |
widget | The widget to add as child to the grid. |
Definition at line 1021 of file grid.cpp.
References gui2::tgrid::HORIZONTAL_GROW_SEND_TO_CLIENT, gui2::tgrid::set_child(), gui2::tgrid::set_rows_cols(), and gui2::tgrid::VERTICAL_GROW_SEND_TO_CLIENT.
|
static |
Definition at line 173 of file unit_attack.cpp.
References gui2::tlistbox::add_row(), battle_context_unit_stats::chance_to_hit, battle_context_unit_stats::damage, t_string::empty(), gui2::tlistbox::get_item_count(), attack_type::icon(), int_to_color(), attack_type::name(), attack_type::num_attacks(), attack_type::range(), game_config::red_to_green(), gui2::tlistbox::select_row(), font::span_color(), string_table, utils::unicode_em_dash, font::weapon, battle_context_unit_stats::weapon, font::weapon_numbers_sep, and attack_type::weapon_specials().
Referenced by gui2::tunit_attack::pre_show().
|
static |
Definition at line 83 of file mp_alerts_options.cpp.
References desktop::notifications::available(), mp_ui_alerts::get_def_pref_lobby(), mp_ui_alerts::get_def_pref_notif(), mp_ui_alerts::get_def_pref_sound(), preferences::set(), gui2::ttoggle_button::set_active(), gui2::ttoggle_button::set_value(), and setup_pref_toggle_button().
Referenced by gui2::tmp_alerts_options::pre_show().
|
static |
Definition at line 65 of file mp_alerts_options.cpp.
References gui2::event::connect_signal_mouse_left_click(), preferences::get(), gui2::tselectable_::get_value_bool(), id, cursor::set(), preferences::set(), and gui2::ttoggle_button::set_value().
Referenced by setup_item().
void gui2::show_error_message | ( | CVideo & | video, |
const std::string & | message, | ||
bool | message_use_markup = false |
||
) |
Shows an error message to the user.
video | The video which contains the surface to draw upon. |
message | The message to show in the dialog. |
message_use_markup | Use markup for the message? |
Definition at line 198 of file message.cpp.
References _(), lg::err(), lg::general(), LOG_STREAM, gui2::tmessage::ok_button, and show_message().
Referenced by ad_hoc_addon_fetch_session(), editor::context_manager::apply_mask_dialog(), savegame::savegame::check_filename(), savegame::loadgame::check_version_compatibility(), gui2::tgame_cache_options::clean_cache_callback(), editor::context_manager::create_mask_to_dialog(), editor::editor_controller::custom_tods_dialog(), do_gameloop(), enter_configure_mode(), sp::enter_create_mode(), enter_lobby_mode(), editor::context_manager::generate_map_dialog(), game_launcher::init_lua_script(), addons_client::install_addon(), playsingle_controller::hotkey_handler::load_autosave(), savegame::loadgame::load_game(), game_launcher::load_game(), savegame::loadgame::load_multiplayer_game(), campaign_controller::play_game(), game_launcher::play_multiplayer(), mp::lobby::process_event_impl(), gui2::tgame_cache_options::purge_cache_callback(), savegame::savegame::save_game(), and twml_exception::show().
void gui2::show_message | ( | CVideo & | video, |
const std::string & | title, | ||
const std::string & | message, | ||
const std::string & | button_caption = "" , |
||
const bool | auto_close = true , |
||
const bool | message_use_markup = false |
||
) |
Shows a message to the user.
Normally the dialog won't have a button only when the text doesn't fit in the dialog and a scrollbar is used the button will be shown.
video | The video which contains the surface to draw upon. |
title | The title of the dialog. |
message | The message to show in the dialog. |
button_caption | The caption of the close button. |
auto_close | When true the window will hide the ok button when the message doesn't need a scrollbar to show itself. |
Definition at line 143 of file message.cpp.
References gui2::tmessage::ok, gui2::tmessage::set_button_caption(), and gui2::tdialog::show().
Referenced by gui2::tpreferences::add_hotkey_callback(), savegame::savegame::check_overwrite(), savegame::loadgame::check_version_compatibility(), gui2::tgame_cache_options::clean_cache_callback(), editor::context_manager::confirm_discard(), events::menu_handler::do_search(), events::console_handler::do_undiscover(), events::console_handler::do_unsafe_lua(), events::menu_handler::end_turn(), mp::handle_addon_requirements_gui(), open_connection(), campaign_controller::play_game(), mp::create::process_event_impl(), gui2::tgame_cache_options::purge_cache_callback(), events::menu_handler::save_map(), editor::context_manager::save_map_as_dialog(), editor::context_manager::save_scenario_as_dialog(), show_error_message(), quit_confirmation::show_prompt(), gui2::tlabel::signal_handler_left_button_click(), and gui2::tlabel::signal_handler_right_button_click().
int gui2::show_message | ( | CVideo & | video, |
const std::string & | title, | ||
const std::string & | message, | ||
const tmessage::tbutton_style | button_style, | ||
bool | message_use_markup = false , |
||
bool | title_use_markup = false |
||
) |
Shows a message to the user.
video | The video which contains the surface to draw upon. |
title | The title of the dialog. |
message | The message to show in the dialog. |
button_style | The style of the button(s) shown. |
message_use_markup | Use markup for the message? |
title_use_markup | Use markup for the title? |
Definition at line 155 of file message.cpp.
References _(), gui2::tmessage::auto_close, gui2::tmessage::cancel, gui2::tmessage::cancel_button, gui2::tmessage::close_button, gui2::tdialog::get_retval(), gui2::tmessage::ok, gui2::tmessage::ok_button, gui2::tmessage::ok_cancel_buttons, gui2::tmessage::set_button_caption(), gui2::tmessage::set_button_visible(), gui2::tdialog::show(), gui2::twidget::tvisible::visible, and gui2::tmessage::yes_no_buttons.
|
static |
Definition at line 153 of file mp_connect.cpp.
References gui2::twindow::OK.
Referenced by gui2::tmp_connect::pre_show().
void gui2::show_transient_error_message | ( | CVideo & | video, |
const std::string & | message, | ||
const std::string & | image = std::string() , |
||
const bool | message_use_markup = false |
||
) |
Shows a transient error message to the user.
This shows a dialog with a short message which can be dismissed with a single click.
video | The video which contains the surface to draw upon. |
message | The message to show in the dialog. |
image | An image to show in the dialog. |
message_use_markup | Use markup for the message? |
Definition at line 71 of file transient_message.cpp.
References _(), lg::err(), lg::general(), LOG_STREAM, and show_transient_message().
Referenced by dialogs::file_dialog::action(), savegame::loadgame::load_multiplayer_game(), and gui2::tpreferences::remove_friend_list_entry().
void gui2::show_transient_message | ( | CVideo & | video, |
const std::string & | title, | ||
const std::string & | message, | ||
const std::string & | image = std::string() , |
||
const bool | message_use_markup = false , |
||
const bool | title_use_markup = false , |
||
const bool | restore_background = false |
||
) |
Shows a transient message to the user.
This shows a dialog with a short message which can be dismissed with a single click.
video | The video which contains the surface to draw upon. |
title | The title of the dialog. |
message | The message to show in the dialog. |
image | An image to show in the dialog. |
message_use_markup | Use markup for the message? |
title_use_markup | Use markup for the title? |
restore_background | Restore the background to the state it was before the message appeared |
Definition at line 56 of file transient_message.cpp.
References gui2::tdialog::set_restore(), and gui2::tdialog::show().
Referenced by gui2::tpreferences::add_friend_list_entry(), editor::context_manager::apply_mask_dialog(), editor::context_manager::check_switch_open_map(), mp::create::create(), editor::context_manager::create_mask_to_dialog(), gui2::tpreferences::default_hotkey_callback(), events::menu_handler::do_recruit(), events::console_handler::do_show_var(), events::menu_handler::end_turn(), editor::context_manager::generate_map_dialog(), help::help_browser::handle_event(), editor::context_manager::load_map(), savegame::loadgame::load_multiplayer_game(), editor::editor_controller::main_loop(), events::mouse_handler::move_unit_along_route(), game_launcher::play_multiplayer(), playsingle_controller::play_scenario(), playsingle_controller::play_scenario_init(), mp::create::process_event_impl(), mp::configure::process_event_impl(), mp::wait::process_network_data(), events::menu_handler::recall(), events::menu_handler::recruit(), actions::undo::recruit_action::redo(), actions::undo::recall_action::redo(), savegame::savegame::save_game(), events::menu_handler::save_map(), editor::context_manager::save_map_as(), editor::context_manager::save_scenario_as(), events::mouse_handler::show_attack_dialog(), campaign_controller::show_carryover_message(), savegame::loadgame::show_dialog(), help::show_help(), dialogs::show_objectives(), lua_gui2::show_popup_dialog(), preferences::show_theme_dialog(), show_transient_error_message(), playsingle_controller::show_turn_dialog(), editor::context_manager::write_map(), and editor::context_manager::write_scenario().
int gui2::show_wml_message | ( | const bool | left_side, |
CVideo & | video, | ||
const std::string & | title, | ||
const std::string & | message, | ||
const std::string & | portrait, | ||
const bool | mirror, | ||
const bool | has_input, | ||
const std::string & | input_caption, | ||
std::string * | input_text, | ||
const unsigned | maximum_length, | ||
const std::vector< twml_message_option > & | option_list, | ||
int * | chosen_option | ||
) |
Helper function to show a portrait.
left_side | If true the portrait is shown on the left, on the right side otherwise. |
video | The display variable. |
title | The title of the dialog. |
message | The message to show. |
portrait | Filename of the portrait. |
mirror | Does the portrait need to be mirrored? |
has_input | Do we need to show the input box. |
input_caption | The caption for the optional input text box. If this value != "" there is an input and the input text parameter is mandatory. |
input_text | Pointer to the initial text value will be set to the result. |
maximum_length | The maximum length of the text. |
option_list | A list of options to select in the dialog. |
chosen_option | Pointer to the initially chosen option. Will be set to the chosen option when the dialog closes. |
Definition at line 152 of file wml_message.cpp.
Referenced by lua_gui2::show_message_dialog().
|
static |
Definition at line 147 of file minimap.cpp.
References cache, cache_max_size, compare(), DBG_GUI_D, mp_ui_alerts::items, and itor.
Referenced by gui2::tminimap::get_image().
|
inline |
Definition at line 33 of file filter.hpp.
References lexical_cast(), and gui2::tpane::titem::tags.
|
static |
Definition at line 84 of file timer.cpp.
References DBG_GUI_E, id, itor, and TIMER_EVENT.
Referenced by add_timer().
std::string gui2::unit_test_mark_as_tested | ( | const tdialog & | dialog | ) |
This is used in the unit tests, but these implementation details shouldn't be used in the normal code.
Definition at line 107 of file test_gui2.cpp.
References schema_validation::remove, unit_test_registered_window_list(), and gui2::tdialog::window_id().
std::string gui2::unit_test_mark_popup_as_tested | ( | const tpopup & | dialog | ) |
This is used in the unit tests, but these implementation details shouldn't be used in the normal code.
Definition at line 116 of file test_gui2.cpp.
References schema_validation::remove, unit_test_registered_window_list(), and gui2::tpopup::window_id().
tdialog* gui2::unit_test_mp_server_list | ( | ) |
Definition at line 132 of file test_gui2.cpp.
References gui2::tmp_connect::mp_server_list_for_unit_test().
std::vector<std::string>& gui2::unit_test_registered_window_list | ( | ) |
Definition at line 99 of file test_gui2.cpp.
References gui2::tunit_test_access_only::get_registered_window_list().
Referenced by BOOST_AUTO_TEST_CASE(), unit_test_mark_as_tested(), and unit_test_mark_popup_as_tested().
twindow* gui2::unit_test_window | ( | const tpopup & | dialog | ) |
This is used in the unit tests, but these implementation details shouldn't be used in the normal code.
Definition at line 125 of file test_gui2.cpp.
References gui2::tpopup::window_.
|
static |
Definition at line 139 of file minimap.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), clear_cache(), ai::default_recruitment::recruitment::compare_unit_types(), image::exists(), ai::default_recruitment::recruitment::get_cached_combat_value(), get_cursor(), gui2::tminimap::get_image(), image::getMinimap(), game_config::config_cache::instance(), font::line_size(), and shrink_cache().
|
static |
Maximum number of items in the cache (multiple of 4).
No testing on the optimal number is done, just seems a nice number.
Definition at line 125 of file minimap.cpp.
Referenced by gui2::tminimap::get_image(), and shrink_cache().
|
static |
Points to the current gui.
Definition at line 465 of file settings.cpp.
|
static |
The id of the event being executed, 0 if none.
Definition at line 45 of file timer.cpp.
Referenced by gui2::texecutor::~texecutor().
|
static |
|
static |
Map with all known guis.
Definition at line 462 of file settings.cpp.
|
static |
Ids for the timers.
Definition at line 39 of file timer.cpp.
Referenced by gui2::tgamestate_inspector::model::add_row_to_stuff_list(), gui2::tgamestate_inspector::model::add_row_to_stuff_types_list(), add_timer(), find_widget(), gui2::tsub_player_list::init(), gui2::tmessage_implementation::init_button(), missing_widget(), gui2::taddon_uninstall_list::pre_show(), gui2::tcampaign_selection::pre_show(), gui2::event::tdispatcher::register_hotkey(), gui2::taddon_list::register_sort_button(), gui2::tdialog::register_text(), gui2::tfield< T, W, CT >::save(), set_label(), set_pref_and_button(), setup_pref_toggle_button(), gui2::tlobby_main::switch_to_window(), gui2::texecutor::texecutor(), and timer_callback().
lg::log_domain gui2::log_gui_draw |
Definition at line 28 of file log.hpp.
Referenced by gui2::tcanvas::draw(), gui2::twindow::show(), gui2::twindow::show_non_modal(), and gui2::twindow::show_tooltip().
lg::log_domain gui2::log_gui_event |
lg::log_domain gui2::log_gui_general |
Definition at line 40 of file log.hpp.
Referenced by gui2::tbuilder_grid::build(), and gui2::tcontainer_::init_grid().
lg::log_domain gui2::log_gui_iterator |
lg::log_domain gui2::log_gui_layout |
Definition at line 57 of file log.hpp.
Referenced by gui2::tslider::calculate_best_size(), gui2::tcontainer_::calculate_best_size(), gui2::tscrollbar_container::calculate_best_size(), gui2::tgrid::calculate_best_size(), gui2::ttree_view_node::calculate_best_size(), gui2::tgrid::tchild::get_best_size(), gui2::tcontrol::get_best_text_size(), gui2::twindow_implementation::layout(), gui2::twindow::layout(), gui2::tgrid::place(), gui2::ttree_view_node::place(), gui2::tgrid::reduce_height(), gui2::tgrid::reduce_width(), and gui2::ttree_view_node::set_visible_rectangle().
lg::log_domain gui2::log_gui_lifetime |
lg::log_domain gui2::log_gui_parse |
Definition at line 68 of file log.hpp.
Referenced by gui2::tcanvas::parse_cfg(), and gui2::tbuilder_grid::tbuilder_grid().
bool gui2::new_widgets = false |
Do we wish to use the new library or not.
Definition at line 40 of file settings.cpp.
Referenced by gui2::implementation::tbuilder_listbox::build(), gui2::tcampaign_selection::campaign_selected(), gui2::twindow::draw(), enter_create_mode(), game_launcher::game_launcher(), gui2::tcampaign_selection::post_show(), gui2::tcampaign_selection::pre_show(), and gui2::twidget::set_visible().
bool gui2::show_debug_clock_button = false |
Do we wish to show the button for the debug clock.
Definition at line 125 of file title_screen.cpp.
Referenced by game_launcher::game_launcher(), gui2::ttitle_screen::pre_show(), and gui2::ttitle_screen::show_debug_clock_window().
|
static |
The terrain used to create the cache.
If another terrain config is used the cache needs to be cleared, this normally doesn't happen a lot so the clearing of the cache is rather unusual.
Definition at line 135 of file minimap.cpp.
Referenced by movetype::terrain_info::data::calc_value(), game_board::change_terrain(), ai::ai_default_rca::move_cost_calculator::cost(), pathfind::shortest_path_calculator::cost(), pathfind::move_type_path_calculator::cost(), create_terrain_maps(), default_map_generator_job::default_generate_map(), editor::terrain_palette::draw_item(), editor::editor_map::expand_bottom(), editor::editor_map::expand_top(), ai::default_recruitment::recruitment::get_average_defense(), editor::editor_map::get_contiguous_terrain_tiles(), gui2::tminimap::get_image(), terrain_type_data::get_underlying_terrain_string(), image::getMinimap(), unit_animation_component::invalidate(), preferences::manager::manager(), help::unit_topic_generator::operator()(), operator<<(), gamemap::overlay(), terrain_builder::parse_mapstring(), placing_score(), ai::readonly_context_impl::power_projection(), ai::ai_default_rca::aspect_attacks_base::rate_terrain(), ai::default_ai_context_impl::rate_terrain(), t_translation::read_builder_map(), t_translation::read_game_map(), t_translation::read_list(), unit_drawer::redraw_unit(), REPORT_GENERATOR(), editor::terrain_palette::select_bg_item(), editor::terrain_palette::select_fg_item(), gui2::tminimap::set_config(), unit_type_data::set_config(), terrain_type_data::underlying_def_terrain(), terrain_type_data::underlying_mvt_terrain(), terrain_type_data::underlying_union_terrain(), unit_box_at(), unit_defense(), unit_moves(), and preferences::manager::~manager().
|
static |
|
static |
Map with all known windows, (the builder class builds a window).
Definition at line 459 of file settings.cpp.