GClasses
|
A text label.
#include <GWidgets.h>
Public Member Functions | |
GWidgetTextLabel (GWidgetGroup *pParent, int x, int y, int w, int h, const char *szText, unsigned int c=0xffffffff, unsigned int background=0x00000000, float fontSize=1.0f) | |
virtual | ~GWidgetTextLabel () |
unsigned int | backgroundColor () |
Gets the text color. More... | |
virtual void | draw (GImage *pCanvas, int x, int y) |
Draws this widget on pCanvas at (x,y) More... | |
unsigned int | foregroundColor () |
Gets the text color. More... | |
void | setAlignLeft (bool bAlignLeft) |
Specifies whether the text is left-justified (true) or right-justified (false) More... | |
void | setBackgroundColor (unsigned int c) |
The default background color is transparent. If you want an opaque or semi-opaque background then you should call this method. More... | |
void | setFontSize (float f) |
Sets the size of the font. More... | |
void | setForegroundColor (unsigned int c) |
Sets the text color. More... | |
void | setText (const char *szText) |
Sets the label text. More... | |
const std::string & | text () |
Returns the label text. More... | |
virtual WidgetType | type () |
void | wrap () |
Insert newline characters into the current text at good locations to make the text wrap within its rect. More... | |
Public Member Functions inherited from GClasses::GWidgetAtomic | |
GWidgetAtomic (GWidgetGroup *pParent, int x, int y, int w, int h) | |
virtual | ~GWidgetAtomic () |
virtual bool | isAtomic () |
virtual bool | isClickable () |
virtual void | onChar (char c) |
virtual void | onGetFocus () |
virtual void | onLoseFocus () |
virtual void | onMouseMove (int dx, int dy) |
virtual void | onSpecialKey (int key) |
Public Member Functions inherited from GClasses::GWidget | |
GWidget (GWidgetGroup *m_pParent, int x, int y, int w, int h) | |
virtual | ~GWidget () |
int | id () |
GWidgetGroup * | parent () |
GRect * | rect () |
void | setPos (int x, int y) |
Protected Member Functions | |
virtual void | grab (int button, int x, int y) |
virtual void | release (int button) |
Protected Attributes | |
bool | m_alignLeft |
bool | m_bGrabbed |
unsigned int | m_cBackground |
unsigned int | m_cForeground |
float | m_fontSize |
std::string | m_text |
Protected Attributes inherited from GClasses::GWidget | |
GWidgetCommon * | m_common |
int | m_nID |
GWidgetGroup * | m_pParent |
GRect | m_rect |
Additional Inherited Members | |
Public Types inherited from GClasses::GWidget |
GClasses::GWidgetTextLabel::GWidgetTextLabel | ( | GWidgetGroup * | pParent, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
const char * | szText, | ||
unsigned int | c = 0xffffffff , |
||
unsigned int | background = 0x00000000 , |
||
float | fontSize = 1.0f |
||
) |
|
virtual |
|
inline |
Gets the text color.
|
virtual |
Draws this widget on pCanvas at (x,y)
Implements GClasses::GWidget.
|
inline |
Gets the text color.
|
protectedvirtual |
Reimplemented from GClasses::GWidgetAtomic.
|
protectedvirtual |
Reimplemented from GClasses::GWidgetAtomic.
void GClasses::GWidgetTextLabel::setAlignLeft | ( | bool | bAlignLeft | ) |
Specifies whether the text is left-justified (true) or right-justified (false)
void GClasses::GWidgetTextLabel::setBackgroundColor | ( | unsigned int | c | ) |
The default background color is transparent. If you want an opaque or semi-opaque background then you should call this method.
|
inline |
Sets the size of the font.
void GClasses::GWidgetTextLabel::setForegroundColor | ( | unsigned int | c | ) |
Sets the text color.
void GClasses::GWidgetTextLabel::setText | ( | const char * | szText | ) |
Sets the label text.
|
inline |
Returns the label text.
|
inlinevirtual |
Implements GClasses::GWidget.
void GClasses::GWidgetTextLabel::wrap | ( | ) |
Insert newline characters into the current text at good locations to make the text wrap within its rect.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |