Crazy Eddie's GUI System
0.8.6
|
Class that represents a simple 'link' to an ImagerySection. More...
Public Member Functions | |
SectionSpecification (const String &owner, const String §ionName, const String &controlPropertySource, const String &controlPropertyValue, const String &controlPropertyWidget) | |
Constructor. More... | |
SectionSpecification (const String &owner, const String §ionName, const String &controlPropertySource, const String &controlPropertyValue, const String &controlPropertyWidget, const ColourRect &cols) | |
Constructor. More... | |
void | render (Window &srcWindow, const ColourRect *modcols=0, const Rectf *clipper=0, bool clipToDisplay=false) const |
Render the section specified by this SectionSpecification. More... | |
void | render (Window &srcWindow, const Rectf &baseRect, const ColourRect *modcols=0, const Rectf *clipper=0, bool clipToDisplay=false) const |
Render the section specified by this SectionSpecification. More... | |
const String & | getOwnerWidgetLookFeel () const |
Return the name of the WidgetLookFeel object containing the target section. More... | |
void | setOwnerWidgetLookFeel (const String &owner) |
Return the name of the WidgetLookFeel object containing the target section. More... | |
const String & | getSectionName () const |
Return the name of the target ImagerySection. More... | |
void | setSectionName (const String &name) |
Return the name of the target ImagerySection. More... | |
const ColourRect & | getOverrideColours () const |
Return the current override colours. More... | |
void | setOverrideColours (const ColourRect &cols) |
Set the override colours to be used by this SectionSpecification. More... | |
bool | isUsingOverrideColours () const |
return whether the use of override colours is enabled on this SectionSpecification. More... | |
void | setUsingOverrideColours (bool setting=true) |
Enable or disable the use of override colours for this section. More... | |
const String & | getOverrideColoursPropertySource () const |
Get the name of the property where override colour values can be obtained. More... | |
void | setOverrideColoursPropertySource (const String &property) |
Set the name of the property where override colour values can be obtained. More... | |
const String & | getRenderControlPropertySource () const |
Get the name of the property that controls whether to actually render this section. More... | |
void | setRenderControlPropertySource (const String &property) |
Set the name of the property that controls whether to actually render this section. More... | |
const String & | getRenderControlValue () const |
Get the test value used when determining whether to render this section. More... | |
void | setRenderControlValue (const String &value) |
Set the test value used when determining whether to render this section. More... | |
const String & | getRenderControlWidget () const |
Get the widget what will be used as the source of the property named as the control property. More... | |
void | setRenderControlWidget (const String &widget) |
Set the widget what will be used as the source of the property named as the control property. More... | |
void | writeXMLToStream (XMLSerializer &xml_stream) const |
Writes an xml representation of this SectionSpecification to out_stream. More... | |
Protected Member Functions | |
void | initColourRectForOverride (const Window &wnd, ColourRect &cr) const |
Helper method to initialise a ColourRect with appropriate values according to the way the section sepcification is set up. More... | |
bool | shouldBeDrawn (const Window &wnd) const |
Class that represents a simple 'link' to an ImagerySection.
This class enables sections to be easily re-used, by different states and/or layers, by allowing sections to be specified by name rather than having mutiple copies of the same thing all over the place.
CEGUI::SectionSpecification::SectionSpecification | ( | const String & | owner, |
const String & | sectionName, | ||
const String & | controlPropertySource, | ||
const String & | controlPropertyValue, | ||
const String & | controlPropertyWidget | ||
) |
Constructor.
owner | String holding the name of the WidgetLookFeel object that contains the target section. |
sectionName | String holding the name of the target section. |
controlPropertySource | String holding the name of a property that will control whether rendering for this secion will actually occur or not. |
controlPropertyValue | String holding the value to be tested for from the property named in controlPropertySource. If this is empty, then controlPropertySource will be accessed as a boolean property, otherwise rendering will only occur when the value returned via controlPropertySource matches the value specified here. |
controlPropertyWidget | String holding either a child widget name or the special value of 'parent' indicating the window upon which the property named in controlPropertySource should be accessed. If this is empty then the window itself is used as the source, rather than a child or the parent. |
CEGUI::SectionSpecification::SectionSpecification | ( | const String & | owner, |
const String & | sectionName, | ||
const String & | controlPropertySource, | ||
const String & | controlPropertyValue, | ||
const String & | controlPropertyWidget, | ||
const ColourRect & | cols | ||
) |
Constructor.
owner | String holding the name of the WidgetLookFeel object that contains the target section. |
sectionName | String holding the name of the target section. |
controlPropertySource | String holding the name of a property that will control whether rendering for this secion will actually occur or not. |
controlPropertyValue | String holding the value to be tested for from the property named in controlPropertySource. If this is empty, then controlPropertySource will be accessed as a boolean property, otherwise rendering will only occur when the value returned via controlPropertySource matches the value specified here. |
controlPropertyWidget | String holding either a child widget name or the special value of 'parent' indicating the window upon which the property named in controlPropertySource should be accessed. If this is empty then the window itself is used as the source, rather than a child or the parent. |
cols | Override colours to be used (modulates sections master colours). |
const ColourRect& CEGUI::SectionSpecification::getOverrideColours | ( | ) | const |
Return the current override colours.
const String& CEGUI::SectionSpecification::getOverrideColoursPropertySource | ( | ) | const |
Get the name of the property where override colour values can be obtained.
const String& CEGUI::SectionSpecification::getOwnerWidgetLookFeel | ( | ) | const |
Return the name of the WidgetLookFeel object containing the target section.
const String& CEGUI::SectionSpecification::getRenderControlPropertySource | ( | ) | const |
Get the name of the property that controls whether to actually render this section.
const String& CEGUI::SectionSpecification::getRenderControlValue | ( | ) | const |
Get the test value used when determining whether to render this section.
The value set here will be compared to the current value of the property named as the render control property, if they match the secion will be drawn, otherwise the section will not be drawn. If this value is set to the empty string, the control property will instead be treated as a boolean property.
const String& CEGUI::SectionSpecification::getRenderControlWidget | ( | ) | const |
Get the widget what will be used as the source of the property named as the control property.
The value of this setting will be interpreted as follows:
const String& CEGUI::SectionSpecification::getSectionName | ( | ) | const |
Return the name of the target ImagerySection.
|
protected |
Helper method to initialise a ColourRect with appropriate values according to the way the section sepcification is set up.
This will try and get values from multiple places:
bool CEGUI::SectionSpecification::isUsingOverrideColours | ( | ) | const |
return whether the use of override colours is enabled on this SectionSpecification.
void CEGUI::SectionSpecification::render | ( | Window & | srcWindow, |
const ColourRect * | modcols = 0 , |
||
const Rectf * | clipper = 0 , |
||
bool | clipToDisplay = false |
||
) | const |
Render the section specified by this SectionSpecification.
void CEGUI::SectionSpecification::render | ( | Window & | srcWindow, |
const Rectf & | baseRect, | ||
const ColourRect * | modcols = 0 , |
||
const Rectf * | clipper = 0 , |
||
bool | clipToDisplay = false |
||
) | const |
Render the section specified by this SectionSpecification.
srcWindow | Window object to be used when calculating pixel values from BaseDim values. |
baseRect | Rect object to be used when calculating pixel values from BaseDim values. |
void CEGUI::SectionSpecification::setOverrideColours | ( | const ColourRect & | cols | ) |
Set the override colours to be used by this SectionSpecification.
cols | ColourRect describing the override colours to set for this SectionSpecification. |
void CEGUI::SectionSpecification::setOverrideColoursPropertySource | ( | const String & | property | ) |
Set the name of the property where override colour values can be obtained.
property | String containing the name of the property. |
void CEGUI::SectionSpecification::setOwnerWidgetLookFeel | ( | const String & | owner | ) |
Return the name of the WidgetLookFeel object containing the target section.
name | String object holding the name of the WidgetLookFeel that contains the target ImagerySection. |
void CEGUI::SectionSpecification::setRenderControlPropertySource | ( | const String & | property | ) |
Set the name of the property that controls whether to actually render this section.
property | String containing the name of the property. |
void CEGUI::SectionSpecification::setRenderControlValue | ( | const String & | value | ) |
Set the test value used when determining whether to render this section.
The value set here will be compared to the current value of the property named as the render control property, if they match the secion will be drawn, otherwise the section will not be drawn. If this value is set to the empty string, the control property will instead be treated as a boolean property.
void CEGUI::SectionSpecification::setRenderControlWidget | ( | const String & | widget | ) |
Set the widget what will be used as the source of the property named as the control property.
The value of this setting will be interpreted as follows:
void CEGUI::SectionSpecification::setSectionName | ( | const String & | name | ) |
Return the name of the target ImagerySection.
name | String object holding the name of the target ImagerySection. |
void CEGUI::SectionSpecification::setUsingOverrideColours | ( | bool | setting = true | ) |
Enable or disable the use of override colours for this section.
setting |
|
|
protected |
return whether the section should be drawn, based upon the render control property and associated items.
void CEGUI::SectionSpecification::writeXMLToStream | ( | XMLSerializer & | xml_stream | ) | const |
Writes an xml representation of this SectionSpecification to out_stream.
xml_stream | Stream where xml data should be output. |