Crazy Eddie's GUI System  0.8.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
CEGUI::FrameComponent Class Reference

Class that encapsulates information for a frame with background (9 images in total) More...

+ Inheritance diagram for CEGUI::FrameComponent:
+ Collaboration diagram for CEGUI::FrameComponent:

Classes

struct  FrameImageSource
 

Public Member Functions

void setLeftEdgeFormatting (VerticalFormatting fmt)
 Set the formatting to be used for the left edge image. More...
 
void setRightEdgeFormatting (VerticalFormatting fmt)
 Set the formatting to be used for the right edge image. More...
 
void setTopEdgeFormatting (HorizontalFormatting fmt)
 Set the formatting to be used for the top edge image. More...
 
void setBottomEdgeFormatting (HorizontalFormatting fmt)
 Set the formatting to be used for the bottom edge image. More...
 
void setBackgroundVerticalFormatting (VerticalFormatting fmt)
 Set the vertical formatting to be used for the background image. More...
 
void setBackgroundHorizontalFormatting (HorizontalFormatting fmt)
 Set the horizontal formatting to be used for the background image. More...
 
void setLeftEdgeFormattingPropertySource (const String &property_name)
 Set the name of a property that will be used to obtain the formatting to use for the left edge image.
 
void setRightEdgeFormattingPropertySource (const String &property_name)
 Set the name of a property that will be used to obtain the formatting to use for the right edge image.
 
void setTopEdgeFormattingPropertySource (const String &property_name)
 Set the name of a property that will be used to obtain the formatting to use for the top edge image.
 
void setBottomEdgeFormattingPropertySource (const String &property_name)
 Set the name of a property that will be used to obtain the formatting to use for the bottom edge image.
 
void setBackgroundVerticalFormattingPropertySource (const String &property_name)
 Set the name of a property that will be used to obtain the vertical formatting to use for the backdround image.
 
void setBackgroundHorizontalFormattingPropertySource (const String &property_name)
 Set the name of a property that will be used to obtain the horizontal formatting to use for the backdround image.
 
VerticalFormatting getLeftEdgeFormatting (const Window &wnd) const
 Return the formatting to be used for the left edge image. More...
 
VerticalFormatting getRightEdgeFormatting (const Window &wnd) const
 Return the formatting to be used for the right edge image. More...
 
HorizontalFormatting getTopEdgeFormatting (const Window &wnd) const
 Return the formatting to be used for the top edge image. More...
 
HorizontalFormatting getBottomEdgeFormatting (const Window &wnd) const
 Return the formatting to be used for the bottom edge image. More...
 
VerticalFormatting getBackgroundVerticalFormatting (const Window &wnd) const
 Return the vertical formatting to be used for the background image. More...
 
HorizontalFormatting getBackgroundHorizontalFormatting (const Window &wnd) const
 Return the horizontal formatting to be used for the background image. More...
 
const ImagegetImage (FrameImageComponent part, const Window &wnd) const
 Return the Image object that will be drawn by this FrameComponent for a specified frame part. More...
 
void setImage (FrameImageComponent part, const Image *image)
 Set an Image that will be drawn by this FrameComponent. More...
 
void setImage (FrameImageComponent part, const String &name)
 Set an Image that will be drawn by this FrameComponent. More...
 
void setImagePropertySource (FrameImageComponent part, const String &name)
 Set the name of the Property that will be accesssed on the target Window to determine the Image that will be drawn by the FrameComponent. More...
 
bool isImageSpecified (FrameImageComponent part) const
 Return whether the given component image has been specified. More...
 
bool isImageFetchedFromProperty (FrameImageComponent part) const
 Return whether the given component image is specified via a property. More...
 
const StringgetImagePropertySource (FrameImageComponent part) const
 Return the name of the property that will be used to determine the image to use for the given component image. More...
 
void writeXMLToStream (XMLSerializer &xml_stream) const
 Writes an xml representation of this FrameComponent to out_stream. More...
 
bool operator== (const FrameComponent &rhs) const
 
- Public Member Functions inherited from CEGUI::FalagardComponentBase
void render (Window &srcWindow, const CEGUI::ColourRect *modColours=0, const Rectf *clipper=0, bool clipToDisplay=false) const
 Render this component. More correctly, the component is cached for rendering. More...
 
void render (Window &srcWindow, const Rectf &baseRect, const CEGUI::ColourRect *modColours=0, const Rectf *clipper=0, bool clipToDisplay=false) const
 Render this component. More correctly, the component is cached for rendering. More...
 
const ComponentAreagetComponentArea () const
 Return the ComponentArea of this component. More...
 
void setComponentArea (const ComponentArea &area)
 Set the conponent's ComponentArea. More...
 
const ColourRectgetColours () const
 Return the ColourRect used by this component. More...
 
void setColours (const ColourRect &cols)
 Set the colours to be used by this component. More...
 
void setColoursPropertySource (const String &property)
 Set the name of the property where colour values can be obtained. More...
 
virtual bool handleFontRenderSizeChange (Window &window, const Font *font) const
 perform any processing required due to the given font having changed.
 

Protected Member Functions

void render_impl (Window &srcWindow, Rectf &destRect, const CEGUI::ColourRect *modColours, const Rectf *clipper, bool clipToDisplay) const
 Function to do main render caching work.
 
void renderImage (GeometryBuffer &buffer, const Image *image, VerticalFormatting vertFmt, HorizontalFormatting horzFmt, Rectf &destRect, const ColourRect &colours, const Rectf *clipper, bool clipToDisplay) const
 
- Protected Member Functions inherited from CEGUI::FalagardComponentBase
void initColoursRect (const Window &wnd, const ColourRect *modCols, ColourRect &cr) const
 Helper function to initialise a ColourRect with appropriate values according to the way the component is set up. More...
 
bool writeColoursXML (XMLSerializer &xml_stream) const
 Writes xml for the colours to a OutStream. Will prefer property colours before explicit. More...
 

Protected Attributes

FormattingSetting
< VerticalFormatting
d_leftEdgeFormatting
 
FormattingSetting
< VerticalFormatting
d_rightEdgeFormatting
 
FormattingSetting
< HorizontalFormatting
d_topEdgeFormatting
 
FormattingSetting
< HorizontalFormatting
d_bottomEdgeFormatting
 
FormattingSetting
< VerticalFormatting
d_backgroundVertFormatting
 
FormattingSetting
< HorizontalFormatting
d_backgroundHorzFormatting
 
FrameImageSource d_frameImages [FIC_FRAME_IMAGE_COUNT]
 FrameImageSource array describing images to be used.
 
- Protected Attributes inherited from CEGUI::FalagardComponentBase
ComponentArea d_area
 Destination area for this component.
 
ColourRect d_colours
 base colours to be applied when rendering the image component.
 
String d_colourPropertyName
 name of property to fetch colours from.
 

Detailed Description

Class that encapsulates information for a frame with background (9 images in total)

Corner images are always drawn at their natural size, edges can be fomatted (stretched, tiled or aligned) between the corner pieces for a particular edge, the background image will cover the inner rectangle formed by the edge images and can be formatted in both dimensions.

Member Function Documentation

HorizontalFormatting CEGUI::FrameComponent::getBackgroundHorizontalFormatting ( const Window wnd) const

Return the horizontal formatting to be used for the background image.

Returns
One of the HorizontalFormatting enumerated values.
VerticalFormatting CEGUI::FrameComponent::getBackgroundVerticalFormatting ( const Window wnd) const

Return the vertical formatting to be used for the background image.

Returns
One of the VerticalFormatting enumerated values.
HorizontalFormatting CEGUI::FrameComponent::getBottomEdgeFormatting ( const Window wnd) const

Return the formatting to be used for the bottom edge image.

Returns
One of the HorizontalFormatting enumerated values.
const Image* CEGUI::FrameComponent::getImage ( FrameImageComponent  part,
const Window wnd 
) const

Return the Image object that will be drawn by this FrameComponent for a specified frame part.

Parameters
partOne of the FrameImageComponent enumerated values specifying the component image to be accessed.
wndReference to a Window object that will be accessed if the image component is fetched from a Property.
Returns
pointer to an Image object, or 0 if the image had not been set or if the image is sourced from a property that returns an empty image name.
const String& CEGUI::FrameComponent::getImagePropertySource ( FrameImageComponent  part) const

Return the name of the property that will be used to determine the image to use for the given component image.

If the returned String is empty, it indicates either that the
component image is not specified or that the component image is not
sourced from a property.
See Also
isImageFetchedFromProperty isImageSpecified
Parameters
partOne of the FrameImageComponent enumerated values specifying the component image property source to return.
VerticalFormatting CEGUI::FrameComponent::getLeftEdgeFormatting ( const Window wnd) const

Return the formatting to be used for the left edge image.

Returns
One of the VerticalFormatting enumerated values.
VerticalFormatting CEGUI::FrameComponent::getRightEdgeFormatting ( const Window wnd) const

Return the formatting to be used for the right edge image.

Returns
One of the VerticalFormatting enumerated values.
HorizontalFormatting CEGUI::FrameComponent::getTopEdgeFormatting ( const Window wnd) const

Return the formatting to be used for the top edge image.

Returns
One of the HorizontalFormatting enumerated values.
bool CEGUI::FrameComponent::isImageFetchedFromProperty ( FrameImageComponent  part) const

Return whether the given component image is specified via a property.

Parameters
partOne of the FrameImageComponent enumerated values specifying the component image to check.
Returns
  • true if the image is specified and fetched via a property.
  • false if the image is not fetched via a property (or is not specified)
bool CEGUI::FrameComponent::isImageSpecified ( FrameImageComponent  part) const

Return whether the given component image has been specified.

Parameters
partOne of the FrameImageComponent enumerated values specifying the component image to check.
Returns
  • true if the image is specified and will be drawn.
  • false if the image is not specified.
void CEGUI::FrameComponent::setBackgroundHorizontalFormatting ( HorizontalFormatting  fmt)

Set the horizontal formatting to be used for the background image.

Parameters
fmtOne of the HorizontalFormatting enumerated values.
void CEGUI::FrameComponent::setBackgroundVerticalFormatting ( VerticalFormatting  fmt)

Set the vertical formatting to be used for the background image.

Parameters
fmtOne of the VerticalFormatting enumerated values.
void CEGUI::FrameComponent::setBottomEdgeFormatting ( HorizontalFormatting  fmt)

Set the formatting to be used for the bottom edge image.

Parameters
fmtOne of the HorizontalFormatting enumerated values.
void CEGUI::FrameComponent::setImage ( FrameImageComponent  part,
const Image image 
)

Set an Image that will be drawn by this FrameComponent.

Parameters
partOne of the FrameImageComponent enumerated values specifying the component image to be set.
imagePointer to the Image object to be drawn. If this is 0 then drawing of the component image specified by part will be disabled.
void CEGUI::FrameComponent::setImage ( FrameImageComponent  part,
const String name 
)

Set an Image that will be drawn by this FrameComponent.

Parameters
partOne of the FrameImageComponent enumerated values specifying the component image to be set.
nameString holding the name of an Image. The image should already exist, if the Image does not exist an Exception will be logged and drawing of the component image specified by part will be disabled.
void CEGUI::FrameComponent::setImagePropertySource ( FrameImageComponent  part,
const String name 
)

Set the name of the Property that will be accesssed on the target Window to determine the Image that will be drawn by the FrameComponent.

Parameters
partOne of the FrameImageComponent enumerated values specifying the component image to be set.
nameString holding the name of a property that will be accessed. If this is the empty string then drawing of the component image specified by part will be disabled.
void CEGUI::FrameComponent::setLeftEdgeFormatting ( VerticalFormatting  fmt)

Set the formatting to be used for the left edge image.

Parameters
fmtOne of the VerticalFormatting enumerated values.
void CEGUI::FrameComponent::setRightEdgeFormatting ( VerticalFormatting  fmt)

Set the formatting to be used for the right edge image.

Parameters
fmtOne of the VerticalFormatting enumerated values.
void CEGUI::FrameComponent::setTopEdgeFormatting ( HorizontalFormatting  fmt)

Set the formatting to be used for the top edge image.

Parameters
fmtOne of the HorizontalFormatting enumerated values.
void CEGUI::FrameComponent::writeXMLToStream ( XMLSerializer xml_stream) const

Writes an xml representation of this FrameComponent to out_stream.

Parameters
xml_streamStream where xml data should be output.
Returns
Nothing.