base class of top level items, the only item which needs to store the final canvases to draw on. More...
#include <window.hpp>
Classes | |
class | invalidate_layout_blocker |
Helper class to block invalidate_layout. More... | |
struct | linked_size |
Helper struct to force widgets the have the same size. More... | |
Public Types | |
enum class | status { NEW , SHOWING , REQUEST_CLOSE , CLOSED } |
The status of the window. More... | |
enum class | exit_hook { on_all , on_ok } |
enum class | show_mode { none , modal , modeless , tooltip } |
Public Types inherited from gui2::widget | |
enum class | visibility { visible , hidden , invisible } |
Visibility settings done by the user. More... | |
enum class | redraw_action { full , partly , none } |
Visibility set by the engine. More... | |
enum class | debug_border { none , outline , fill } |
Public Types inherited from gui2::event::dispatcher | |
enum | event_queue_type { pre = 1 , child = 2 , post = 4 } |
enum | queue_position { front_pre_child , back_pre_child , front_child , back_child , front_post_child , back_post_child } |
The position where to add a new callback in the signal handler. More... | |
enum class | mouse_behavior { all , hit , none } |
The behavior of the mouse events. More... | |
Public Member Functions | |
window (const builder_window::window_resolution &definition) | |
< Needs to be initialized in show. More... | |
virtual | ~window () |
int | show (unsigned auto_close_timeout=0) |
Shows the window, running an event loop until it should close. More... | |
void | show_tooltip () |
Shows the window as a tooltip. More... | |
void | show_non_modal () |
Shows the window non modal. More... | |
void | draw () |
Draws the window. More... | |
void | hide () |
Hides the window. More... | |
virtual void | layout () override |
Lays out the window. More... | |
virtual void | render () override |
Ensure the window's internal render buffer is up-to-date. More... | |
virtual bool | expose (const rect ®ion) override |
Called by draw_manager when it believes a redraw is necessary. More... | |
virtual rect | screen_location () override |
The current draw location of the window, on the screen. More... | |
void | queue_rerender (const rect ®ion) |
Queue a rerender of the internal render buffer. More... | |
void | queue_rerender () |
void | defer_region (const rect ®ion) |
Defer rendering of a particular region to next frame. More... | |
void | close () |
Requests to close the window. More... | |
bool | invalidate_layout_blocked () const |
Is invalidate_layout blocked, see invalidate_layout_blocker. More... | |
void | invalidate_layout () |
Updates the size of the window. More... | |
virtual widget * | find_at (const point &coordinate, const bool must_be_active) override |
See widget::find_at. More... | |
virtual const widget * | find_at (const point &coordinate, const bool must_be_active) const override |
See widget::find_at. More... | |
dialogs::modal_dialog * | dialog () |
Inherited from widget. More... | |
widget * | find (const std::string &id, const bool must_be_active) override |
See widget::find. More... | |
const widget * | find (const std::string &id, const bool must_be_active) const override |
See widget::find. More... | |
bool | does_click_dismiss () const |
Does the window close easily? More... | |
void | set_enter_disabled (const bool enter_disabled) |
Disable the enter key. More... | |
void | set_escape_disabled (const bool escape_disabled) |
Disable the escape key. More... | |
void | init_linked_size_group (const std::string &id, const bool fixed_width, const bool fixed_height) |
Initializes a linked size group. More... | |
bool | has_linked_size_group (const std::string &id) |
Is the linked size group defined for this window? More... | |
void | add_linked_widget (const std::string &id, widget *widget) |
Adds a widget to a linked size group. More... | |
void | remove_linked_widget (const std::string &id, const widget *widget) |
Removes a widget from a linked size group. More... | |
void | set_retval (const int retval, const bool close_window=true) |
Sets there return value of the window. More... | |
int | get_retval () |
void | set_owner (dialogs::modal_dialog *owner) |
void | set_click_dismiss (const bool click_dismiss) |
bool | get_need_layout () const |
void | set_variable (const std::string &key, const wfl::variant &value) |
point | get_linked_size (const std::string &linked_group_id) const |
void | set_exit_hook (exit_hook mode, std::function< bool(window &)> func) |
Sets the window's exit hook. More... | |
const event::distributor & | get_distributor () const |
Gets a reference to the window's distributor to allow some state peeking. More... | |
show_mode | mode () const |
Returns the dialog mode for this window. More... | |
void | mouse_capture (const bool capture=true) |
void | keyboard_capture (widget *widget) |
void | add_to_keyboard_chain (widget *widget) |
Adds the widget to the keyboard chain. More... | |
void | remove_from_keyboard_chain (widget *widget) |
Remove the widget from the keyboard chain. More... | |
void | add_to_tab_order (widget *widget, int at=-1) |
Add the widget to the tabbing order. More... | |
Public Member Functions inherited from gui2::panel | |
panel (const implementation::builder_styled_widget &builder, const std::string &control_type="") | |
Constructor. More... | |
virtual SDL_Rect | get_client_rect () const override |
See container_base::get_client_rect. More... | |
virtual bool | get_active () const override |
See styled_widget::get_active. More... | |
virtual unsigned | get_state () const override |
See styled_widget::get_state. More... | |
Public Member Functions inherited from gui2::container_base | |
container_base (const implementation::builder_styled_widget &builder, const std::string &control_type) | |
virtual void | layout_initialize (const bool full_initialization) override |
See widget::layout_initialize. More... | |
void | reduce_width (const unsigned maximum_width) |
Tries to reduce the width of a container. More... | |
virtual void | request_reduce_width (const unsigned maximum_width) override |
See widget::request_reduce_width. More... | |
virtual void | demand_reduce_width (const unsigned maximum_width) override |
See widget::demand_reduce_width. More... | |
void | reduce_height (const unsigned maximum_height) |
Tries to reduce the height of a container. More... | |
virtual void | request_reduce_height (const unsigned maximum_height) override |
See widget::request_reduce_height. More... | |
virtual void | demand_reduce_height (const unsigned maximum_height) override |
See widget::demand_reduce_height. More... | |
virtual bool | can_wrap () const override |
See widget::can_wrap. More... | |
virtual void | place (const point &origin, const point &size) override |
See widget::place. More... | |
virtual bool | has_widget (const widget &widget) const override |
See widget::has_widget. More... | |
virtual void | set_origin (const point &origin) override |
See widget::set_origin. More... | |
virtual void | set_visible_rectangle (const SDL_Rect &rectangle) override |
See widget::set_visible_rectangle. More... | |
virtual void | impl_draw_children () override |
See widget::impl_draw_children. More... | |
virtual void | set_active (const bool active) override |
See styled_widget::set_active. More... | |
bool | disable_click_dismiss () const override |
See widget::disable_click_dismiss. More... | |
virtual iteration::walker_ptr | create_walker () override |
See widget::create_walker. More... | |
void | init_grid (const builder_grid &grid_builder) |
Initializes and builds the grid. More... | |
grid::iterator | begin () |
grid::iterator | end () |
unsigned | add_row (const unsigned count=1) |
void | set_rows (const unsigned rows) |
unsigned int | get_rows () const |
void | set_cols (const unsigned cols) |
unsigned int | get_cols () const |
void | set_rows_cols (const unsigned rows, const unsigned cols) |
void | set_child (std::unique_ptr< widget > widget, const unsigned row, const unsigned col, const unsigned flags, const unsigned border_size) |
void | set_row_grow_factor (const unsigned row, const unsigned factor) |
void | set_column_grow_factor (const unsigned column, const unsigned factor) |
const grid & | get_grid () const |
grid & | get_grid () |
Public Member Functions inherited from gui2::styled_widget | |
styled_widget (const implementation::builder_styled_widget &builder, const std::string &control_type) | |
Constructor. More... | |
virtual void | set_members (const widget_item &data) |
Sets the members of the styled_widget. More... | |
bool | disable_click_dismiss () const override |
See widget::disable_click_dismiss. More... | |
point | get_config_minimum_size () const |
Gets the minimum size as defined in the config. More... | |
point | get_config_default_size () const |
Gets the default size as defined in the config. More... | |
point | get_config_maximum_size () const |
Gets the best size as defined in the config. More... | |
virtual unsigned | get_characters_per_line () const |
Returns the number of characters per line. More... | |
virtual bool | get_link_aware () const |
Returns whether the label should be link_aware, in in rendering and in searching for links with get_link. More... | |
virtual color_t | get_link_color () const |
Returns the color string to be used with links. More... | |
bool | get_use_tooltip_on_label_overflow () const |
void | set_use_tooltip_on_label_overflow (const bool use_tooltip=true) |
const t_string & | get_label () const |
virtual void | set_label (const t_string &text) |
virtual void | set_use_markup (bool use_markup) |
bool | get_use_markup () const |
const t_string & | tooltip () const |
void | set_tooltip (const t_string &tooltip) |
const t_string & | help_message () const |
void | set_help_message (const t_string &help_message) |
std::vector< canvas > & | get_canvases () |
canvas & | get_canvas (const unsigned index) |
virtual void | set_text_alignment (const PangoAlignment text_alignment) |
PangoAlignment | get_text_alignment () const |
void | set_text_ellipse_mode (const PangoEllipsizeMode ellipse_mode) |
PangoEllipsizeMode | get_text_ellipse_mode () const |
Get the text's ellipsize mode. More... | |
void | set_text_maximum_width (int max_width) |
Set how wide the text can become. More... | |
Public Member Functions inherited from gui2::widget | |
widget (const widget &)=delete | |
widget & | operator= (const widget &)=delete |
widget () | |
widget (const builder_widget &builder) | |
Constructor. More... | |
virtual | ~widget () override |
void | set_id (const std::string &id) |
const std::string & | id () const |
window * | get_window () |
Get the parent window. More... | |
const window * | get_window () const |
The constant version of get_window. More... | |
grid * | get_parent_grid () |
Get the parent grid. More... | |
const grid * | get_parent_grid () const |
void | set_parent (widget *parent) |
widget * | parent () |
point | get_best_size () const |
Gets the best size for the widget. More... | |
virtual bool | can_mouse_focus () const |
Whether the mouse move/click event go 'through' this widget. More... | |
virtual void | set_size (const point &size) |
Sets the size of the widget. More... | |
virtual void | move (const int x_offset, const int y_offset) |
Moves a widget. More... | |
virtual void | set_horizontal_alignment (const std::string &alignment) |
Sets the horizontal alignment of the widget within its parent grid. More... | |
virtual void | set_vertical_alignment (const std::string &alignment) |
Sets the horizontal alignment of the widget within its parent grid. More... | |
point | get_origin () const |
Returns the screen origin of the widget. More... | |
point | get_size () const |
Returns the size of the widget. More... | |
rect | get_rectangle () const |
Gets the bounding rectangle of the widget on the screen. More... | |
int | get_x () const |
int | get_y () const |
unsigned | get_width () const |
unsigned | get_height () const |
void | set_linked_group (const std::string &linked_group) |
std::string | get_linked_group () const |
SDL_Rect | calculate_blitting_rectangle () const |
Calculates the blitting rectangle of the widget. More... | |
SDL_Rect | calculate_clipping_rectangle () const |
Calculates the clipping rectangle of the widget. More... | |
bool | draw_background () |
Draws the background of a widget. More... | |
void | draw_children () |
Draws the children of a widget. More... | |
bool | draw_foreground () |
Draws the foreground of the widget. More... | |
SDL_Rect | get_dirty_rectangle () const |
Gets the dirty rectangle of the widget. More... | |
void | queue_redraw () |
Indicates that this widget should be redrawn. More... | |
void | queue_redraw (const rect ®ion) |
Indicate that specific region of the screen should be redrawn. More... | |
void | set_visible (const visibility visible) |
visibility | get_visible () const |
redraw_action | get_drawing_action () const |
void | set_debug_border_mode (const debug_border debug_border_mode) |
void | set_debug_border_color (const color_t debug_border_color) |
template<class T > | |
NOT_DANGLING T * | find_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 > | |
NOT_DANGLING const T * | find_widget (const std::string &id, const bool must_be_active, const bool must_exist) const |
template<class T > | |
NOT_DANGLING T & | find_widget (const std::string &id, const bool must_be_active=false) |
Gets a widget with the wanted id. More... | |
template<class T > | |
NOT_DANGLING const T & | find_widget (const std::string &id, const bool must_be_active=false) const |
Public Member Functions inherited from gui2::event_executor | |
event_executor () | |
virtual | ~event_executor () |
void | set_wants_mouse_hover (const bool hover=true) |
bool | wants_mouse_hover () const |
void | set_wants_mouse_left_double_click (const bool click=true) |
bool | wants_mouse_left_double_click () const |
void | set_wants_mouse_middle_double_click (const bool click=true) |
bool | wants_mouse_middle_double_click () const |
event_executor & | set_wants_mouse_right_double_click (const bool click=true) |
bool | wants_mouse_right_double_click () const |
Public Member Functions inherited from gui2::event::dispatcher | |
dispatcher () | |
virtual | ~dispatcher () |
void | connect () |
Connects the dispatcher to the event handler. More... | |
void | disconnect () |
Disconnects the dispatcher from the event handler. More... | |
bool | is_connected () const |
Return whether the dispatcher is currently connected. More... | |
bool | has_event (const ui_event event, const event_queue_type event_type) |
bool | fire (const ui_event event, widget &target) |
Fires an event which has no extra parameters. More... | |
bool | fire (const ui_event event, widget &target, const point &coordinate) |
Fires an event which takes a coordinate parameter. More... | |
bool | fire (const ui_event event, widget &target, const SDL_Keycode key, const SDL_Keymod modifier, const std::string &unicode) |
Fires an event which takes keyboard parameters. More... | |
bool | fire (const ui_event event, widget &target, const point &pos, const point &distance) |
Fires an event which takes touch-motion parameters. More... | |
bool | fire (const ui_event event, widget &target, const point ¢er, float dTheta, float dDist, uint8_t numFingers) |
Fires an event which takes touch-gesture parameters. More... | |
bool | fire (const ui_event event, widget &target, void *) |
Fires an event which takes notification parameters. More... | |
bool | fire (const ui_event event, widget &target, const message &msg) |
Fires an event which takes message parameters. More... | |
bool | fire (const ui_event event, widget &target, const SDL_Event &sdlevent) |
Fires an event that's a raw SDL event. More... | |
bool | fire (const ui_event event, widget &target, const std::string &text, int32_t start, int32_t len) |
Fires an event which takes text input parameters. More... | |
template<ui_event E, typename F > | |
void | connect_signal (const F &func, const queue_position position=back_child) |
Adds a callback to the appropriate queue based on event type. More... | |
template<ui_event E, typename F > | |
void | disconnect_signal (const F &func, const queue_position position=back_child) |
Removes a callback from the appropriate queue based on event type. More... | |
void | capture_mouse () |
Captures the mouse. More... | |
void | release_mouse () |
Releases the mouse capture. More... | |
void | set_mouse_behavior (const mouse_behavior mouse_behavior) |
mouse_behavior | get_mouse_behavior () const |
void | set_want_keyboard_input (const bool want_keyboard_input) |
bool | get_want_keyboard_input () const |
void | register_hotkey (const hotkey::HOTKEY_COMMAND id, const hotkey_function &function) |
Registers a hotkey. More... | |
bool | execute_hotkey (const hotkey::HOTKEY_COMMAND id) |
Executes a hotkey. More... | |
Public Member Functions inherited from enable_lua_ptr< widget > | |
enable_lua_ptr (widget *tp) | |
Public Member Functions inherited from gui2::top_level_drawable | |
virtual void | update () |
Update state and any parameters that may effect layout, or any of the later stages. More... | |
Static Public Member Functions | |
static window * | window_instance (const unsigned handle) |
Returns the instance of a window. More... | |
static retval | get_retval_by_id (const std::string &id) |
Gets the retval for the default buttons. More... | |
static const std::string & | type () |
Static type getter that does not rely on the widget being constructed. More... | |
Static Public Member Functions inherited from gui2::panel | |
static const std::string & | type () |
Static type getter that does not rely on the widget being constructed. More... | |
Private Member Functions | |
void | update_render_textures () |
Ensure render textures are valid and correct. More... | |
void | layout_linked_widgets () |
Layouts the linked widgets. More... | |
bool | click_dismiss (const int mouse_button_mask) |
Handles a mouse click event for dismissing the dialog. More... | |
virtual const std::string & | get_control_type () const override |
Inherited from styled_widget, implemented by REGISTER_WIDGET. More... | |
void | redraw_windows_on_top () const |
Schedules windows on top of us (if any) to redraw. More... | |
void | finalize (const builder_grid &content_grid) |
Finishes the initialization of the grid. More... | |
void | generate_dot_file (const std::string &, const unsigned) |
void | signal_handler_sdl_video_resize (const event::ui_event event, bool &handled, const point &new_size) |
void | signal_handler_click_dismiss (const event::ui_event event, bool &handled, bool &halt, const int mouse_button_mask) |
The handler for the click dismiss mouse 'event'. More... | |
void | signal_handler_sdl_key_down (const event::ui_event event, bool &handled, const SDL_Keycode key, const SDL_Keymod mod, bool handle_tab) |
void | signal_handler_message_show_tooltip (const event::ui_event event, bool &handled, const event::message &message) |
void | signal_handler_message_show_helptip (const event::ui_event event, bool &handled, const event::message &message) |
void | signal_handler_request_placement (const event::ui_event event, bool &handled) |
void | signal_handler_close_window () |
Private Attributes | |
texture | render_buffer_ = {} |
The internal render buffer used by render() and expose(). More... | |
rect | awaiting_rerender_ |
The part of the window (if any) currently marked for rerender. More... | |
std::vector< rect > | deferred_regions_ |
Parts of the window (if any) with rendering deferred to next frame. More... | |
status | status_ |
The status of the window. More... | |
show_mode | show_mode_ |
The mode in which the window is shown. More... | |
int | retval_ |
dialogs::modal_dialog * | owner_ |
The dialog that owns the window. More... | |
bool | need_layout_ |
When set the form needs a full layout redraw cycle. More... | |
wfl::map_formula_callable | variables_ |
The variables of the canvas. More... | |
bool | invalidate_layout_blocked_ |
Is invalidate_layout blocked, see invalidate_layout_blocker. More... | |
bool | hidden_ |
Avoid drawing the window. More... | |
const bool | automatic_placement_ |
Do we wish to place the widget automatically? More... | |
const unsigned | horizontal_placement_ |
Sets the horizontal placement. More... | |
const unsigned | vertical_placement_ |
Sets the vertical placement. More... | |
typed_formula< unsigned > | maximum_width_ |
The maximum width if automatic_placement_ is true. More... | |
typed_formula< unsigned > | maximum_height_ |
The maximum height if automatic_placement_ is true. More... | |
typed_formula< unsigned > | x_ |
The formula to calculate the x value of the dialog. More... | |
typed_formula< unsigned > | y_ |
The formula to calculate the y value of the dialog. More... | |
typed_formula< unsigned > | w_ |
The formula to calculate the width of the dialog. More... | |
typed_formula< unsigned > | h_ |
The formula to calculate the height of the dialog. More... | |
typed_formula< bool > | reevaluate_best_size_ |
The formula to determine whether the size is good. More... | |
wfl::function_symbol_table | functions_ |
The formula definitions available for the calculation formulas. More... | |
builder_window::window_resolution::tooltip_info | tooltip_ |
The settings for the tooltip. More... | |
builder_window::window_resolution::tooltip_info | helptip_ |
The settings for the helptip. More... | |
bool | click_dismiss_ |
Do we want to have easy close behavior? More... | |
bool | enter_disabled_ |
Disable the enter key see our setter for more info. More... | |
bool | escape_disabled_ |
Disable the escape key see our setter for more info. More... | |
std::map< std::string, linked_size > | linked_size_ |
List of the widgets, whose size are linked together. More... | |
std::vector< widget * > | tab_order |
List of widgets in the tabbing order. More... | |
int | mouse_button_state_ |
The state of the mouse button. More... | |
unsigned int | consecutive_changed_frames_ = 0u |
In how many consecutive frames the window has changed. More... | |
std::unique_ptr< event::distributor > | event_distributor_ |
std::function< bool(window &)> | exit_hook_ |
Friends | |
class | debug_layout_graph |
struct | window_implementation |
class | invalidate_layout_blocker |
class | pane |
std::unique_ptr< window > | build (const builder_window::window_resolution &) |
Additional Inherited Members | |
Protected Member Functions inherited from gui2::container_base | |
virtual point | calculate_best_size () const override |
See widget::calculate_best_size. More... | |
virtual void | layout_children () override |
See widget::layout_children. More... | |
Protected Member Functions inherited from gui2::styled_widget | |
resolution_definition_ptr | get_config () |
resolution_definition_const_ptr | get_config () const |
template<typename T > | |
std::shared_ptr< const typename T::resolution > | cast_config_to () const |
Casts the current resolution definition config to the respective type of a derived widget. More... | |
void | set_config (resolution_definition_ptr config) |
virtual void | update_canvas () |
Updates the canvas(ses). More... | |
unsigned int | get_text_font_size () const |
Resolves and returns the text_font_size. More... | |
int | get_text_maximum_width () const |
Returns the maximum width available for the text. More... | |
int | get_text_maximum_height () const |
Returns the maximum height available for the text. More... | |
std::string | get_label_token (const point &position, const char *delimiters=" \n\r\t") const |
Exposes font::pango_text::get_token, for the text label of this styled_widget. More... | |
std::string | get_label_link (const point &position) const |
Protected Member Functions inherited from gui2::widget | |
void | set_layout_size (const point &size) |
const point & | layout_size () const |
void | clear_layout_size () |
Throws away layout_size_. More... | |
Protected Member Functions inherited from gui2::top_level_drawable | |
top_level_drawable () | |
virtual | ~top_level_drawable () |
top_level_drawable (const top_level_drawable &) | |
top_level_drawable & | operator= (const top_level_drawable &) |
top_level_drawable (top_level_drawable &&) | |
top_level_drawable & | operator= (top_level_drawable &&) |
base class of top level items, the only item which needs to store the final canvases to draw on.
A window is a kind of panel see the panel for which fields exist.
Definition at line 60 of file window.hpp.
|
strong |
Enumerator | |
---|---|
on_all | Always run hook. |
on_ok | Run hook only if result is OK. |
Definition at line 437 of file window.hpp.
|
strong |
Enumerator | |
---|---|
none | |
modal | |
modeless | |
tooltip |
Definition at line 463 of file window.hpp.
|
strong |
The status of the window.
Definition at line 206 of file window.hpp.
|
explicit |
< Needs to be initialized in show.
Definition at line 253 of file window.cpp.
|
virtual |
Definition at line 380 of file window.cpp.
References gui2::dialogs::tip::remove().
void gui2::window::add_linked_widget | ( | const std::string & | id, |
widget * | widget | ||
) |
Adds a widget to a linked size group.
The group needs to exist, which is done by calling init_linked_size_group. A widget may only be member of one group.
id | The id of the group. |
widget | The widget to add to the group. |
Definition at line 804 of file window.cpp.
References ERR_GUI, has_linked_size_group(), gui2::widget::id(), and linked_size_.
Referenced by gui2::widget::layout_initialize().
void gui2::window::add_to_keyboard_chain | ( | widget * | widget | ) |
Adds the widget to the keyboard chain.
widget | The widget to add to the chain. The widget should be valid widget, which hasn't been added to the chain yet. |
Definition at line 1213 of file window.cpp.
References event_distributor_.
Referenced by gui2::addon_list::add_list_to_keyboard_chain(), gui2::dialogs::campaign_selection::pre_show(), gui2::dialogs::file_dialog::pre_show(), gui2::dialogs::game_load::pre_show(), gui2::dialogs::log_settings::pre_show(), gui2::dialogs::mp_create_game::pre_show(), gui2::dialogs::unit_create::pre_show(), gui2::dialogs::unit_recall::pre_show(), gui2::dialogs::unit_recruit::pre_show(), and gui2::dialogs::wml_message_base::pre_show().
void gui2::window::add_to_tab_order | ( | widget * | widget, |
int | at = -1 |
||
) |
Add the widget to the tabbing order.
widget | The widget to be added to the tabbing order |
at | A hint for where to place the widget in the tabbing order |
Definition at line 1225 of file window.cpp.
References schema_validation::at(), event_distributor_, keyboard_capture(), and tab_order.
Referenced by gui2::dialogs::addon_auth::pre_show(), gui2::dialogs::custom_tod::pre_show(), gui2::dialogs::editor_edit_label::pre_show(), gui2::dialogs::editor_edit_scenario::pre_show(), gui2::dialogs::editor_edit_side::pre_show(), gui2::dialogs::mp_login::pre_show(), and gui2::dialogs::lobby_player_info::pre_show().
|
private |
Handles a mouse click event for dismissing the dialog.
mouse_button_mask | The SDL_BUTTON mask for the button used to dismiss the click. If the caller is from the keyboard code the value should be 0. |
Definition at line 1084 of file window.cpp.
References does_click_dismiss(), mouse_button_state_, gui2::OK, and set_retval().
Referenced by set_click_dismiss(), signal_handler_click_dismiss(), and signal_handler_sdl_key_down().
|
inline |
Requests to close the window.
This request is not always honored immediately, and so callers must account for the window remaining open. For example, when overriding draw_manager's update() method.
Definition at line 219 of file window.hpp.
References REQUEST_CLOSE, and status_.
Referenced by gui2::dialogs::lobby_player_info::check_status_button_callback(), gui2::dialogs::addon_manager::fetch_addons_list(), gui2::dialogs::synched_choice_wait::handle_generic_event(), intf_dialog_close(), gui2::dialogs::lobby_player_info::kick_ban_button_callback(), gui2::dialogs::lobby_player_info::kick_button_callback(), gui2::dialogs::story_viewer::nav_button_callback(), gui2::dialogs::synched_choice_wait::pre_show(), gui2::dialogs::loading_screen::process(), set_retval(), gui2::dialogs::lobby_player_info::start_whisper_button_callback(), and gui2::dialogs::lobby_player_info::stopgame_button_callback().
void gui2::window::defer_region | ( | const rect & | region | ) |
Defer rendering of a particular region to next frame.
This is used for blur, which must render the region underneath once before rendering the blur.
region | The region to defer in screen coordinates. |
Definition at line 691 of file window.cpp.
References LOG_DP.
Referenced by gui2::grid::impl_draw_children().
|
inline |
|
inline |
Does the window close easily?
The behavior can change at run-time, but that might cause oddities with the easy close button (when one is needed).
Definition at line 310 of file window.hpp.
References click_dismiss_, and gui2::container_base::disable_click_dismiss().
Referenced by click_dismiss().
void gui2::window::draw | ( | ) |
Draws the window.
This routine draws the window if needed, it's called from the event handler. This is done by a drawing event. When a window is shown it manages an SDL timer which fires a drawing event every X milliseconds, that event calls this routine. Don't call it manually.
Definition at line 600 of file window.cpp.
|
overridevirtual |
Called by draw_manager when it believes a redraw is necessary.
Can be called multiple times per vsync.
Implements gui2::top_level_drawable.
Definition at line 719 of file window.cpp.
References draw::blit(), rect::clip(), DBG_DP, dst, rect::empty(), draw::get_clip(), rect::intersect(), rect::shift(), and src.
|
private |
Finishes the initialization of the grid.
content_grid | The new contents for the content grid. |
Definition at line 1097 of file window.cpp.
References gui2::builder_grid::build(), c, gui2::widget::find_widget(), gui2::container_base::get_grid(), gui2::widget::id(), and gui2::widget::set_id().
|
overridevirtual |
See widget::find.
Reimplemented from gui2::container_base.
Definition at line 783 of file window.cpp.
References gui2::container_base::find().
|
overridevirtual |
See widget::find.
Reimplemented from gui2::container_base.
Definition at line 778 of file window.cpp.
References gui2::container_base::find().
Referenced by gui2::dialogs::modal_dialog::init_fields(), and gui2::dialogs::lobby_player_info::pre_show().
|
overridevirtual |
See widget::find_at.
Reimplemented from gui2::container_base.
Definition at line 772 of file window.cpp.
References gui2::container_base::find_at().
|
overridevirtual |
See widget::find_at.
Reimplemented from gui2::container_base.
Definition at line 767 of file window.cpp.
References gui2::container_base::find_at().
Referenced by gui2::dialogs::drop_down_menu::mouse_up_callback().
|
inlineprivate |
Definition at line 679 of file window.hpp.
Referenced by layout().
|
overrideprivatevirtual |
Inherited from styled_widget, implemented by REGISTER_WIDGET.
Reimplemented from gui2::panel.
|
inline |
Gets a reference to the window's distributor to allow some state peeking.
Definition at line 688 of file window.hpp.
References event_distributor_.
|
inline |
Definition at line 427 of file window.hpp.
References linked_size_, and draw::point().
Referenced by gui2::widget::get_best_size().
|
inline |
Definition at line 417 of file window.hpp.
References need_layout_.
Referenced by gui2::scrollbar_container::content_resize_request().
|
inline |
Definition at line 402 of file window.hpp.
References retval_.
Referenced by gui2::dialogs::addon_manager::exit_hook(), gui2::dialogs::mp_lobby::exit_hook(), gui2::dialogs::file_dialog::on_exit(), and gui2::dialogs::modal_dialog::show().
|
static |
Gets the retval for the default buttons.
Definition at line 419 of file window.cpp.
References gui2::CANCEL, gui2::NONE, and gui2::OK.
Referenced by gui2::implementation::get_retval().
bool gui2::window::has_linked_size_group | ( | const std::string & | id | ) |
Is the linked size group defined for this window?
id | The id of the group. |
Definition at line 799 of file window.cpp.
References linked_size_.
Referenced by add_linked_widget(), init_linked_size_group(), and remove_linked_widget().
void gui2::window::hide | ( | ) |
Hides the window.
It will not draw until it is shown again.
Definition at line 627 of file window.cpp.
void gui2::window::init_linked_size_group | ( | const std::string & | id, |
const bool | fixed_width, | ||
const bool | fixed_height | ||
) |
Initializes a linked size group.
Note at least one of fixed_width or fixed_height must be true.
id | The id of the group. |
fixed_width | Does the group have a fixed width? |
fixed_height | Does the group have a fixed height? |
Definition at line 789 of file window.cpp.
References has_linked_size_group(), gui2::widget::id(), and linked_size_.
Referenced by gui2::container_base::inject_linked_groups().
void gui2::window::invalidate_layout | ( | ) |
Updates the size of the window.
If the window has automatic placement set this function recalculates the window. To be used after creation and after modification or items which can have different sizes eg listboxes.
Definition at line 761 of file window.cpp.
References invalidate_layout_blocked_, and need_layout_.
Referenced by gui2::scrollbar_container::content_resize_height(), gui2::scrollbar_container::content_resize_width(), gui2::dialogs::editor_edit_unit::load_unit_type(), gui2::dialogs::help_browser::pre_show(), gui2::scrollbar_base::recalculate(), gui2::dialogs::unit_recall::rename_unit(), gui2::listbox::set_row_shown(), gui2::widget::set_visible(), gui2::dialogs::help_browser::show_topic(), signal_handler_request_placement(), signal_handler_sdl_video_resize(), gui2::dialogs::custom_tod::update_image(), gui2::dialogs::editor_edit_unit::update_image(), gui2::multiline_text::update_layout(), gui2::dialogs::custom_tod::update_tod_display(), and WIDGET_SETTER().
|
inline |
Is invalidate_layout blocked, see invalidate_layout_blocker.
Definition at line 245 of file window.hpp.
References invalidate_layout_blocked_.
void gui2::window::keyboard_capture | ( | widget * | widget | ) |
Definition at line 1207 of file window.cpp.
References event_distributor_.
Referenced by add_to_tab_order(), gui2::dialogs::chat_log::view::bind(), gui2::dialogs::lua_interpreter::controller::bind(), gui2::dialogs::modal_dialog::init_fields(), intf_set_dialog_focus(), gui2::listbox::list_item_clicked(), gui2::dialogs::file_dialog::on_bookmark_selected(), gui2::dialogs::file_dialog::on_row_selected(), gui2::dialogs::addon_manager::pre_show(), gui2::dialogs::campaign_difficulty::pre_show(), gui2::dialogs::campaign_selection::pre_show(), gui2::dialogs::core_selection::pre_show(), gui2::dialogs::drop_down_menu::pre_show(), gui2::dialogs::editor_edit_pbl::pre_show(), gui2::dialogs::editor_edit_pbl_translation::pre_show(), gui2::dialogs::editor_generate_map::pre_show(), gui2::dialogs::file_dialog::pre_show(), gui2::dialogs::game_load::pre_show(), gui2::dialogs::game_stats::pre_show(), gui2::dialogs::help_browser::pre_show(), gui2::dialogs::language_selection::pre_show(), gui2::dialogs::log_settings::pre_show(), gui2::dialogs::message::pre_show(), gui2::dialogs::faction_select::pre_show(), gui2::dialogs::mp_lobby::pre_show(), gui2::dialogs::mp_create_game::pre_show(), gui2::dialogs::mp_login::pre_show(), gui2::dialogs::preferences_dialog::pre_show(), gui2::dialogs::prompt::pre_show(), gui2::dialogs::screenshot_notification::pre_show(), gui2::dialogs::simple_item_selector::pre_show(), gui2::dialogs::theme_list::pre_show(), gui2::dialogs::unit_advance::pre_show(), gui2::dialogs::unit_attack::pre_show(), gui2::dialogs::unit_create::pre_show(), gui2::dialogs::unit_list::pre_show(), gui2::dialogs::unit_recall::pre_show(), gui2::dialogs::unit_recruit::pre_show(), gui2::dialogs::wml_message_base::pre_show(), gui2::scroll_label::signal_handler_left_button_down(), gui2::scroll_text::signal_handler_left_button_down(), gui2::spinner::signal_handler_left_button_down(), gui2::tree_view::signal_handler_left_button_down(), gui2::combobox::signal_handler_left_button_down(), gui2::multiline_text::signal_handler_left_button_down(), gui2::text_box::signal_handler_left_button_down(), gui2::slider::signal_handler_left_button_up(), gui2::chatbox::signal_handler_receive_keyboard_focus(), signal_handler_sdl_key_down(), and gui2::chatbox::switch_to_window().
|
overridevirtual |
Lays out the window.
This part does the pre and post processing for the actual layout algorithm.
See Layout algorithm for more information.
This is also called by draw_manager to finalize screen layout.
Reimplemented from gui2::top_level_drawable.
Reimplemented in gui2::dialogs::loading_screen.
Definition at line 838 of file window.cpp.
References _(), wfl::map_formula_callable::add(), automatic_placement_, click_dismiss_, gui2::event::connect_signal_mouse_left_click(), DBG_DP, gui2::container_base::disable_click_dismiss(), functions_, generate_dot_file(), gui2::widget::get_best_size(), gui2::get_mouse_position(), gui2::get_screen_size_variables(), h_, gui2::grid::HORIZONTAL_ALIGN_CENTER, gui2::grid::HORIZONTAL_ALIGN_LEFT, gui2::grid::HORIZONTAL_ALIGN_RIGHT, horizontal_placement_, gui2::event::init_mouse_location(), gui2::widget::invisible, gui2::window_implementation::layout(), gui2::container_base::layout_initialize(), layout_linked_widgets(), gui2::log_gui_layout, log_scope2, LOG_SCOPE_HEADER, maximum_height_, maximum_width_, need_layout_, gui2::OK, gui2::container_base::place(), reevaluate_best_size_, gui2::settings::screen_height, gui2::settings::screen_width, set_retval(), gui2::widget::set_visible(), utf8::size(), VALIDATE, variables_, gui2::grid::VERTICAL_ALIGN_BOTTOM, gui2::grid::VERTICAL_ALIGN_CENTER, gui2::grid::VERTICAL_ALIGN_TOP, vertical_placement_, gui2::widget::visible, w_, x_, and y_.
Referenced by gui2::dialogs::loading_screen::layout(), and gui2::window_implementation::layout().
|
private |
Layouts the linked widgets.
See Layout algorithm for more information.
Definition at line 1038 of file window.cpp.
References gui2::widget::get_best_size(), gui2::window::linked_size::height, linked_size_, gui2::widget::set_layout_size(), utf8::size(), gui2::window::linked_size::widgets, and gui2::window::linked_size::width.
Referenced by layout(), gui2::window_implementation::layout(), and gui2::pane::signal_handler_request_placement().
|
inline |
Returns the dialog mode for this window.
Definition at line 694 of file window.hpp.
References show_mode_.
Referenced by gui2::dialogs::mp_lobby::enter_game(), gui2::dialogs::mp_lobby::enter_game_by_id(), gui2::dialogs::mp_lobby::enter_game_by_index(), gui2::dialogs::mp_lobby::enter_selected_game(), and set_exit_hook().
void gui2::window::mouse_capture | ( | const bool | capture = true | ) |
Definition at line 1201 of file window.cpp.
References event_distributor_.
Referenced by gui2::button::signal_handler_left_button_down(), gui2::combobox::signal_handler_left_button_down(), gui2::menu_button::signal_handler_left_button_down(), gui2::multiline_text::signal_handler_left_button_down(), gui2::multimenu_button::signal_handler_left_button_down(), gui2::repeating_button::signal_handler_left_button_down(), gui2::scrollbar_base::signal_handler_left_button_down(), gui2::slider_base::signal_handler_left_button_down(), gui2::text_box::signal_handler_left_button_down(), gui2::scrollbar_base::signal_handler_left_button_up(), and gui2::slider_base::signal_handler_left_button_up().
void gui2::window::queue_rerender | ( | ) |
Definition at line 677 of file window.cpp.
void gui2::window::queue_rerender | ( | const rect & | region | ) |
Queue a rerender of the internal render buffer.
This does not request a repaint. Ordinarily use queue_redraw() on a widget, which will call this automatically.
region | The region to rerender in screen coordinates. |
Definition at line 682 of file window.cpp.
References rect::intersect(), and rect::shift().
Referenced by gui2::widget::queue_redraw().
|
private |
Schedules windows on top of us (if any) to redraw.
void gui2::window::remove_from_keyboard_chain | ( | widget * | widget | ) |
Remove the widget from the keyboard chain.
widget | The widget to be removed from the chain. |
Definition at line 1219 of file window.cpp.
References event_distributor_.
void gui2::window::remove_linked_widget | ( | const std::string & | id, |
const widget * | widget | ||
) |
Removes a widget from a linked size group.
The group needs to exist, which is done by calling init_linked_size_group. If the widget is no member of the group the function does nothing.
id | The id of the group. |
widget | The widget to remove from the group. |
Definition at line 818 of file window.cpp.
References has_linked_size_group(), gui2::widget::id(), and linked_size_.
Referenced by gui2::widget::~widget().
|
overridevirtual |
Ensure the window's internal render buffer is up-to-date.
This renders the window to an off-screen texture, which is then copied to the screen during expose().
Reimplemented from gui2::top_level_drawable.
Definition at line 697 of file window.cpp.
References DBG_DP, events::draw(), sdl::empty_rect, draw::override_clip(), and draw::set_render_target().
|
overridevirtual |
The current draw location of the window, on the screen.
Implements gui2::top_level_drawable.
Definition at line 740 of file window.cpp.
|
inline |
Definition at line 412 of file window.hpp.
References click_dismiss(), and click_dismiss_.
Referenced by gui2::dialogs::lua_interpreter::controller::bind(), gui2::dialogs::title_screen::init_callbacks(), gui2::dialogs::message::pre_show(), and gui2::dialogs::wml_message_base::pre_show().
|
inline |
Disable the enter key.
This is added to block dialogs from being closed automatically.
Definition at line 323 of file window.hpp.
References enter_disabled_.
Referenced by gui2::dialogs::lua_interpreter::controller::bind(), gui2::dialogs::game_load::display_savegame(), gui2::dialogs::title_screen::init_callbacks(), gui2::dialogs::addon_manager::pre_show(), gui2::dialogs::loading_screen::pre_show(), gui2::dialogs::mp_lobby::pre_show(), gui2::dialogs::mp_join_game::pre_show(), gui2::dialogs::mp_staging::pre_show(), gui2::dialogs::screenshot_notification::pre_show(), and gui2::dialogs::story_viewer::pre_show().
|
inline |
Disable the escape key.
This is added to block dialogs from being closed automatically.
Definition at line 336 of file window.hpp.
References escape_disabled_.
Referenced by gui2::dialogs::title_screen::init_callbacks(), gui2::dialogs::addon_manager::pre_show(), gui2::dialogs::loading_screen::pre_show(), gui2::dialogs::mp_join_game::pre_show(), gui2::dialogs::mp_staging::pre_show(), gui2::dialogs::unit_advance::pre_show(), and gui2::dialogs::wml_message_base::pre_show().
Sets the window's exit hook.
A window will only close if the given function returns true under the specified mode.
Definition at line 449 of file window.hpp.
References exit_hook_, mode(), gui2::OK, on_all, on_ok, and w.
Referenced by gui2::dialogs::addon_manager::pre_show(), gui2::dialogs::file_dialog::pre_show(), gui2::dialogs::mp_lobby::pre_show(), gui2::dialogs::mp_create_game::pre_show(), and gui2::dialogs::mp_report::pre_show().
|
inline |
Definition at line 407 of file window.hpp.
References owner_.
|
inline |
Sets there return value of the window.
retval | The return value for the window. |
close_window | Close the window after setting the value. |
Definition at line 395 of file window.hpp.
References close(), and retval_.
Referenced by gui2::dialogs::title_screen::button_callback_cores(), gui2::dialogs::title_screen::button_callback_multiplayer(), gui2::dialogs::formula_debugger::callback_continue_button(), gui2::dialogs::formula_debugger::callback_next_button(), gui2::dialogs::formula_debugger::callback_step_button(), gui2::dialogs::formula_debugger::callback_stepout_button(), click_dismiss(), gui2::dialogs::unit_recall::dismiss_unit(), gui2::dialogs::mp_lobby::enter_game(), gui2::dialogs::preferences_dialog::handle_gui2_theme_select(), gui2::dialogs::title_screen::hotkey_callback_select_tests(), gui2::dialogs::title_screen::init_callbacks(), layout(), gui2::dialogs::mp_create_game::load_game_callback(), gui2::dialogs::drop_down_menu::mouse_up_callback(), gui2::dialogs::mp_join_game::network_handler(), gui2::dialogs::mp_staging::network_handler(), gui2::dialogs::file_dialog::on_exit(), gui2::dialogs::title_screen::on_resize(), gui2::dialogs::mp_create_game::post_show(), gui2::dialogs::mp_lobby::pre_show(), gui2::dialogs::mp_create_game::pre_show(), gui2::dialogs::mp_join_game::pre_show(), gui2::dialogs::mp_staging::pre_show(), gui2::dialogs::campaign_selection::proceed(), gui2::dialogs::file_dialog::push_fileview_row(), gui2::dialogs::editor_edit_unit::quit_confirmation(), gui2::dialogs::title_screen::register_button(), gui2::dialogs::hotkey_bind::sdl_event_callback(), gui2::dialogs::title_screen::show_preferences(), signal_handler_close_window(), gui2::button::signal_handler_left_button_click(), gui2::toggle_button::signal_handler_left_button_double_click(), gui2::toggle_panel::signal_handler_left_button_double_click(), signal_handler_sdl_key_down(), and gui2::dialogs::mp_staging::start_game().
|
inline |
Definition at line 422 of file window.hpp.
References wfl::map_formula_callable::add(), gui2::widget::queue_redraw(), and variables_.
Referenced by gui2::dialogs::drop_down_menu::pre_show().
int gui2::window::show | ( | unsigned | auto_close_timeout = 0 | ) |
Shows the window, running an event loop until it should close.
auto_close_timeout | The time in ms after which the window will automatically close, if 0 it doesn't close. |
Definition at line 498 of file window.cpp.
References CLOSE_WINDOW_EVENT, data, DBG_DP, events::draw(), sdl::get_mouse_button_mask(), utils::get_unknown_exception_type(), id, LOG_DP, gui2::log_gui_draw, log_scope2, LOG_SCOPE_HEADER, events::pump(), and gui2::dialogs::tip::remove().
Referenced by gui2::dialogs::modal_dialog::show().
void gui2::window::show_non_modal | ( | ) |
Shows the window non modal.
A tooltip can be interacted with unlike the tooltip.
auto_close_timeout
.auto_close_timeout
The time in ms after which the window will automatically close, if 0 it doesn't close.
Definition at line 464 of file window.cpp.
References DBG_DP, id, LOG_DP, gui2::log_gui_draw, log_scope2, and events::pump_and_draw().
Referenced by gui2::dialogs::modeless_dialog::show().
void gui2::window::show_tooltip | ( | ) |
Shows the window as a tooltip.
A tooltip can't be interacted with and is just shown.
auto_close_timeout
.auto_close_timeout
The time in ms after which the window will automatically close, if 0 it doesn't close.
Definition at line 432 of file window.cpp.
References DBG_DP, id, LOG_DP, gui2::log_gui_draw, log_scope2, and tooltip.
Referenced by gui2::dialogs::modeless_dialog::show().
|
private |
The handler for the click dismiss mouse 'event'.
event | See event::dispatcher::fire. |
handled | See event::dispatcher::fire. |
halt | See event::dispatcher::fire. |
mouse_button_mask | Forwared to click_dismiss. |
Definition at line 1256 of file window.cpp.
References click_dismiss(), DBG_GUI_E, and LOG_HEADER.
|
private |
Definition at line 1379 of file window.cpp.
References gui2::AUTO_CLOSE, and set_retval().
|
private |
Definition at line 1355 of file window.cpp.
References DBG_GUI_E, helptip_, gui2::builder_window::window_resolution::tooltip_info::id, gui2::event::message_show_helptip::location, LOG_HEADER, gui2::event::message_show_helptip::message, gui2::dialogs::tip::show(), and gui2::event::message_show_helptip::source_rect.
|
private |
Definition at line 1341 of file window.cpp.
References DBG_GUI_E, gui2::builder_window::window_resolution::tooltip_info::id, gui2::event::message_show_tooltip::location, LOG_HEADER, gui2::event::message_show_tooltip::message, gui2::dialogs::tip::show(), gui2::event::message_show_tooltip::source_rect, and tooltip_.
|
private |
Definition at line 1369 of file window.cpp.
References DBG_GUI_E, invalidate_layout(), and LOG_HEADER.
|
private |
Definition at line 1275 of file window.cpp.
References gui2::CANCEL, click_dismiss(), DBG_GUI_E, enter_disabled_, escape_disabled_, event_distributor_, gui2::is_active(), keyboard_capture(), LOG_HEADER, gui2::OK, set_retval(), and tab_order.
|
private |
Definition at line 1241 of file window.cpp.
References DBG_GUI_E, gui2::settings::gamemap_height, gui2::settings::gamemap_width, invalidate_layout(), LOG_HEADER, gui2::settings::screen_height, and gui2::settings::screen_width.
|
static |
Static type getter that does not rely on the widget being constructed.
Referenced by gui2::dialogs::statistics_dialog::add_damage_row(), gui2::dialogs::statistics_dialog::add_hits_row(), gui2::dialogs::statistics_dialog::add_stat_row(), gui2::dialogs::custom_tod::color_slider_callback(), gui2::dialogs::custom_tod::copy_to_clipboard_callback(), gui2::dialogs::mp_create_game::display_games_of_type(), gui2::dialogs::unit_recruit::filter_text_changed(), gui2::dialogs::mp_join_game::generate_side_list(), gui2::dialogs::editor_edit_unit::load_unit_type(), gui2::dialogs::statistics_dialog::on_primary_list_select(), gui2::dialogs::mp_create_game::post_show(), and gui2::dialogs::mp_staging::update_leader_display().
|
private |
Ensure render textures are valid and correct.
Definition at line 643 of file window.cpp.
References draw::clear(), events::draw(), video::get_pixel_scale(), image::get_size(), LOG_DP, draw_manager::render(), draw::set_render_target(), and setter.
|
static |
Returns the instance of a window.
handle | The instance id of the window. |
Definition at line 414 of file window.cpp.
References gui2::widget::get_window().
Referenced by gui2::event::sdl_event_handler::close_window().
|
friend |
|
friend |
Definition at line 62 of file window.hpp.
|
friend |
Definition at line 65 of file window.hpp.
|
friend |
Definition at line 66 of file window.hpp.
|
friend |
Definition at line 64 of file window.hpp.
|
private |
Do we wish to place the widget automatically?
Definition at line 505 of file window.hpp.
Referenced by layout().
|
private |
The part of the window (if any) currently marked for rerender.
Definition at line 166 of file window.hpp.
|
private |
Do we want to have easy close behavior?
Easy closing means that whenever a mouse click is done the dialog will be closed. The widgets in the window may override this behavior by registering themselves as blockers. This is tested by the function disable_click_dismiss().
The handling of easy close is done in the window, in order to do so a window either needs a click_dismiss or an ok button. Both will be hidden when not needed and when needed first the ok is tried and then the click_dismiss button. this allows adding a click_dismiss button to the window definition and use the ok from the window instance.
Definition at line 570 of file window.hpp.
Referenced by does_click_dismiss(), layout(), and set_click_dismiss().
|
private |
In how many consecutive frames the window has changed.
This is used to detect the situation where the title screen changes in every frame, forcing all other windows to redraw everything all the time.
Definition at line 658 of file window.hpp.
|
private |
Parts of the window (if any) with rendering deferred to next frame.
Definition at line 169 of file window.hpp.
|
private |
Disable the enter key see our setter for more info.
Definition at line 573 of file window.hpp.
Referenced by set_enter_disabled(), and signal_handler_sdl_key_down().
|
private |
Disable the escape key see our setter for more info.
Definition at line 576 of file window.hpp.
Referenced by set_escape_disabled(), and signal_handler_sdl_key_down().
|
private |
Definition at line 684 of file window.hpp.
Referenced by add_to_keyboard_chain(), add_to_tab_order(), get_distributor(), keyboard_capture(), mouse_capture(), remove_from_keyboard_chain(), and signal_handler_sdl_key_down().
|
private |
Definition at line 769 of file window.hpp.
Referenced by set_exit_hook().
|
private |
The formula definitions available for the calculation formulas.
Definition at line 545 of file window.hpp.
Referenced by layout().
|
private |
The formula to calculate the height of the dialog.
Definition at line 539 of file window.hpp.
Referenced by layout().
|
private |
The settings for the helptip.
Definition at line 551 of file window.hpp.
Referenced by signal_handler_message_show_helptip().
|
private |
|
private |
Sets the horizontal placement.
Only used if automatic_placement_ is true. The value should be a grid placement flag.
Definition at line 513 of file window.hpp.
Referenced by layout().
|
private |
Is invalidate_layout blocked, see invalidate_layout_blocker.
Definition at line 499 of file window.hpp.
Referenced by invalidate_layout(), invalidate_layout_blocked(), and gui2::window::invalidate_layout_blocker::invalidate_layout_blocker().
|
private |
List of the widgets, whose size are linked together.
Definition at line 603 of file window.hpp.
Referenced by add_linked_widget(), get_linked_size(), has_linked_size_group(), init_linked_size_group(), layout_linked_widgets(), and remove_linked_widget().
|
private |
The maximum height if automatic_placement_ is true.
Definition at line 527 of file window.hpp.
Referenced by layout().
|
private |
The maximum width if automatic_placement_ is true.
Definition at line 524 of file window.hpp.
Referenced by layout().
|
private |
The state of the mouse button.
When click dismissing a dialog in the past the DOWN event was used. This lead to a bug [1]. The obvious change was to switch to the UP event, this lead to another bug; the dialog was directly dismissed. Since the game map code uses the UP and DOWN event to select a unit there is no simple solution.
Upon entry this value stores the mouse button state at entry. When a button is DOWN and goes UP that button does not trigger a dismissal of the dialog, instead that button's down state is removed from this variable. Therefore the next UP event does dismiss the dialog.
[1] https://gna.org/bugs/index.php?18970
Definition at line 643 of file window.hpp.
Referenced by click_dismiss().
|
private |
When set the form needs a full layout redraw cycle.
This happens when either a widget changes it's size or visibility or the window is resized.
Definition at line 493 of file window.hpp.
Referenced by get_need_layout(), invalidate_layout(), and layout().
|
private |
The dialog that owns the window.
Definition at line 485 of file window.hpp.
Referenced by dialog(), gui2::dialogs::mp_connect::selection::parent_list(), gui2::dialogs::mp_connect::selection::relative_index(), set_owner(), and gui2::dialogs::mp_connect::selection::user_defined().
|
private |
The formula to determine whether the size is good.
Definition at line 542 of file window.hpp.
Referenced by layout().
|
private |
The internal render buffer used by render() and expose().
Definition at line 163 of file window.hpp.
|
private |
Definition at line 482 of file window.hpp.
Referenced by get_retval(), and set_retval().
|
private |
The mode in which the window is shown.
This is used to determine whether or not to remove the tip.
Definition at line 479 of file window.hpp.
Referenced by mode().
|
private |
|
private |
List of widgets in the tabbing order.
Definition at line 606 of file window.hpp.
Referenced by add_to_tab_order(), and signal_handler_sdl_key_down().
|
private |
The settings for the tooltip.
Definition at line 548 of file window.hpp.
Referenced by signal_handler_message_show_tooltip().
|
private |
The variables of the canvas.
Definition at line 496 of file window.hpp.
Referenced by layout(), and set_variable().
|
private |
Sets the vertical placement.
Only used if automatic_placement_ is true. The value should be a grid placement flag.
Definition at line 521 of file window.hpp.
Referenced by layout().
|
private |
The formula to calculate the width of the dialog.
Definition at line 536 of file window.hpp.
Referenced by layout().
|
private |
The formula to calculate the x value of the dialog.
Definition at line 530 of file window.hpp.
Referenced by layout().
|
private |
The formula to calculate the y value of the dialog.
Definition at line 533 of file window.hpp.
Referenced by layout().