#include <show_dialog.hpp>
Classes | |
struct | dimension_measurements |
class | style |
Public Member Functions | |
dialog_frame (CVideo &video, const std::string &title="", const style &dialog_style=default_style, bool auto_restore=true, std::vector< button * > *buttons=nullptr, button *help_button=nullptr) | |
~dialog_frame () | |
dimension_measurements | layout (int x, int y, int w, int h) |
dimension_measurements | layout (SDL_Rect const &frame_area) |
void | set_layout (dimension_measurements &new_dim) |
dimension_measurements | get_layout () const |
int | top_padding () const |
int | bottom_padding () const |
void | draw () |
void | draw_border () |
void | draw_background () |
SDL_Rect | draw_title (CVideo *video) |
void | set_dirty (bool dirty=true) |
virtual void | handle_event (const SDL_Event &) |
void | handle_window_event (const SDL_Event &event) |
Public Member Functions inherited from events::sdl_handler | |
virtual void | process_event () |
virtual void | volatile_draw () |
virtual void | volatile_undraw () |
virtual bool | requires_event_focus (const SDL_Event *=nullptr) const |
virtual void | process_help_string (int, int) |
virtual void | process_tooltip_string (int, int) |
virtual void | join () |
virtual void | join (context &c) |
virtual void | join_same (sdl_handler *parent) |
virtual void | leave () |
virtual void | join_global () |
virtual void | leave_global () |
Static Public Attributes | |
static const int | title_border_w = 10 |
static const int | title_border_h = 5 |
static const style | default_style |
static const style | message_style |
static const style | preview_style |
static const style | titlescreen_style |
Private Member Functions | |
void | clear_background () |
Private Attributes | |
std::string | title_ |
CVideo & | video_ |
const style & | dialog_style_ |
std::vector< button * > * | buttons_ |
button * | help_button_ |
surface_restorer * | restorer_ |
bool | auto_restore_ |
dimension_measurements | dim_ |
surface | top_ |
surface | bot_ |
surface | left_ |
surface | right_ |
surface | top_left_ |
surface | bot_left_ |
surface | top_right_ |
surface | bot_right_ |
surface | bg_ |
bool | have_border_ |
bool | dirty_ |
Additional Inherited Members | |
Protected Member Functions inherited from video2::draw_layering | |
draw_layering (const bool auto_join=true) | |
virtual | ~draw_layering () |
Protected Member Functions inherited from events::sdl_handler | |
sdl_handler (const bool auto_join=true) | |
virtual | ~sdl_handler () |
virtual std::vector < sdl_handler * > | handler_members () |
Definition at line 54 of file show_dialog.hpp.
gui::dialog_frame::dialog_frame | ( | CVideo & | video, |
const std::string & | title = "" , |
||
const style & | dialog_style = default_style , |
||
bool | auto_restore = true , |
||
std::vector< button * > * | buttons = nullptr , |
||
button * | help_button = nullptr |
||
) |
Definition at line 82 of file show_dialog.cpp.
gui::dialog_frame::~dialog_frame | ( | ) |
Definition at line 120 of file show_dialog.cpp.
References restorer_.
int gui::dialog_frame::bottom_padding | ( | ) | const |
Definition at line 182 of file show_dialog.cpp.
References bot_, buttons_, gui::ButtonVPadding, and have_border_.
Referenced by gui::dialog::layout().
|
private |
Definition at line 350 of file show_dialog.cpp.
References restorer_.
Referenced by draw_background().
|
virtual |
Reimplemented from events::sdl_handler.
Definition at line 412 of file show_dialog.cpp.
References gui::dialog_frame::dimension_measurements::button_row, gui::ButtonHPadding, buttons_, dim_, dirty_, draw_background(), draw_border(), draw_title(), help_button_, gui::dialog_frame::dimension_measurements::interior, gui::widget::set_location(), title_, and video_.
Referenced by gui::dialog::draw_frame(), handle_event(), help::show_help(), and default_map_generator::user_config().
void gui::dialog_frame::draw_background | ( | ) |
Definition at line 356 of file show_dialog.cpp.
References auto_restore_, bg_, gui::dialog_frame::style::blur_radius, blur_surface(), clear_background(), dialog_style_, dim_, ERR_DP, gui::dialog_frame::dimension_measurements::exterior, get_surface_portion(), CVideo::getSurface(), i, gui::dialog_frame::dimension_measurements::interior, surface::null(), gui::dialog_frame::style::panel, restorer_, sdl_blit(), surf, and video_.
Referenced by draw(), about::show_about(), and hotkey::show_binding_dialog().
void gui::dialog_frame::draw_border | ( | ) |
Definition at line 285 of file show_dialog.cpp.
References CVideo::blit_surface(), bot_, bot_left_, bot_right_, dim_, gui::dialog_frame::dimension_measurements::exterior, have_border_, gui::dialog_frame::dimension_measurements::interior, left_, surface::null(), right_, scale_surface(), top_, top_left_, top_right_, update_rect(), and video_.
Referenced by draw(), about::show_about(), and hotkey::show_binding_dialog().
SDL_Rect gui::dialog_frame::draw_title | ( | CVideo * | video | ) |
Definition at line 405 of file show_dialog.cpp.
References dim_, font::draw_text(), screen_area(), font::SIZE_TITLE, gui::dialog_frame::dimension_measurements::title, title_, and font::TITLE_COLOR.
|
inline |
Definition at line 83 of file show_dialog.hpp.
References dim_.
|
virtual |
Implements events::sdl_handler.
Definition at line 165 of file show_dialog.cpp.
References buttons_, draw(), DRAW_ALL_EVENT, DRAW_EVENT, and set_dirty().
|
virtual |
Implements events::sdl_handler.
Definition at line 152 of file show_dialog.cpp.
References set_dirty().
dialog_frame::dimension_measurements gui::dialog_frame::layout | ( | int | x, |
int | y, | ||
int | w, | ||
int | h | ||
) |
Definition at line 199 of file show_dialog.cpp.
References bot_, gui::dialog_frame::dimension_measurements::button_row, gui::ButtonHPadding, buttons_, gui::ButtonVPadding, dim_, draw_title(), gui::dialog_frame::dimension_measurements::exterior, h, have_border_, help_button_, int(), gui::dialog_frame::dimension_measurements::interior, left_, right_, screen_area(), gui::dialog_frame::dimension_measurements::title, title_, title_border_h, title_border_w, top_, and gui::widget::width().
Referenced by layout(), gui::dialog::set_layout(), about::show_about(), hotkey::show_binding_dialog(), help::show_help(), and default_map_generator::user_config().
dialog_frame::dimension_measurements gui::dialog_frame::layout | ( | SDL_Rect const & | frame_area | ) |
Definition at line 129 of file show_dialog.cpp.
References layout().
void gui::dialog_frame::set_dirty | ( | bool | dirty = true | ) |
Definition at line 148 of file show_dialog.cpp.
References dirty_.
Referenced by handle_event(), and handle_window_event().
|
inline |
Definition at line 82 of file show_dialog.hpp.
References dim_.
int gui::dialog_frame::top_padding | ( | ) | const |
Definition at line 133 of file show_dialog.cpp.
References font::get_max_height(), have_border_, font::SIZE_TITLE, title_, title_border_h, and top_.
Referenced by gui::dialog::layout().
|
private |
Definition at line 111 of file show_dialog.hpp.
Referenced by draw_background().
|
private |
Definition at line 116 of file show_dialog.hpp.
Referenced by draw_background().
|
private |
Definition at line 116 of file show_dialog.hpp.
Referenced by bottom_padding(), draw_border(), and layout().
|
private |
Definition at line 116 of file show_dialog.hpp.
Referenced by draw_border().
|
private |
Definition at line 116 of file show_dialog.hpp.
Referenced by draw_border().
|
private |
Definition at line 108 of file show_dialog.hpp.
Referenced by bottom_padding(), draw(), handle_event(), and layout().
|
static |
Definition at line 69 of file show_dialog.hpp.
Referenced by help::show_help(), and default_map_generator::user_config().
|
private |
Definition at line 107 of file show_dialog.hpp.
Referenced by draw_background().
|
private |
Definition at line 112 of file show_dialog.hpp.
Referenced by draw(), draw_background(), draw_border(), draw_title(), get_layout(), layout(), and set_layout().
|
private |
Definition at line 119 of file show_dialog.hpp.
Referenced by draw(), and set_dirty().
|
private |
Definition at line 118 of file show_dialog.hpp.
Referenced by bottom_padding(), draw_border(), layout(), and top_padding().
|
private |
Definition at line 109 of file show_dialog.hpp.
|
private |
Definition at line 116 of file show_dialog.hpp.
Referenced by draw_border(), and layout().
|
static |
Definition at line 70 of file show_dialog.hpp.
|
static |
Definition at line 71 of file show_dialog.hpp.
|
private |
Definition at line 110 of file show_dialog.hpp.
Referenced by clear_background(), draw_background(), and ~dialog_frame().
|
private |
Definition at line 116 of file show_dialog.hpp.
Referenced by draw_border(), and layout().
|
private |
Definition at line 105 of file show_dialog.hpp.
Referenced by draw(), draw_title(), layout(), and top_padding().
|
static |
Definition at line 68 of file show_dialog.hpp.
Referenced by layout(), and top_padding().
|
static |
Definition at line 68 of file show_dialog.hpp.
Referenced by layout().
|
static |
Definition at line 72 of file show_dialog.hpp.
Referenced by about::show_about().
|
private |
Definition at line 116 of file show_dialog.hpp.
Referenced by draw_border(), layout(), and top_padding().
|
private |
Definition at line 116 of file show_dialog.hpp.
Referenced by draw_border().
|
private |
Definition at line 116 of file show_dialog.hpp.
Referenced by draw_border().
|
private |
Definition at line 106 of file show_dialog.hpp.
Referenced by draw(), draw_background(), and draw_border().