GG
|
A subclass of BrowseInfoWnd that displays text in a box, optionally with a border. More...
#include <BrowseInfoWnd.h>
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) | |
TextBoxBrowseInfoWnd () | |
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) |
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 111 of file BrowseInfoWnd.h.
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
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.
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.