GG::StaticGraphic Class Reference

This is a simple, non-interactive window that displays a GG::SubTexture. More...

#include <StaticGraphic.h>

Inheritance diagram for GG::StaticGraphic:

GG::Control GG::Wnd List of all members.

Structors

 StaticGraphic (int x, int y, int w, int h, const boost::shared_ptr< Texture > &texture, Flags< GraphicStyle > style=GRAPHIC_NONE, Flags< WndFlag > flags=Flags< WndFlag >())
 StaticGraphic (int x, int y, int w, int h, const SubTexture &subtexture, Flags< GraphicStyle > style=GRAPHIC_NONE, Flags< WndFlag > flags=Flags< WndFlag >())

Accessors

Flags< GraphicStyle > Style () const
Rect RenderedArea () const

Mutators

virtual void Render ()
void SetStyle (Flags< GraphicStyle > style)
virtual void DefineAttributes (WndEditor *editor)

Structors

 StaticGraphic ()

Detailed Description

This is a simple, non-interactive window that displays a GG::SubTexture.

Though the SubTexture displayed in a StaticGraphic is fixed, its size is not; the image can be scaled (proportionately or not) to fit in the StaticGraphic's window area.

See also:
StaticGraphicStyle

Definition at line 55 of file StaticGraphic.h.


Constructor & Destructor Documentation

GG::StaticGraphic::StaticGraphic ( int  x,
int  y,
int  w,
int  h,
const boost::shared_ptr< Texture > &  texture,
Flags< GraphicStyle >  style = GRAPHIC_NONE,
Flags< WndFlag >  flags = Flags< WndFlag >() 
)

creates a StaticGraphic from a pre-existing Texture. creates a StaticGraphic from a pre-existing Texture.

Warning:
Calling code must not delete texture; texture becomes the property of a shared_ptr inside a SubTexture.

GG::StaticGraphic::StaticGraphic ( int  x,
int  y,
int  w,
int  h,
const SubTexture subtexture,
Flags< GraphicStyle >  style = GRAPHIC_NONE,
Flags< WndFlag >  flags = Flags< WndFlag >() 
)

creates a StaticGraphic from a pre-existing SubTexture.

GG::StaticGraphic::StaticGraphic (  )  [protected]

default ctor


Member Function Documentation

Flags<GraphicStyle> GG::StaticGraphic::Style (  )  const

returns the style of the StaticGraphic

See also:
StaticGraphicStyle

Rect GG::StaticGraphic::RenderedArea (  )  const

returns the area in which the graphic is actually rendered, in UpperLeft()-relative coordinates.

This may not be the entire area of the StaticGraphic, based on the style being used.

virtual void GG::StaticGraphic::Render (  )  [virtual]

draws this Wnd.

Note that Wnds being dragged for a drag-and-drop operation are rendered twice -- once in-place as normal, once in the location of the drag operation, attached to the cursor. Such Wnds may wish to render themselves differently in those two cases. To determine which render is being performed, they can call GUI::GetGUI()->RenderingDragDropWnds().

Implements GG::Control.

void GG::StaticGraphic::SetStyle ( Flags< GraphicStyle >  style  ) 

sets the style flags, and perfroms sanity checking

See also:
StaticGraphicStyle

virtual void GG::StaticGraphic::DefineAttributes ( WndEditor *  editor  )  [virtual]

provides the attributes of this object that are appropriate for a user to edit in a WndEditor; see WndEditor for details.

Reimplemented from GG::Control.


The documentation for this class was generated from the following file:
Generated on Wed Mar 26 14:35:42 2008 for GG by  doxygen 1.5.2