Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
CGUISize Class Reference

This class represents a rectangle relative to a parent rectangle The value can be initialized from a string or JS object. More...

#include <CGUISize.h>

Collaboration diagram for CGUISize:

Public Member Functions

 CGUISize ()
 
 CGUISize (const CRect &pixel, const CRect &percent)
 
CRect GetSize (const CRect &parent) const
 Get client area rectangle when the parent is given. More...
 
bool FromString (const CStr8 &Value)
 The value can be set from a string looking like: More...
 
bool operator== (const CGUISize &other) const
 
void ToJSVal (const ScriptRequest &rq, JS::MutableHandleValue ret) const
 
bool FromJSVal (const ScriptRequest &rq, JS::HandleValue v)
 

Static Public Member Functions

static CGUISize Full ()
 

Public Attributes

CRect pixel
 Pixel modifiers. More...
 
CRect percent
 Percent modifiers. More...
 

Detailed Description

This class represents a rectangle relative to a parent rectangle The value can be initialized from a string or JS object.

Constructor & Destructor Documentation

◆ CGUISize() [1/2]

CGUISize::CGUISize ( )

◆ CGUISize() [2/2]

CGUISize::CGUISize ( const CRect pixel,
const CRect percent 
)

Member Function Documentation

◆ FromJSVal()

bool CGUISize::FromJSVal ( const ScriptRequest rq,
JS::HandleValue  v 
)

◆ FromString()

bool CGUISize::FromString ( const CStr8 &  Value)

The value can be set from a string looking like:

"0 0 100% 100%" "50%-10 50%-10 50%+10 50%+10"

i.e. First percent modifier, then + or - and the pixel modifier. Although you can use just the percent or the pixel modifier. Notice though that the percent modifier must always be the first when both modifiers are inputted.

Returns
true if success, otherwise size will remain unchanged.

◆ Full()

CGUISize CGUISize::Full ( )
static

◆ GetSize()

CRect CGUISize::GetSize ( const CRect parent) const

Get client area rectangle when the parent is given.

◆ operator==()

bool CGUISize::operator== ( const CGUISize other) const
inline

◆ ToJSVal()

void CGUISize::ToJSVal ( const ScriptRequest rq,
JS::MutableHandleValue  ret 
) const

Member Data Documentation

◆ percent

CRect CGUISize::percent

Percent modifiers.

◆ pixel

CRect CGUISize::pixel

Pixel modifiers.


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