The Battle for Wesnoth  1.17.10+dev
Classes | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
gui::dialog_frame Class Reference

#include <show_dialog.hpp>

Inheritance diagram for gui::dialog_frame:

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 &region) 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 styledialog_style_
 
std::vector< button * > * buttons_
 
buttonhelp_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_drawableoperator= (const top_level_drawable &)
 
 top_level_drawable (top_level_drawable &&)
 
top_level_drawableoperator= (top_level_drawable &&)
 

Detailed Description

Definition at line 52 of file show_dialog.hpp.

Constructor & Destructor Documentation

◆ dialog_frame()

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 85 of file show_dialog.cpp.

References b, buttons_, help_button_, and draw_manager::raise_drawable().

◆ ~dialog_frame()

gui::dialog_frame::~dialog_frame ( )

Definition at line 115 of file show_dialog.cpp.

References draw_manager::invalidate_region(), and screen_location().

Member Function Documentation

◆ bottom_padding()

int gui::dialog_frame::bottom_padding ( ) const

Definition at line 146 of file show_dialog.cpp.

References b, bot_, buttons_, gui::ButtonVPadding, texture::h(), and have_border_.

◆ clear_background()

void gui::dialog_frame::clear_background ( )
private

◆ draw()

void gui::dialog_frame::draw ( )

Definition at line 326 of file show_dialog.cpp.

References draw_background(), draw_border(), draw_title(), and title_.

Referenced by expose().

◆ draw_background()

void gui::dialog_frame::draw_background ( )

◆ draw_border()

void gui::dialog_frame::draw_border ( )

◆ draw_title()

rect gui::dialog_frame::draw_title ( bool  actually_draw)

◆ expose()

bool gui::dialog_frame::expose ( const rect region)
overridevirtual

Called by draw_manager when it believes a redraw is necessary.

Implements gui2::top_level_drawable.

Definition at line 366 of file show_dialog.cpp.

References DBG_DP, and draw().

◆ get_layout()

dimension_measurements gui::dialog_frame::get_layout ( ) const
inline

Definition at line 78 of file show_dialog.hpp.

References draw_manager::expose(), and draw_manager::layout().

◆ layout() [1/3]

dialog_frame::dimension_measurements gui::dialog_frame::layout ( int  x,
int  y,
int  w,
int  h 
)

◆ layout() [2/3]

dialog_frame::dimension_measurements gui::dialog_frame::layout ( const SDL_Rect &  frame_area)

Definition at line 124 of file show_dialog.cpp.

References layout().

◆ layout() [3/3]

void gui::dialog_frame::layout ( )
overridevirtual

◆ screen_location()

rect gui::dialog_frame::screen_location ( )
overridevirtual

The current draw location of the window, on the screen.

Implements gui2::top_level_drawable.

Definition at line 374 of file show_dialog.cpp.

References dim_, and gui::dialog_frame::dimension_measurements::exterior.

Referenced by ~dialog_frame().

◆ set_dirty()

void gui::dialog_frame::set_dirty ( bool  dirty = true)

Definition at line 141 of file show_dialog.cpp.

References dirty_.

◆ set_layout()

void gui::dialog_frame::set_layout ( dimension_measurements new_dim)
inline

Definition at line 77 of file show_dialog.hpp.

◆ top_padding()

int gui::dialog_frame::top_padding ( ) const

Member Data Documentation

◆ auto_restore_

bool gui::dialog_frame::auto_restore_
private

Definition at line 110 of file show_dialog.hpp.

◆ bg_

texture gui::dialog_frame::bg_
private

Definition at line 112 of file show_dialog.hpp.

Referenced by draw_background().

◆ bot_

texture gui::dialog_frame::bot_
private

Definition at line 112 of file show_dialog.hpp.

Referenced by bottom_padding(), draw_border(), and layout().

◆ bot_left_

texture gui::dialog_frame::bot_left_
private

Definition at line 112 of file show_dialog.hpp.

Referenced by draw_border().

◆ bot_right_

texture gui::dialog_frame::bot_right_
private

Definition at line 112 of file show_dialog.hpp.

Referenced by draw_border().

◆ buttons_

std::vector<button*>* gui::dialog_frame::buttons_
private

Definition at line 108 of file show_dialog.hpp.

Referenced by bottom_padding(), dialog_frame(), and layout().

◆ default_style

const dialog_frame::style gui::dialog_frame::default_style
static

Definition at line 67 of file show_dialog.hpp.

Referenced by help::show_with_toplevel().

◆ dialog_style_

const style& gui::dialog_frame::dialog_style_
private

Definition at line 107 of file show_dialog.hpp.

Referenced by draw_background().

◆ dim_

dimension_measurements gui::dialog_frame::dim_
private

Definition at line 111 of file show_dialog.hpp.

Referenced by draw_background(), draw_border(), draw_title(), layout(), and screen_location().

◆ dirty_

bool gui::dialog_frame::dirty_
private

Definition at line 114 of file show_dialog.hpp.

Referenced by layout(), and set_dirty().

◆ have_border_

bool gui::dialog_frame::have_border_
private

Definition at line 113 of file show_dialog.hpp.

Referenced by bottom_padding(), draw_border(), layout(), and top_padding().

◆ help_button_

button* gui::dialog_frame::help_button_
private

Definition at line 109 of file show_dialog.hpp.

Referenced by dialog_frame(), and layout().

◆ left_

texture gui::dialog_frame::left_
private

Definition at line 112 of file show_dialog.hpp.

Referenced by draw_border(), and layout().

◆ right_

texture gui::dialog_frame::right_
private

Definition at line 112 of file show_dialog.hpp.

Referenced by draw_border(), and layout().

◆ title_

std::string gui::dialog_frame::title_
private

Definition at line 106 of file show_dialog.hpp.

Referenced by draw(), draw_title(), layout(), and top_padding().

◆ title_border_h

const int gui::dialog_frame::title_border_h = 5
static

Definition at line 66 of file show_dialog.hpp.

Referenced by layout(), and top_padding().

◆ title_border_w

const int gui::dialog_frame::title_border_w = 10
static

Definition at line 66 of file show_dialog.hpp.

Referenced by layout().

◆ top_

texture gui::dialog_frame::top_
private

Definition at line 112 of file show_dialog.hpp.

Referenced by draw_border(), layout(), and top_padding().

◆ top_left_

texture gui::dialog_frame::top_left_
private

Definition at line 112 of file show_dialog.hpp.

Referenced by draw_border().

◆ top_right_

texture gui::dialog_frame::top_right_
private

Definition at line 112 of file show_dialog.hpp.

Referenced by draw_border().


The documentation for this class was generated from the following files: