____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
A futuristic real-time strategy game.
This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project.
Distributed under the "GNU General Public License"#include <label.h>

Public Member Functions | |
| Label () | |
| Label (const std::string &caption) | |
| virtual const std::string & | getCaption () const |
| virtual void | setCaption (const std::string &caption) |
| virtual void | setAlignment (unsigned int alignment) |
| virtual unsigned int | getAlignment () |
| virtual void | adjustSize () |
| virtual void | draw (Graphics *graphics) |
| virtual void | drawBorder (Graphics *graphics) |
Definition at line 68 of file label.h.
| gcn::Label::Label | ( | ) |
| gcn::Label::Label | ( | const std::string & | caption | ) |
Constructor.
| caption | the Label caption. |
Definition at line 69 of file label.cpp.
References gcn::Widget::getFont(), gcn::Widget::getHeight(), gcn::Widget::getWidth(), gcn::Graphics::LEFT, gcn::Widget::setHeight(), and gcn::Widget::setWidth().
| const std::string & gcn::Label::getCaption | ( | ) | const [virtual] |
| void gcn::Label::setCaption | ( | const std::string & | caption | ) | [virtual] |
Sets the Label caption.
| caption | the Label caption. |
Definition at line 83 of file label.cpp.
References gcn::Widget::setDirty().
| void gcn::Label::setAlignment | ( | unsigned int | alignment | ) | [virtual] |
Sets the alignment for the caption.
| alignment | Graphics::LEFT, Graphics::CENTER or Graphics::RIGHT. |
| unsigned int gcn::Label::getAlignment | ( | ) | [virtual] |
| void gcn::Label::adjustSize | ( | ) | [virtual] |
Adjusts the Label size to fit the font size.
Definition at line 148 of file label.cpp.
References getCaption(), gcn::Widget::getFont(), gcn::Widget::getHeight(), gcn::Widget::getWidth(), 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 Widgets dimension.
| graphics | a Graphics object to draw with. |
Implements gcn::Widget.
Definition at line 99 of file label.cpp.
References gcn::Graphics::CENTER, gcn::Graphics::drawText(), GCN_EXCEPTION, 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().
| void gcn::Label::drawBorder | ( | Graphics * | graphics | ) | [virtual] |
Draws a the Widget border. A border is drawn around a Widget. The width and height of the border is therefore the Widgets height+2*bordersize. Think of a painting that has a certain size, the border surrounds the painting.
| graphics | a Graphics object to draw with. |
Reimplemented from gcn::Widget.
Definition at line 124 of file label.cpp.
References gcn::Color::a, gcn::Graphics::drawLine(), gcn::Widget::getBaseColor(), gcn::Widget::getBorderSize(), gcn::Widget::getHeight(), gcn::Widget::getWidth(), and gcn::Graphics::setColor().
1.5.6