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

Public Member Functions | Protected Attributes | List of all members
gcn::Gui Class Reference

#include <gui.h>

Public Member Functions

 Gui ()
 
virtual ~Gui ()
 
virtual void setTop (Widget *top)
 
virtual WidgetgetTop () const
 
virtual void setGraphics (Graphics *graphics)
 
virtual GraphicsgetGraphics () const
 
virtual void setInput (Input *input)
 
virtual InputgetInput () const
 
virtual void logic ()
 
virtual void draw ()
 
virtual void draw (Widget *top)
 
virtual void focusNone ()
 
virtual void setTabbingEnabled (bool tabbing)
 
virtual bool isTabbingEnabled ()
 
virtual void setUseDirtyDrawing (bool useDirtyDrawing)
 

Protected Attributes

bool mTopHasMouse
 
bool mTabbing
 
WidgetmTop
 
GraphicsmGraphics
 
InputmInput
 
FocusHandlermFocusHandler
 
bool mUseDirtyDrawing
 

Detailed Description

Introduction

This documentation is mostly intended as a reference to the API. If you want to get started with Guichan, we suggest you check out the programs in the examples directory of the Guichan release.

This documentation is, and will always be, work in progress. If you find any errors, typos or inconsistencies, or if you feel something needs to be explained in more detail - don't hesitate to tell us. Gui core class. Contains a special widget called the top widget. If you want to be able to have more then one Widget in your Gui, the top widget should be a Container.

NOTE: For the Gui to function properly you need to set a Graphics object to use and an Input object to use.

Constructor & Destructor Documentation

◆ Gui()

gcn::Gui::Gui ( )

Constructor.

◆ ~Gui()

gcn::Gui::~Gui ( )
virtual

Destructor.

Member Function Documentation

◆ draw() [1/2]

void gcn::Gui::draw ( )
virtual

Draws the Gui. By calling this funcion all draw functions down in the Gui hierarchy will be called.

◆ draw() [2/2]

void gcn::Gui::draw ( Widget top)
virtual

◆ focusNone()

void gcn::Gui::focusNone ( )
virtual

Focus none of the Widgets in the Gui.

◆ getGraphics()

Graphics * gcn::Gui::getGraphics ( ) const
virtual

Gets the Graphics object used for drawing.

Returns
the Graphics object used for drawing. NULL if no Graphics object has been set.

◆ getInput()

Input * gcn::Gui::getInput ( ) const
virtual

Gets the Input object being used for input handling.

Returns
the Input object used for handling input. NULL if no Input object has been set.

◆ getTop()

Widget * gcn::Gui::getTop ( ) const
virtual

Gets the top Widget.

Returns
the top widget. NULL if no top widget has been set.

◆ isTabbingEnabled()

bool gcn::Gui::isTabbingEnabled ( )
virtual

Checks if tabbing is enabled.

Returns
true if tabbing is enabled.

◆ logic()

void gcn::Gui::logic ( )
virtual

Performs the Gui logic. By calling this function all logic functions down in the Gui heirarchy will be called. What performs in Logic can be just about anything like adjusting a Widgets size or doing some calculations.

NOTE: Logic also deals with user input (Mouse and Keyboard) for Widgets.

◆ setGraphics()

void gcn::Gui::setGraphics ( Graphics graphics)
virtual

Sets the Graphics object to use for drawing.

Parameters
graphicsthe Graphics object to use for drawing.
See also
SDLGraphics, OpenGLGraphics, AllegroGraphics

◆ setInput()

void gcn::Gui::setInput ( Input input)
virtual

Sets the Input object to use for input handling.

Parameters
inputthe Input object to use for input handling.
See also
SDLInput, AllegroInput

◆ setTabbingEnabled()

void gcn::Gui::setTabbingEnabled ( bool  tabbing)
virtual

Toggles the use of the tab key to focus Widgets. By default, tabbing is enabled.

Parameters
tabbingset to false if you want to disable tabbing.

◆ setTop()

void gcn::Gui::setTop ( Widget top)
virtual

Sets the top Widget.

Parameters
topthe top Widget.

◆ setUseDirtyDrawing()

void gcn::Gui::setUseDirtyDrawing ( bool  useDirtyDrawing)
virtual

Member Data Documentation

◆ mFocusHandler

FocusHandler* gcn::Gui::mFocusHandler
protected

◆ mGraphics

Graphics* gcn::Gui::mGraphics
protected

◆ mInput

Input* gcn::Gui::mInput
protected

◆ mTabbing

bool gcn::Gui::mTabbing
protected

◆ mTop

Widget* gcn::Gui::mTop
protected

◆ mTopHasMouse

bool gcn::Gui::mTopHasMouse
protected

◆ mUseDirtyDrawing

bool gcn::Gui::mUseDirtyDrawing
protected

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