#include <label.hpp>
Inheritance diagram for gcn::Label:

Definition at line 71 of file label.hpp.
Public Member Functions | |
| void | adjustSize () |
| Adjusts the label's size to fit the caption. | |
| virtual void | draw (Graphics *graphics) |
| Draws the widget. | |
| Graphics::Alignment | getAlignment () const |
| Gets the alignment of the caption. | |
| const std::string & | getCaption () const |
| Gets the caption of the label. | |
| Label (const std::string &caption) | |
| Constructor. | |
| Label () | |
| Constructor. | |
| void | setAlignment (Graphics::Alignment alignment) |
| Sets the alignment of the caption. | |
| void | setCaption (const std::string &caption) |
| Sets the caption of the label. | |
Protected Attributes | |
| Graphics::Alignment | mAlignment |
| Holds the alignment of the caption. | |
| std::string | mCaption |
| Holds the caption of the label. | |
| gcn::Label::Label | ( | const std::string & | caption | ) |
Constructor.
The label will be automatically resized to fit the caption.
| caption | The caption of the label. |
Definition at line 74 of file label.cpp.
References gcn::Widget::getFont(), gcn::Widget::getHeight(), gcn::Widget::getWidth(), gcn::Graphics::LEFT, mAlignment, mCaption, gcn::Widget::setHeight(), and gcn::Widget::setWidth().
| void gcn::Label::draw | ( | Graphics * | graphics | ) | [virtual] |
Draws the widget.
It is called by the parent widget when it is time for the widget to draw itself. The graphics object is set up so that all drawing is relative to the widget, i.e coordinate (0,0) is the top left corner of the widget. It is not possible to draw outside of a widget's dimension.
| graphics | aA graphics object to draw with. |
Implements gcn::Widget.
Definition at line 103 of file label.cpp.
References gcn::Graphics::CENTER, gcn::Graphics::drawText(), getAlignment(), getCaption(), gcn::Widget::getFont(), gcn::Widget::getForegroundColor(), gcn::Font::getHeight(), gcn::Widget::getHeight(), gcn::Widget::getWidth(), gcn::Graphics::LEFT, gcn::Graphics::RIGHT, gcn::Graphics::setColor(), and gcn::Graphics::setFont().
| Graphics::Alignment gcn::Label::getAlignment | ( | ) | const |
Gets the alignment of the caption.
The alignment is relative to the center of the label.
Definition at line 98 of file label.cpp.
References mAlignment.
Referenced by draw().
| const std::string & gcn::Label::getCaption | ( | ) | const |
Gets the caption of the label.
Definition at line 83 of file label.cpp.
References mCaption.
Referenced by adjustSize(), and draw().
| void gcn::Label::setAlignment | ( | Graphics::Alignment | alignment | ) |
Sets the alignment of the caption.
The alignment is relative to the center of the label.
| alignemnt | The alignment of the caption of the label. |
Definition at line 93 of file label.cpp.
References mAlignment.
| void gcn::Label::setCaption | ( | const std::string & | caption | ) |
Sets the caption of the label.
It's advisable to call adjustSize after setting of the caption to adjust the label's size to fit the caption.
| caption | The caption of the label. |
Definition at line 88 of file label.cpp.
References mCaption.
Referenced by gcn::Tab::setCaption().
1.5.2