GG::TextBoxBrowseInfoWnd Class Reference

A subclass of BrowseInfoWnd that displays text in a box, optionally with a border. More...

#include <BrowseInfoWnd.h>

Inheritance diagram for GG::TextBoxBrowseInfoWnd:

GG::BrowseInfoWnd GG::Wnd

List of all members.

Structors



 TextBoxBrowseInfoWnd (X w, const boost::shared_ptr< Font > &font, Clr color, Clr border_color, Clr text_color, Flags< TextFormat > format=FORMAT_LEFT|FORMAT_WORDBREAK, unsigned int border_width=2, unsigned int text_margin=4)

Accessors



virtual bool WndHasBrowseInfo (const Wnd *wnd, std::size_t mode) const
bool TextFromTarget () const
const std::string & Text () const
const boost::shared_ptr< Font > & GetFont () const
Clr Color () const
Clr BorderColor () const
Clr TextColor () const
Flags< TextFormat > GetTextFormat () const
unsigned int BorderWidth () const
unsigned int TextMargin () const

Mutators



void SetText (const std::string &str)
virtual void Render ()
void SetTextFromTarget (bool b)
void SetFont (const boost::shared_ptr< Font > &font)
void SetColor (Clr color)
void SetBorderColor (Clr border_color)
void SetTextColor (Clr text_color)
void SetTextFormat (Flags< TextFormat > format)
void SetBorderWidth (unsigned int border_width)
void SetTextMargin (unsigned int text_margin)

Structors



 TextBoxBrowseInfoWnd ()


Detailed Description

A subclass of BrowseInfoWnd that displays text in a box, optionally with a border.

The typical use case is for TextBoxBrowseInfoWnd to get the appropriate text for the current mode by calling BrowseInfoText() on its target Wnd. It may also be used to display static text, by setting SetTextFromTarget(false) and setting the desired text with SetText().

Definition at line 101 of file BrowseInfoWnd.h.


Constructor & Destructor Documentation

GG::TextBoxBrowseInfoWnd::TextBoxBrowseInfoWnd ( X  w,
const boost::shared_ptr< Font > &  font,
Clr  color,
Clr  border_color,
Clr  text_color,
Flags< TextFormat >  format = FORMAT_LEFT|FORMAT_WORDBREAK,
unsigned int  border_width = 2,
unsigned int  text_margin = 4 
)

basic ctor

GG::TextBoxBrowseInfoWnd::TextBoxBrowseInfoWnd (  )  [protected]

default ctor


Member Function Documentation

virtual bool GG::TextBoxBrowseInfoWnd::WndHasBrowseInfo ( const Wnd wnd,
std::size_t  mode 
) const [virtual]

Returns true iff wnd's browse mode mode contains browse info that is usable by this BrowseInfoWnd. This method is used by GUI to determine whether a Wnd w has suitable browse info available; if not, w's ancestors may instead be asked for browse info recursively.

Implements GG::BrowseInfoWnd.

bool GG::TextBoxBrowseInfoWnd::TextFromTarget (  )  const

returns true iff the text to display will be read from the target wnd

const std::string& GG::TextBoxBrowseInfoWnd::Text (  )  const

returns the text currently set for display

const boost::shared_ptr<Font>& GG::TextBoxBrowseInfoWnd::GetFont (  )  const

returns the Font used to display text

Clr GG::TextBoxBrowseInfoWnd::Color (  )  const

returns the color used to render the text box

Clr GG::TextBoxBrowseInfoWnd::BorderColor (  )  const

returns the color used to render the text box border

Clr GG::TextBoxBrowseInfoWnd::TextColor (  )  const

returns the color used to render the text

Flags<TextFormat> GG::TextBoxBrowseInfoWnd::GetTextFormat (  )  const

returns the text format used to render the text

unsigned int GG::TextBoxBrowseInfoWnd::BorderWidth (  )  const

returns the width of the text box border

unsigned int GG::TextBoxBrowseInfoWnd::TextMargin (  )  const

returns the margin to leave between the text and the text box

virtual void GG::TextBoxBrowseInfoWnd::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::BrowseInfoWnd.

void GG::TextBoxBrowseInfoWnd::SetTextFromTarget ( bool  b  ) 

sets the text display mode to static (b == true) or dynamic (read from the target Wnd, b == false)

void GG::TextBoxBrowseInfoWnd::SetFont ( const boost::shared_ptr< Font > &  font  ) 

sets the Font used to display text

void GG::TextBoxBrowseInfoWnd::SetColor ( Clr  color  ) 

sets the color used to render the text box

void GG::TextBoxBrowseInfoWnd::SetBorderColor ( Clr  border_color  ) 

sets the color used to render the text box border

void GG::TextBoxBrowseInfoWnd::SetTextColor ( Clr  text_color  ) 

sets the color used to render the text

void GG::TextBoxBrowseInfoWnd::SetTextFormat ( Flags< TextFormat >  format  ) 

sets the text format used to render the text

void GG::TextBoxBrowseInfoWnd::SetBorderWidth ( unsigned int  border_width  ) 

sets the width of the text box border

void GG::TextBoxBrowseInfoWnd::SetTextMargin ( unsigned int  text_margin  ) 

sets the margin to leave between the text and the text box


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

Generated on Sat Mar 26 07:08:37 2011 for GG by  doxygen 1.5.9