____                _       __
    / __ )____  _____   | |     / /___ ___________
   / __  / __ \/ ___/   | | /| / / __ `/ ___/ ___/
  / /_/ / /_/ (__  )    | |/ |/ / /_/ / /  (__  )
 /_____/\____/____/     |__/|__/\__,_/_/  /____/

       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"

gcn::Icon Class Reference

#include <icon.h>

Inheritance diagram for gcn::Icon:

gcn::Widget ImageWidget

List of all members.

Public Member Functions

 Icon (Image *image)
virtual void draw (Graphics *graphics)
virtual void drawBorder (Graphics *graphics)


Detailed Description

An Icon for displaying images.

Definition at line 67 of file icon.h.


Constructor & Destructor Documentation

gcn::Icon::Icon ( Image image  ) 

Constructor.

Parameters:
image an Image to display.

Definition at line 65 of file icon.cpp.

References gcn::Image::getHeight(), gcn::Image::getWidth(), gcn::Widget::setHeight(), and gcn::Widget::setWidth().


Member Function Documentation

void gcn::Icon::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.

Definition at line 72 of file icon.cpp.

References gcn::Graphics::drawImage().

void gcn::Icon::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.

Parameters:
graphics a Graphics object to draw with.

Reimplemented from gcn::Widget.

Definition at line 78 of file icon.cpp.

References gcn::Color::a, gcn::Graphics::drawLine(), gcn::Widget::getBaseColor(), gcn::Widget::getBorderSize(), gcn::Widget::getHeight(), gcn::Widget::getWidth(), and gcn::Graphics::setColor().


The documentation for this class was generated from the following files:

Generated on Sat Feb 21 00:28:27 2009 for Bos Wars by  doxygen 1.5.6