IMS2  Pre-Alpha
An Orbiter add-on to allow on-runtime construction of spacecraft from predefined modules
GUI_ElementStyle Class Reference

Defines the appearance of a GUI_BaseElement or one of its subclasses. More...

Public Member Functions

 GUI_ElementStyle (GUI_ElementStyle *inherit_from)
 
void Set (STYLE_PROPERTIES field, string value)
 General setter for properties that takes a string containing the value. More...
 
void SetFont (GUI_font *font)
 Sets the font to be used for this style. More...
 
void SetColor (GUI_COLOR color)
 Sets the border color of the style. More...
 
void SetBgColor (GUI_COLOR color)
 Sets the background color of the style. More...
 
void SetHilightColor (GUI_COLOR color)
 Sets the highlight color of the style. More...
 
void SetFillColor (GUI_COLOR color)
 Sets the fill color of the style. More...
 
void SetMarginTop (int margin)
 Sets the top margin in pixel. More...
 
void SetMarginBottom (int margin)
 Sets the bottom margin in pixel. More...
 
void SetMarginLeft (int margin)
 Sets the left margin in pixel. More...
 
void SetMarginRight (int margin)
 Sets the right margin in pixel. More...
 
void SetCornerRadius (int radius)
 Sets the corner radius in pixel. More...
 
GUI_fontGetFont ()
 
DWORD GetCorners ()
 
int LineWidth ()
 
int CornerRadius ()
 
GUI_COLOR Color ()
 
GUI_COLOR BackgroundColor ()
 
GUI_COLOR HilightColor ()
 
GUI_COLOR FillColor ()
 
int MarginTop ()
 
int MarginBottom ()
 
int MarginLeft ()
 
int MarginRight ()
 

Private Attributes

GUI_font_font = NULL
 Pointer to the font that will be used for text output by an element using this style.
 
GUI_COLOR _color
 Line drawing color.
 
GUI_COLOR _hilightcolor
 The color the element should be filled with when highlighted.
 
GUI_COLOR _bgcolor
 The background color the element IS DRAWN UPPON (not the color the element is drawn in, like for example in css)
 
GUI_COLOR _fillcolor
 The color the element should be filled with.
 
int _linewidth = 1
 Width of drawn lines (usually the borders) in pixel.
 
int _cornerradius = 0
 Corner radius, in pixel.
 
DWORD _roundcorners = CORNERS::ALL
 Bitmask to define which corners are rounded.
 
int _margin_top = 5
 Top margin in pixel.
 
int _margin_bottom = 5
 Bottom margin in pixel.
 
int _margin_left = 5
 Left margin in pixel.
 
int _margin_right = 5
 Right margin in pixel.
 

Friends

class GUI_Draw
 

Detailed Description

Defines the appearance of a GUI_BaseElement or one of its subclasses.

Constructor & Destructor Documentation

GUI_ElementStyle::GUI_ElementStyle ( GUI_ElementStyle inherit_from)
Parameters
inherit_fromA parent style that serves as a default configuration for all properties of this style

Member Function Documentation

GUI_COLOR GUI_ElementStyle::BackgroundColor ( )
inline
Returns
The background color of this style
Note
Not to be confused with the fill color!
See also
STYLE_PROPERTIES
GUI_COLOR GUI_ElementStyle::Color ( )
inline
Returns
The line color of this style
int GUI_ElementStyle::CornerRadius ( )
inline
Returns
The corner radius of the style, in pixel
GUI_COLOR GUI_ElementStyle::FillColor ( )
inline
Returns
The fill color of this style
DWORD GUI_ElementStyle::GetCorners ( )
Returns
A bitmask defining which corners of the element should be rounded
See also
CORNERS
GUI_font * GUI_ElementStyle::GetFont ( )
Returns
The font belonging to this style
GUI_COLOR GUI_ElementStyle::HilightColor ( )
inline
Returns
the hilight color of this style
int GUI_ElementStyle::LineWidth ( )
inline
Returns
THe line width of the style, in pixel
int GUI_ElementStyle::MarginBottom ( )
inline
Returns
the bottom margin in pixel
int GUI_ElementStyle::MarginLeft ( )
inline
Returns
the left margin in pixel
int GUI_ElementStyle::MarginRight ( )
inline
Returns
the right margin in pixel
int GUI_ElementStyle::MarginTop ( )
inline
Returns
the top margin in pixel
void GUI_ElementStyle::Set ( STYLE_PROPERTIES  field,
string  value 
)

General setter for properties that takes a string containing the value.

Parameters
fieldThe property to set
valueThe value for the property as a string. Formatting depends on the property being set
void GUI_ElementStyle::SetBgColor ( GUI_COLOR  color)
inline

Sets the background color of the style.

Parameters
colorThe desired color
See also
STYLE_PROPERTIES
void GUI_ElementStyle::SetColor ( GUI_COLOR  color)
inline

Sets the border color of the style.

Parameters
colorThe desired color
See also
STYLE_PROPERTIES
void GUI_ElementStyle::SetCornerRadius ( int  radius)
inline

Sets the corner radius in pixel.

Parameters
radiusthe radius by which designated corners will be rounded
See also
STYLE_PROPERTIES
void GUI_ElementStyle::SetFillColor ( GUI_COLOR  color)
inline

Sets the fill color of the style.

Parameters
colorThe desired color
See also
STYLE_PROPERTIES
void GUI_ElementStyle::SetFont ( GUI_font font)

Sets the font to be used for this style.

Parameters
fontA pointer to an already created font that will be used to print any text in the element
void GUI_ElementStyle::SetHilightColor ( GUI_COLOR  color)
inline

Sets the highlight color of the style.

Parameters
colorThe desired color
See also
STYLE_PROPERTIES
void GUI_ElementStyle::SetMarginBottom ( int  margin)
inline

Sets the bottom margin in pixel.

Parameters
marginThe margin on which children cannot draw, from the bottom of the element
See also
STYLE_PROPERTIES
void GUI_ElementStyle::SetMarginLeft ( int  margin)
inline

Sets the left margin in pixel.

Parameters
marginThe margin on which children cannot draw, from the left edge of the element
See also
STYLE_PROPERTIES
void GUI_ElementStyle::SetMarginRight ( int  margin)
inline

Sets the right margin in pixel.

Parameters
marginThe margin on which children cannot draw, from the right edge of the element
See also
STYLE_PROPERTIES
void GUI_ElementStyle::SetMarginTop ( int  margin)
inline

Sets the top margin in pixel.

Parameters
marginThe margin on which children cannot draw, from the top of the element
See also
STYLE_PROPERTIES

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