TextRenderer Class Reference

#include <textrenderer.h>

List of all members.

Public Types

typedef list< PG_Widget * > Widgets

Public Member Functions

 TextRenderer (PG_Widget *parent, const PG_Rect &r, const std::string &text, const std::string &style="ScrollWidget")
 TextRenderer (PG_Widget *parent, const PG_Rect &r=PG_Rect::null)
void SetText (const std::string &text)
virtual const PG_String & GetText ()
void saveText (bool stripFormatting)
PG_Widget * parsingError (const ASCString &errorMessage)

Static Public Member Functions

static bool registerTagRenderer (TagRenderer *renderer)

Protected Member Functions

bool isSpace (ASCString::charT character)
bool isBreaker (ASCString::charT character)
int arrangeLine (int y, const Widgets &line, int lineHeight, int indent)
int AreaWidth ()
void layout ()
void addWidget (PG_Widget *w)
void addWidget (Widgets w)
void addSpace (int space)
void addLinebreak (int pixel, int lines)
void addIndentation (int firstLine, int furtherLines)
void addAbsPosition (int pos)
ASCString substr (const ASCString &text, ASCString::const_iterator begin, ASCString::const_iterator end)
ASCString::const_iterator token (const ASCString &text, ASCString::const_iterator start)
ASCString::const_iterator token_command (const ASCString &text, ASCString::const_iterator start)
void parse (const ASCString &text)
virtual PG_Widget * render (const ASCString &token)
virtual Widgets eval_command (const ASCString &token)
bool eventKeyDown (const SDL_KeyboardEvent *key)
void clear ()

Classes

struct  RenderingAttribute
class  TagRenderer
struct  TextAttributes


Detailed Description

Definition at line 20 of file textrenderer.h.


Member Typedef Documentation

typedef list<PG_Widget*> TextRenderer::Widgets

Definition at line 47 of file textrenderer.h.


Constructor & Destructor Documentation

TextRenderer::TextRenderer ( PG_Widget *  parent,
const PG_Rect &  r,
const std::string &  text,
const std::string &  style = "ScrollWidget" 
)

Definition at line 51 of file textrenderer.cpp.

References SetText().

TextRenderer::TextRenderer ( PG_Widget *  parent,
const PG_Rect &  r = PG_Rect::null 
)

Definition at line 45 of file textrenderer.cpp.


Member Function Documentation

bool TextRenderer::isSpace ( ASCString::charT  character  )  [inline, protected]

Definition at line 59 of file textrenderer.h.

Referenced by parse(), token(), and token_command().

bool TextRenderer::isBreaker ( ASCString::charT  character  )  [inline, protected]

Definition at line 64 of file textrenderer.h.

Referenced by token().

int TextRenderer::arrangeLine ( int  y,
const Widgets line,
int  lineHeight,
int  indent 
) [protected]

Definition at line 58 of file textrenderer.cpp.

Referenced by layout().

int TextRenderer::AreaWidth (  )  [protected]

Definition at line 73 of file textrenderer.cpp.

References max().

Referenced by layout().

void TextRenderer::layout (  )  [protected]

Definition at line 78 of file textrenderer.cpp.

References AreaWidth(), arrangeLine(), and max().

void TextRenderer::addWidget ( PG_Widget *  w  )  [protected]

Definition at line 151 of file textrenderer.cpp.

Referenced by addAbsPosition(), addIndentation(), addWidget(), token(), and token_command().

void TextRenderer::addWidget ( Widgets  w  )  [protected]

Definition at line 145 of file textrenderer.cpp.

References addWidget().

void TextRenderer::addSpace ( int  space  )  [protected]

Definition at line 159 of file textrenderer.cpp.

Referenced by token().

void TextRenderer::addLinebreak ( int  pixel,
int  lines 
) [protected]

Definition at line 165 of file textrenderer.cpp.

Referenced by eval_command(), and token().

void TextRenderer::addIndentation ( int  firstLine,
int  furtherLines 
) [protected]

Definition at line 177 of file textrenderer.cpp.

References addWidget().

Referenced by eval_command().

void TextRenderer::addAbsPosition ( int  pos  )  [protected]

Definition at line 190 of file textrenderer.cpp.

References addWidget().

Referenced by eval_command().

ASCString TextRenderer::substr ( const ASCString text,
ASCString::const_iterator  begin,
ASCString::const_iterator  end 
) [protected]

Definition at line 200 of file textrenderer.cpp.

Referenced by token(), and token_command().

ASCString::const_iterator TextRenderer::token ( const ASCString text,
ASCString::const_iterator  start 
) [protected]

Definition at line 217 of file textrenderer.cpp.

References addLinebreak(), addSpace(), addWidget(), isBreaker(), isSpace(), render(), and substr().

Referenced by eval_command(), parse(), and render().

ASCString::const_iterator TextRenderer::token_command ( const ASCString text,
ASCString::const_iterator  start 
) [protected]

Definition at line 205 of file textrenderer.cpp.

References addWidget(), eval_command(), isSpace(), and substr().

Referenced by parse().

void TextRenderer::parse ( const ASCString text  )  [protected]

Definition at line 259 of file textrenderer.cpp.

References isSpace(), token(), and token_command().

PG_Widget * TextRenderer::render ( const ASCString token  )  [protected, virtual]

Definition at line 427 of file textrenderer.cpp.

References token().

Referenced by token().

TextRenderer::Widgets TextRenderer::eval_command ( const ASCString token  )  [protected, virtual]

Definition at line 302 of file textrenderer.cpp.

References addAbsPosition(), addIndentation(), addLinebreak(), Surface::getBaseSurface(), IconRepository::getIcon(), pal, parsingError(), s1, s2, and token().

Referenced by token_command().

bool TextRenderer::eventKeyDown ( const SDL_KeyboardEvent *  key  )  [protected]

Definition at line 477 of file textrenderer.cpp.

References saveText().

void TextRenderer::clear (  )  [protected]

Definition at line 437 of file textrenderer.cpp.

References BulkGraphicUpdates::release().

void TextRenderer::SetText ( const std::string &  text  ) 

Referenced by IngameMessageViewer::SetMessage(), MessageDialog::SetText(), TextRenderer(), ActionInfoPanel::update(), and ViewFormattedText::ViewFormattedText().

const PG_String & TextRenderer::GetText (  )  [virtual]

Definition at line 449 of file textrenderer.cpp.

Referenced by MessageDialog::SetText().

void TextRenderer::saveText ( bool  stripFormatting  ) 

Definition at line 463 of file textrenderer.cpp.

References selectFile(), and tnstream::writing.

Referenced by eventKeyDown(), and IngameMessageViewer::eventKeyDown().

PG_Widget * TextRenderer::parsingError ( const ASCString errorMessage  ) 

Definition at line 281 of file textrenderer.cpp.

References errorMessage().

Referenced by eval_command(), and VehicleTypeRenderer::renderWidget().

bool TextRenderer::registerTagRenderer ( TagRenderer renderer  )  [static]

Definition at line 293 of file textrenderer.cpp.


The documentation for this class was generated from the following files:
Generated on Mon May 21 01:47:48 2012 for Advanced Strategic Command by  doxygen 1.5.1