$treeview $search $mathjax
Stratagus  2.2.6
$projectbrief
$projectbrief
$searchbox
-->
         _________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
           Stratagus - A free fantasy real time strategy game engine

gcn::Label Class Reference

#include <label.h>

Inheritance diagram for gcn::Label:

gcn::Widget

List of all members.


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)

Detailed Description

A label for displaying text.

Constructor & Destructor Documentation

gcn::Label::Label (  ) 

Constructor.

gcn::Label::Label ( const std::string &  caption  ) 

Constructor.

Parameters:
caption the Label caption.


Member Function Documentation

const std::string & gcn::Label::getCaption (  )  const [virtual]

Gets the Label caption.

Returns:
the Label caption.

void gcn::Label::setCaption ( const std::string &  caption  )  [virtual]

Sets the Label caption.

Parameters:
caption the Label caption.

void gcn::Label::setAlignment ( unsigned int  alignment  )  [virtual]

Sets the alignment for the caption.

Parameters:
alignment Graphics::LEFT, Graphics::CENTER or Graphics::RIGHT.
See also:
Graphics

unsigned int gcn::Label::getAlignment (  )  [virtual]

Gets the alignment for the caption.

Returns:
alignment of caption.

void gcn::Label::adjustSize (  )  [virtual]

Adjusts the Label size to fit the font size.

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.

Parameters:
graphics a Graphics object to draw with.

Implements gcn::Widget.

void gcn::Label::drawBorder ( 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.

Parameters:
graphics a Graphics object to draw with.

Reimplemented from gcn::Widget.


The documentation for this class was generated from the following files:
(C) Copyright 1998-2011 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.