#include <show_dialog.hpp>
Classes | |
struct | dimension_measurements |
class | style |
Public Member Functions | |
dialog_frame (const std::string &title="", const style &dialog_style=default_style, 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 (const SDL_Rect &frame_area) |
void | set_layout (dimension_measurements &new_dim) |
dimension_measurements | get_layout () const |
int | top_padding () const |
int | bottom_padding () const |
void | draw () |
virtual void | layout () override |
Called by draw_manager to validate layout. 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 | draw_border () |
void | draw_background () |
rect | draw_title (bool actually_draw) |
void | set_dirty (bool dirty=true) |
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... | |
virtual void | render () |
Perform any internal rendering necessary to prepare the drawable. More... | |
Static Public Attributes | |
static const int | title_border_w = 10 |
static const int | title_border_h = 5 |
static const style | default_style |
Private Member Functions | |
void | clear_background () |
Private Attributes | |
std::string | title_ |
const style & | dialog_style_ |
std::vector< button * > * | buttons_ |
button * | help_button_ |
bool | auto_restore_ |
dimension_measurements | dim_ |
texture | top_ |
texture | bot_ |
texture | left_ |
texture | right_ |
texture | top_left_ |
texture | bot_left_ |
texture | top_right_ |
texture | bot_right_ |
texture | bg_ |
bool | have_border_ |
bool | dirty_ |
Additional Inherited Members | |
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 &&) |
Definition at line 50 of file show_dialog.hpp.
gui::dialog_frame::dialog_frame | ( | const std::string & | title = "" , |
const style & | dialog_style = default_style , |
||
std::vector< button * > * | buttons = nullptr , |
||
button * | help_button = nullptr |
||
) |
Definition at line 81 of file show_dialog.cpp.
References b, buttons_, help_button_, and draw_manager::raise_drawable().
gui::dialog_frame::~dialog_frame | ( | ) |
Definition at line 111 of file show_dialog.cpp.
References draw_manager::invalidate_region(), and screen_location().
int gui::dialog_frame::bottom_padding | ( | ) | const |
Definition at line 142 of file show_dialog.cpp.
References b, bot_, buttons_, gui::ButtonVPadding, texture::h(), and have_border_.
|
private |
void gui::dialog_frame::draw | ( | ) |
Definition at line 322 of file show_dialog.cpp.
References draw_background(), draw_border(), draw_title(), and title_.
Referenced by expose().
void gui::dialog_frame::draw_background | ( | ) |
Definition at line 285 of file show_dialog.cpp.
References bg_, draw::blit(), gui::dialog_frame::style::blur_radius, dialog_style_, dim_, dst, ERR_DP, texture::h(), i, gui::dialog_frame::dimension_measurements::interior, gui::dialog_frame::style::panel, draw::reduce_clip(), src, and texture::w().
Referenced by draw().
void gui::dialog_frame::draw_border | ( | ) |
Definition at line 230 of file show_dialog.cpp.
References draw::blit(), bot_, bot_left_, bot_right_, dim_, e, gui::dialog_frame::dimension_measurements::exterior, texture::h(), have_border_, i, gui::dialog_frame::dimension_measurements::interior, left_, right_, top_, top_left_, top_right_, and texture::w().
Referenced by draw().
rect gui::dialog_frame::draw_title | ( | bool | actually_draw | ) |
Definition at line 313 of file show_dialog.cpp.
References dim_, video::game_canvas(), font::pango_draw_text(), font::SIZE_TITLE, font::pango_text::STYLE_NORMAL, gui::dialog_frame::dimension_measurements::title, title_, and font::TITLE_COLOR.
|
overridevirtual |
Called by draw_manager when it believes a redraw is necessary.
Implements gui2::top_level_drawable.
Definition at line 362 of file show_dialog.cpp.
|
inline |
Definition at line 76 of file show_dialog.hpp.
References dim_.
|
overridevirtual |
Called by draw_manager to validate layout.
Reimplemented from gui2::top_level_drawable.
Definition at line 336 of file show_dialog.cpp.
References b, gui::dialog_frame::dimension_measurements::button_row, gui::ButtonHPadding, buttons_, dim_, dirty_, help_button_, gui::dialog_frame::dimension_measurements::interior, and gui::widget::set_location().
Referenced by layout().
dialog_frame::dimension_measurements gui::dialog_frame::layout | ( | const SDL_Rect & | frame_area | ) |
Definition at line 120 of file show_dialog.cpp.
References layout().
dialog_frame::dimension_measurements gui::dialog_frame::layout | ( | int | x, |
int | y, | ||
int | w, | ||
int | h | ||
) |
Definition at line 155 of file show_dialog.cpp.
References b, bot_, gui::dialog_frame::dimension_measurements::button_row, gui::ButtonHPadding, buttons_, gui::ButtonVPadding, dim_, draw_title(), gui::dialog_frame::dimension_measurements::exterior, video::game_canvas(), texture::h(), h, have_border_, help_button_, gui::dialog_frame::dimension_measurements::interior, draw_manager::invalidate_region(), left_, right_, gui::dialog_frame::dimension_measurements::title, title_, title_border_h, title_border_w, top_, w, texture::w(), and gui::widget::width().
|
overridevirtual |
The current draw location of the window, on the screen.
Implements gui2::top_level_drawable.
Definition at line 370 of file show_dialog.cpp.
References dim_, and gui::dialog_frame::dimension_measurements::exterior.
Referenced by ~dialog_frame().
void gui::dialog_frame::set_dirty | ( | bool | dirty = true | ) |
Definition at line 137 of file show_dialog.cpp.
References dirty_.
|
inline |
Definition at line 75 of file show_dialog.hpp.
References dim_.
int gui::dialog_frame::top_padding | ( | ) | const |
Definition at line 125 of file show_dialog.cpp.
References font::get_max_height(), texture::h(), have_border_, font::SIZE_TITLE, title_, title_border_h, and top_.
|
private |
Definition at line 108 of file show_dialog.hpp.
|
private |
Definition at line 110 of file show_dialog.hpp.
Referenced by draw_background().
|
private |
Definition at line 110 of file show_dialog.hpp.
Referenced by bottom_padding(), draw_border(), and layout().
|
private |
Definition at line 110 of file show_dialog.hpp.
Referenced by draw_border().
|
private |
Definition at line 110 of file show_dialog.hpp.
Referenced by draw_border().
|
private |
Definition at line 106 of file show_dialog.hpp.
Referenced by bottom_padding(), dialog_frame(), and layout().
|
static |
Definition at line 65 of file show_dialog.hpp.
|
private |
Definition at line 105 of file show_dialog.hpp.
Referenced by draw_background().
|
private |
Definition at line 109 of file show_dialog.hpp.
Referenced by draw_background(), draw_border(), draw_title(), get_layout(), layout(), screen_location(), and set_layout().
|
private |
Definition at line 112 of file show_dialog.hpp.
Referenced by layout(), and set_dirty().
|
private |
Definition at line 111 of file show_dialog.hpp.
Referenced by bottom_padding(), draw_border(), layout(), and top_padding().
|
private |
Definition at line 107 of file show_dialog.hpp.
Referenced by dialog_frame(), and layout().
|
private |
Definition at line 110 of file show_dialog.hpp.
Referenced by draw_border(), and layout().
|
private |
Definition at line 110 of file show_dialog.hpp.
Referenced by draw_border(), and layout().
|
private |
Definition at line 104 of file show_dialog.hpp.
Referenced by draw(), draw_title(), layout(), and top_padding().
|
static |
Definition at line 64 of file show_dialog.hpp.
Referenced by layout(), and top_padding().
|
static |
Definition at line 64 of file show_dialog.hpp.
Referenced by layout().
|
private |
Definition at line 110 of file show_dialog.hpp.
Referenced by draw_border(), layout(), and top_padding().
|
private |
Definition at line 110 of file show_dialog.hpp.
Referenced by draw_border().
|
private |
Definition at line 110 of file show_dialog.hpp.
Referenced by draw_border().