The Battle for Wesnoth  1.19.1+dev
Public Member Functions | Private Attributes | List of all members
gui2::round_rectangle_shape Class Reference

#include <canvas_private.hpp>

Inheritance diagram for gui2::round_rectangle_shape:

Public Member Functions

 round_rectangle_shape (const config &cfg)
 Constructor. More...
 
void draw (wfl::map_formula_callable &variables) override
 Draws the canvas. More...
 
- Public Member Functions inherited from gui2::canvas::shape
 shape (const config &cfg)
 
virtual ~shape ()
 
bool immutable () const
 

Private Attributes

typed_formula< int > r_
 The radius of the corners. More...
 
int border_thickness_
 Border thickness. More...
 
typed_formula< color_tborder_color_
 The border color of the rounded rectangle. More...
 
typed_formula< color_tfill_color_
 The border color of the rounded rectangle. More...
 

Additional Inherited Members

- Protected Member Functions inherited from gui2::rect_bounded_shape
 rect_bounded_shape (const config &cfg)
 Constructor. More...
 
- Protected Attributes inherited from gui2::rect_bounded_shape
typed_formula< int > x_
 The x coordinate of the rectangle. More...
 
typed_formula< int > y_
 The y coordinate of the rectangle. More...
 
typed_formula< int > w_
 The width of the rectangle. More...
 
typed_formula< int > h_
 The height of the rectangle. More...
 

Detailed Description

Definition at line 111 of file canvas_private.hpp.

Constructor & Destructor Documentation

◆ round_rectangle_shape()

gui2::round_rectangle_shape::round_rectangle_shape ( const config cfg)
explicit

Constructor.

Parameters
cfgThe config object to define the round rectangle.

Definition at line 148 of file canvas.cpp.

References border_color_, border_thickness_, DBG_GUI_P, debug, and gui2::typed_formula< T >::has_formula().

Member Function Documentation

◆ draw()

void gui2::round_rectangle_shape::draw ( wfl::map_formula_callable variables)
overridevirtual

Draws the canvas.

Parameters
variablesThe canvas can have formulas in it's definition, this parameter contains the values for these formulas.

Implements gui2::canvas::shape.

Definition at line 166 of file canvas.cpp.

References border_color_, border_thickness_, draw::circle(), DBG_GUI_D, draw::disc(), draw::fill(), fill_color_, h, gui2::rect_bounded_shape::h_, i, draw::line(), color_t::null(), r_, draw::set_color(), w, gui2::rect_bounded_shape::w_, gui2::rect_bounded_shape::x_, and gui2::rect_bounded_shape::y_.

Member Data Documentation

◆ border_color_

typed_formula<color_t> gui2::round_rectangle_shape::border_color_
private

The border color of the rounded rectangle.

If the color is fully transparent the border isn't drawn.

Definition at line 138 of file canvas_private.hpp.

Referenced by draw(), and round_rectangle_shape().

◆ border_thickness_

int gui2::round_rectangle_shape::border_thickness_
private

Border thickness.

If 0 the fill color is used for the entire widget.

Definition at line 131 of file canvas_private.hpp.

Referenced by draw(), and round_rectangle_shape().

◆ fill_color_

typed_formula<color_t> gui2::round_rectangle_shape::fill_color_
private

The border color of the rounded rectangle.

If the color is fully transparent the rounded rectangle won't be filled.

Definition at line 145 of file canvas_private.hpp.

Referenced by draw().

◆ r_

typed_formula<int> gui2::round_rectangle_shape::r_
private

The radius of the corners.

Definition at line 124 of file canvas_private.hpp.

Referenced by draw().


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