# CEGUI::Static Class Reference

Base class for static widgets. More...

Inheritance diagram for CEGUI::Static:

[legend]
Collaboration diagram for CEGUI::Static:

[legend]
List of all members.

## Public Member Functions

bool | isFrameEnabled (void) const
| Return whether the frame for this static widget is enabled or disabled.
bool | isBackgroundEnabled (void) const
| Return whether the background for this static widget is enabled to disabled.
ColourRect | getFrameColours (void) const
| Return a ColourRect object containing the colours used when rendering this widget.
ColourRect | getBackgroundColours (void) const
| Return a ColourRect object containing the colours used when rendering this widget.
virtual Rect | getUnclippedInnerRect (void) const
| Return a Rect object that describes, unclipped, the inner rectangle for this window. The inner rectangle is typically an area that excludes some frame or other rendering that should not be touched by subsequent rendering.
const Image * | getImageForFrameLocation (FrameLocation location) const
| Return the Image being used for the specified location of the frame.
const Image * | getBackgroundImage (void) const
| Return the Image currently set as the background image for the widget.
void | setFrameEnabled (bool setting)
| Enable or disable rendering of the frame for this static widget.
void | setFrameImages (const Image *topleft, const Image *topright, const Image *bottomleft, const Image *bottomright, const Image *left, const Image *top, const Image *right, const Image *bottom)
| specify the Image objects to use for each part of the frame. A NULL may be used to omit any part.
void | setFrameColours (const ColourRect &colours)
| Sets the colours to be applied when rendering the frame.
void | setFrameColours (const colour &top_left_colour, const colour &top_right_colour, const colour &bottom_left_colour, const colour &bottom_right_colour)
| Sets the colours to be applied when rendering the frame.
void | setFrameColours (const colour &col)
| Sets the colour to be applied when rendering the frame.
void | setBackgroundEnabled (bool setting)
| Enable or disable rendering of the background for this static widget.
void | setBackgroundImage (const Image *image)
| Set the image to use as the background for the static widget.
void | setBackgroundImage (const String &imageset, const String &image)
| Set the image to use as the background for the static widget.
void | setBackgroundColours (const ColourRect &colours)
| Sets the colours to be applied when rendering the background.
void | setBackgroundColours (const colour &top_left_colour, const colour &top_right_colour, const colour &bottom_left_colour, const colour &bottom_right_colour)
| Sets the colours to be applied when rendering the background.
void | setBackgroundColours (const colour &col)
| Sets the colour to be applied when rendering the background.
void | setImageForFrameLocation (FrameLocation location, const Image *image)
| Set the Image to use for the specified location of the frame.
| Static (const String &type, const String &name)
| Constructor for static widget base class.
virtual | ~Static (void)
| Destructor for static widget base class.

## Static Public Attributes

static const String | EventNamespace
| Namespace for global events.

## Protected Member Functions

virtual void | populateRenderCache ()
| Update the rendering cache.
virtual void | onSized (WindowEventArgs &e)
| Handler called when the window's size changes.
virtual void | onAlphaChanged (WindowEventArgs &e)
| Handler called when the window's alpha blend value is changed.
void | updateRenderableFrameColours (void)
| update the internal RenderableFrame with currently set colours and alpha settings.
colour | calculateModulatedAlphaColour (const colour &col, float alpha) const
| return ARGB colour value col, with its alpha component modulated by the value specified in float alpha.
virtual void | onStaticFrameChanged (WindowEventArgs &e)
| This is used internally to indicate that the frame for the static widget has been modified, and as such derived classes may need to adjust their layouts or reconfigure their rendering somehow.
virtual bool | testClassName_impl (const String &class_name) const
| Return whether this window was inherited from the given class name at some point in the inheritance heirarchy.

## Protected Attributes

bool | d_frameEnabled
| True when the frame is enabled.
ColourRect | d_frameCols
| Used to store frame colours.
RenderableFrame | d_frame
| Frame object used for rendering a frame for the static element.
bool | d_backgroundEnabled
| true when the background is enabled.
ColourRect | d_backgroundCols
| Colours to use when drawing background.
const Image * | d_background
| Image to use for widget background.
float | d_left_width
| Width of the left edge image for the current frame.
float | d_right_width
| Width of the right edge image for the current frame.
float | d_top_height
| Height of the top edge image for the current frame.
float | d_bottom_height
| Height of the bottom edge image for the current frame.

## Detailed Description

Base class for static widgets.

## Member Function Documentation

ColourRect CEGUI::Static::getBackgroundColours | ( | void |  | ) | const`[inline]`

Return a ColourRect object containing the colours used when rendering this widget.

Returns:
  ColourRect object initialised with the colours used when rendering the background for this widget.

const Image * CEGUI::Static::getBackgroundImage | ( | void |  | ) | const

Return the Image currently set as the background image for the widget.

Returns:
  Pointer to the Image object currently set as the background for this StaticWidget. May return NULL if no Image is currently set.

ColourRect CEGUI::Static::getFrameColours | ( | void |  | ) | const`[inline]`

Return a ColourRect object containing the colours used when rendering this widget.

Returns:
  ColourRect object initialised with the colours used when rendering the frame for this widget.

const Image * CEGUI::Static::getImageForFrameLocation | ( | FrameLocation | location | ) | const

Return the Image being used for the specified location of the frame.

Parameters:

  | location | One of the FrameLocation enumerated values specifying the image to be returned.

Returns:
  Pointer to the Image object currently set for the frame location specified in location. May return NULL if no Image is set for the requested position.

Rect CEGUI::Static::getUnclippedInnerRect | ( | void |  | ) | const`[virtual]`

Return a Rect object that describes, unclipped, the inner rectangle for this window. The inner rectangle is typically an area that excludes some frame or other rendering that should not be touched by subsequent rendering.

Returns:
  Rect object that describes, in unclipped screen pixel co-ordinates, the window object's inner rect area.

Reimplemented from CEGUI::Window.

Reimplemented in CEGUI::StaticText.

bool CEGUI::Static::isBackgroundEnabled | ( | void |  | ) | const`[inline]`

Return whether the background for this static widget is enabled to disabled.

Returns:
  true if the background is enabled and will be rendered. false if the background is disabled and will not be rendered.

bool CEGUI::Static::isFrameEnabled | ( | void |  | ) | const`[inline]`

Return whether the frame for this static widget is enabled or disabled.

Returns:
  true if the frame is enabled and will be rendered. false is the frame is disabled and will not be rendered.

void CEGUI::Static::onAlphaChanged | ( | WindowEventArgs & | e | ) | `[protected, virtual]`

Handler called when the window's alpha blend value is changed.

Parameters:

  | e | WindowEventArgs object whose 'window' pointer field is set to the window that triggered the event. For this event the trigger window is always 'this'.

Reimplemented from CEGUI::Window.

Reimplemented in CEGUI::StaticImage.

void CEGUI::Static::onSized | ( | WindowEventArgs & | e | ) | `[protected, virtual]`

Handler called when the window's size changes.

Parameters:

  | e | WindowEventArgs object whose 'window' pointer field is set to the window that triggered the event. For this event the trigger window is always 'this'.

Reimplemented from CEGUI::Window.

Reimplemented in CEGUI::StaticImage, and CEGUI::StaticText.

virtual void CEGUI::Static::onStaticFrameChanged | ( | WindowEventArgs & | e | ) | `[inline, protected, virtual]`

This is used internally to indicate that the frame for the static widget has been modified, and as such derived classes may need to adjust their layouts or reconfigure their rendering somehow.

Note:
  This does not currently fire an external event.

Reimplemented in CEGUI::StaticImage.

void CEGUI::Static::populateRenderCache | ( |  | ) | `[protected, virtual]`

| Update the rendering cache. Populates the Window's RenderCache with imagery to be sent to the renderer. Reimplemented from CEGUI::Window. Reimplemented in CEGUI::StaticImage, and CEGUI::StaticText.

void CEGUI::Static::setBackgroundColours | ( | const colour & | col | ) | `[inline]`

Sets the colour to be applied when rendering the background.

Parameters:

  | col | colour value to be used when rendering.

Returns:
  Nothing.

void CEGUI::Static::setBackgroundColours | ( | const colour & | top_left_colour,
|  | const colour & | top_right_colour,
|  | const colour & | bottom_left_colour,
|  | const colour & | bottom_right_colour
| ) |

Sets the colours to be applied when rendering the background.

Parameters:

  | top_left_colour | Colour to be applied to the top-left corner of the background.
  | top_right_colour | Colour to be applied to the top-right corner of the background.
  | bottom_left_colour | Colour to be applied to the bottom-left corner of the background.
  | bottom_right_colour | Colour to be applied to the bottom-right corner of the background.

Returns:
  Nothing.

void CEGUI::Static::setBackgroundColours | ( | const ColourRect & | colours | ) |

Sets the colours to be applied when rendering the background.

Parameters:

  | colours | ColourRect object describing the colours to be used.

Returns:
  Nothing.

void CEGUI::Static::setBackgroundEnabled | ( | bool | setting | ) |

Enable or disable rendering of the background for this static widget.

Parameters:

  | setting | true to enable rendering of the background. false to disable rendering of the background.

void CEGUI::Static::setBackgroundImage | ( | const String & | imageset,
|  | const String & | image
| ) |

Set the image to use as the background for the static widget.

Parameters:

  | imageset | String object specifying the name of the Imageset that holds the required image.
  | image | Name of the Image on the specified Imageset that is to be used.

Returns:
  Nothing.

Exceptions:

  | UnknownObjectException | thrown if Imageset imageset does not exist in the system or if imageset contains no Image named image.

void CEGUI::Static::setBackgroundImage | ( | const Image * | image | ) |

Set the image to use as the background for the static widget.

Parameters:

  | image | Pointer to the Image object to be rendered. Can be NULL to specify no image is to be rendered.

Returns:
  Nothing.

void CEGUI::Static::setFrameColours | ( | const colour & | col | ) | `[inline]`

Sets the colour to be applied when rendering the frame.

Parameters:

  | col | colour value to be used when rendering.

Returns:
  Nothing.

void CEGUI::Static::setFrameColours | ( | const colour & | top_left_colour,
|  | const colour & | top_right_colour,
|  | const colour & | bottom_left_colour,
|  | const colour & | bottom_right_colour
| ) |

Sets the colours to be applied when rendering the frame.

Parameters:

  | top_left_colour | Colour to be applied to the top-left corner of each Image used in the frame.
  | top_right_colour | Colour to be applied to the top-right corner of each Image used in the frame.
  | bottom_left_colour | Colour to be applied to the bottom-left corner of each Image used in the frame.
  | bottom_right_colour | Colour to be applied to the bottom-right corner of each Image used in the frame.

Returns:
  Nothing.

void CEGUI::Static::setFrameColours | ( | const ColourRect & | colours | ) |

Sets the colours to be applied when rendering the frame.

Parameters:

  | colours | ColourRect object describing the colours to be used.

Returns:
  Nothing.

void CEGUI::Static::setFrameEnabled | ( | bool | setting | ) |

Enable or disable rendering of the frame for this static widget.

Frame imagery can be customised via the setFrameImages method.

Parameters:

  | setting | true to enable rendering of a frame. false to disable rendering of a frame.

void CEGUI::Static::setFrameImages | ( | const Image * | topleft,
|  | const Image * | topright,
|  | const Image * | bottomleft,
|  | const Image * | bottomright,
|  | const Image * | left,
|  | const Image * | top,
|  | const Image * | right,
|  | const Image * | bottom
| ) |

specify the Image objects to use for each part of the frame. A NULL may be used to omit any part.

Parameters:

  | topleft | Pointer to an Image object to render as the top-left corner of the frame. Specify NULL to omit this part of the frame.
  | topright | Pointer to an Image object to render as the top-right corner of the frame. Specify NULL to omit this part of the frame.
  | bottomleft | Pointer to an Image object to render as the bottom-left corner of the frame. Specify NULL to omit this part of the frame.
  | bottomright | Pointer to an Image object to render as the bottom-right corner of the frame. Specify NULL to omit this part of the frame.
  | left | Pointer to an Image object to render as the left edge of the frame. Specify NULL to omit this part of the frame.
  | top | Pointer to an Image object to render as the top edge of the frame. Specify NULL to omit this part of the frame.
  | right | Pointer to an Image object to render as the right edge of the frame. Specify NULL to omit this part of the frame.
  | bottom | Pointer to an Image object to render as the bottom edge of the frame. Specify NULL to omit this part of the frame.

Returns:
  Nothing

void CEGUI::Static::setImageForFrameLocation | ( | FrameLocation | location,
|  | const Image * | image
| ) |

Set the Image to use for the specified location of the frame.

Parameters:

  | location | One of the FrameLocation enumerated values specifying the image to be returned.
  | image | Pointer to the Image to use for the frame location specified in location. May be NULL to indicate the frame component is not required.

Returns:
  Nothing.

virtual bool CEGUI::Static::testClassName_impl | ( | const String & | class_name | ) | const`[inline, protected, virtual]`

Return whether this window was inherited from the given class name at some point in the inheritance heirarchy.

Parameters:

  | class_name | The class name that is to be checked.

Returns:
  true if this window was inherited from class_name. false if not.

Reimplemented from CEGUI::Window.

Reimplemented in CEGUI::StaticImage, CEGUI::StaticText, and CEGUI::TabPane.