Crazy Eddie's GUI System
0.8.4
|
Class used for textual items in a list box. More...
Public Member Functions | |
ListboxTextItem (const String &text, uint item_id=0, void *item_data=0, bool disabled=false, bool auto_delete=true) | |
base class constructor | |
virtual | ~ListboxTextItem (void) |
base class destructor | |
const Font * | getFont (void) const |
Return a pointer to the font being used by this ListboxTextItem. | |
ColourRect | getTextColours (void) const |
Return the current colours used for text rendering. | |
void | setFont (Font *font) |
Set the font to be used by this ListboxTextItem. | |
void | setFont (const String &font_name) |
Set the font to be used by this ListboxTextItem. | |
void | setTextColours (const ColourRect &cols) |
Set the colours used for text rendering. | |
void | setTextColours (Colour top_left_colour, Colour top_right_colour, Colour bottom_left_colour, Colour bottom_right_colour) |
Set the colours used for text rendering. | |
void | setTextColours (Colour col) |
Set the colours used for text rendering. | |
void | setTextParsingEnabled (const bool enable) |
Set whether the the ListboxTextItem will have it's text parsed via the BasicRenderedStringParser or not. | |
bool | isTextParsingEnabled () const |
return whether text parsing is enabled for this ListboxTextItem. | |
void | setText (const String &text) |
set the text string for this list box item. | |
bool | handleFontRenderSizeChange (const Font *const font) |
Perform any updates needed because the given font's render size has changed. | |
Sizef | getPixelSize (void) const |
Return the rendered pixel size of this list box item. | |
void | draw (GeometryBuffer &buffer, const Rectf &targetRect, float alpha, const Rectf *clipper) const |
Draw the list box item in its current state. | |
Static Public Attributes | |
static const Colour | DefaultTextColour |
Default text colour. | |
Protected Member Functions | |
void | parseTextString () const |
Protected Attributes | |
ColourRect | d_textCols |
Colours used for rendering the text. | |
Font * | d_font |
RenderedString | d_renderedString |
RenderedString drawn by this item. | |
bool | d_renderedStringValid |
boolean used to track when item state changes (and needs re-parse) | |
bool | d_textParsingEnabled |
boolean that specifies whether text parsing is enabled for the item. | |
Static Protected Attributes | |
static BasicRenderedStringParser | d_stringParser |
Parser used to produce a final RenderedString from the standard String. | |
static DefaultRenderedStringParser | d_noTagsStringParser |
Parser used when parsing is off. Basically just does linebreaks. |
Class used for textual items in a list box.
void CEGUI::ListboxTextItem::draw | ( | GeometryBuffer & | buffer, |
const Rectf & | targetRect, | ||
float | alpha, | ||
const Rectf * | clipper | ||
) | const [virtual] |
Draw the list box item in its current state.
position | Vecor2 object describing the upper-left corner of area that should be rendered in to for the draw operation. |
alpha | Alpha value to be used when rendering the item (between 0.0f and 1.0f). |
clipper | Rect object describing the clipping rectangle for the draw operation. |
Implements CEGUI::ListboxItem.
const Font* CEGUI::ListboxTextItem::getFont | ( | void | ) | const |
Return a pointer to the font being used by this ListboxTextItem.
This method will try a number of places to find a font to be used. If no font can be found, NULL is returned.
Sizef CEGUI::ListboxTextItem::getPixelSize | ( | void | ) | const [virtual] |
Return the rendered pixel size of this list box item.
Implements CEGUI::ListboxItem.
ColourRect CEGUI::ListboxTextItem::getTextColours | ( | void | ) | const [inline] |
Return the current colours used for text rendering.
bool CEGUI::ListboxTextItem::handleFontRenderSizeChange | ( | const Font *const | font | ) | [virtual] |
Perform any updates needed because the given font's render size has changed.
/note The base implementation just returns false.
font | Pointer to the Font whose render size has changed. |
Reimplemented from CEGUI::ListboxItem.
void CEGUI::ListboxTextItem::setFont | ( | Font * | font | ) |
Set the font to be used by this ListboxTextItem.
font | Font to be used for rendering this item |
void CEGUI::ListboxTextItem::setFont | ( | const String & | font_name | ) |
Set the font to be used by this ListboxTextItem.
font_name | String object containing the name of the Font to be used for rendering this item |
void CEGUI::ListboxTextItem::setText | ( | const String & | text | ) | [virtual] |
set the text string for this list box item.
Note that even if the item does not render text, the text string can still be useful, since it is used for sorting list box items.
text | String object containing the text to set for the list box item. |
Reimplemented from CEGUI::ListboxItem.
void CEGUI::ListboxTextItem::setTextColours | ( | const ColourRect & | cols | ) | [inline] |
Set the colours used for text rendering.
cols | ColourRect object describing the colours to be used. |
void CEGUI::ListboxTextItem::setTextColours | ( | Colour | top_left_colour, |
Colour | top_right_colour, | ||
Colour | bottom_left_colour, | ||
Colour | bottom_right_colour | ||
) |
Set the colours used for text rendering.
top_left_colour | Colour (as ARGB value) to be applied to the top-left corner of each text glyph rendered. |
top_right_colour | Colour (as ARGB value) to be applied to the top-right corner of each text glyph rendered. |
bottom_left_colour | Colour (as ARGB value) to be applied to the bottom-left corner of each text glyph rendered. |
bottom_right_colour | Colour (as ARGB value) to be applied to the bottom-right corner of each text glyph rendered. |
void CEGUI::ListboxTextItem::setTextColours | ( | Colour | col | ) | [inline] |
Set the colours used for text rendering.
col | colour value to be used when rendering. |
References setTextColours().
Referenced by setTextColours().
void CEGUI::ListboxTextItem::setTextParsingEnabled | ( | const bool | enable | ) |
Set whether the the ListboxTextItem will have it's text parsed via the BasicRenderedStringParser or not.
enable |
|
Font* CEGUI::ListboxTextItem::d_font [protected] |
Font used for rendering text.