#include <textpreview.h>
Definition at line 32 of file textpreview.h.
Public Member Functions | |
TextPreview (const std::string &text) | |
void | setTextColor (const gcn::Color *color) |
Sets the color the text is printed in. | |
void | useTextAlpha (bool alpha) |
Sets the text to use the set alpha value. | |
void | setTextBGColor (const gcn::Color *color) |
Sets the color the text background is drawn in. | |
void | setBGColor (const gcn::Color *color) |
Sets the background color of the widget. | |
void | setFont (gcn::Font *font) |
Sets the font to render the text in. | |
void | setShadow (bool shadow) |
Sets whether to use a shadow while rendering. | |
void | setOutline (bool outline) |
Sets whether to use an outline while rendering. | |
void | draw (gcn::Graphics *graphics) |
Widget's draw method. | |
void | setOpaque (bool opaque) |
Set opacity for this widget (whether or not to show the background color). | |
bool | isOpaque () const |
Gets opacity for this widget (whether or not the background color is shown below the widget). | |
Private Attributes | |
gcn::Font * | mFont |
std::string | mText |
const gcn::Color * | mTextColor |
const gcn::Color * | mBGColor |
const gcn::Color * | mTextBGColor |
bool | mTextAlpha |
bool | mOpaque |
bool | mShadow |
bool | mOutline |
Static Private Attributes | |
static float | mAlpha = 1.0 |
TextPreview::TextPreview | ( | const std::string & | text | ) |
Definition at line 35 of file textpreview.cpp.
void TextPreview::setTextColor | ( | const gcn::Color * | color | ) | [inline] |
Sets the color the text is printed in.
color | the color to set |
Definition at line 42 of file textpreview.h.
void TextPreview::useTextAlpha | ( | bool | alpha | ) | [inline] |
Sets the text to use the set alpha value.
alpha | whether to use alpha values for the text or not |
Definition at line 52 of file textpreview.h.
void TextPreview::setTextBGColor | ( | const gcn::Color * | color | ) | [inline] |
Sets the color the text background is drawn in.
This is only the rectangle directly behind the text, not to full widget.
color | the color to set |
Definition at line 63 of file textpreview.h.
void TextPreview::setBGColor | ( | const gcn::Color * | color | ) | [inline] |
Sets the background color of the widget.
color | the color to set |
Definition at line 73 of file textpreview.h.
void TextPreview::setFont | ( | gcn::Font * | font | ) | [inline] |
Sets the font to render the text in.
font | the font to use. |
Definition at line 83 of file textpreview.h.
void TextPreview::setShadow | ( | bool | shadow | ) | [inline] |
Sets whether to use a shadow while rendering.
shadow | true, if a shadow is wanted, false else |
Definition at line 93 of file textpreview.h.
void TextPreview::setOutline | ( | bool | outline | ) | [inline] |
Sets whether to use an outline while rendering.
outline | true, if an outline is wanted, false else |
Definition at line 103 of file textpreview.h.
void TextPreview::draw | ( | gcn::Graphics * | graphics | ) |
Widget's draw method.
Does the actual job.
graphics | graphics to draw into |
Definition at line 46 of file textpreview.cpp.
void TextPreview::setOpaque | ( | bool | opaque | ) | [inline] |
Set opacity for this widget (whether or not to show the background color).
opaque | Whether the widget should be opaque or not |
Definition at line 121 of file textpreview.h.
bool TextPreview::isOpaque | ( | ) | const [inline] |
Gets opacity for this widget (whether or not the background color is shown below the widget).
Definition at line 127 of file textpreview.h.
gcn::Font* TextPreview::mFont [private] |
Definition at line 130 of file textpreview.h.
std::string TextPreview::mText [private] |
Definition at line 131 of file textpreview.h.
const gcn::Color* TextPreview::mTextColor [private] |
Definition at line 132 of file textpreview.h.
const gcn::Color* TextPreview::mBGColor [private] |
Definition at line 133 of file textpreview.h.
const gcn::Color* TextPreview::mTextBGColor [private] |
Definition at line 134 of file textpreview.h.
float TextPreview::mAlpha = 1.0 [static, private] |
Definition at line 135 of file textpreview.h.
bool TextPreview::mTextAlpha [private] |
Definition at line 136 of file textpreview.h.
bool TextPreview::mOpaque [private] |
Definition at line 137 of file textpreview.h.
bool TextPreview::mShadow [private] |
Definition at line 138 of file textpreview.h.
bool TextPreview::mOutline [private] |
Definition at line 139 of file textpreview.h.