$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::FocusHandler Class Reference

#include <focushandler.h>

List of all members.


Public Member Functions

 FocusHandler ()
virtual ~FocusHandler ()
virtual void requestFocus (Widget *widget)
virtual void setFocus (Widget *widget)
virtual void requestDrag (Widget *widget)
virtual void requestModalFocus (Widget *widget)
virtual void releaseModalFocus (Widget *widget)
virtual WidgetgetFocused () const
virtual WidgetgetDragged () const
virtual WidgetgetModalFocused () const
virtual void focusNext ()
virtual void focusPrevious ()
virtual bool hasFocus (const Widget *widget) const
virtual bool isDragged (const Widget *widget) const
virtual void add (Widget *widget)
virtual void remove (Widget *widget)
virtual void focusNone ()
virtual void tabNext ()
virtual void tabPrevious ()
virtual void applyChanges ()
virtual void dragNone ()
virtual void checkHotKey (const KeyInput &keyInput)

Protected Types

typedef std::vector< Widget * > WidgetVector
typedef WidgetVector::iterator WidgetIterator

Protected Attributes

WidgetVector mWidgets
WidgetmFocusedWidget
WidgetmDraggedWidget
WidgetmToBeFocused
WidgetmToBeDragged
WidgetmModalFocusedWidget

Detailed Description

Used to keep track of widget focus. You will probably not have to use the FocusHandler directly to handle focus. Widget has functions for handling focus which uses a FocusHandler. Use them instead.

See also:
Widget::hasFocus

Widget::requestFocus

Widget::setFocusable

Widget::isFocusable

Widget::gotFocus

Widget::lostFocus


Member Typedef Documentation

typedef std::vector<Widget*> gcn::FocusHandler::WidgetVector [protected]

typedef WidgetVector::iterator gcn::FocusHandler::WidgetIterator [protected]


Constructor & Destructor Documentation

gcn::FocusHandler::FocusHandler (  ) 

Constructor.

virtual gcn::FocusHandler::~FocusHandler (  )  [inline, virtual]

Destructor.


Member Function Documentation

void gcn::FocusHandler::requestFocus ( Widget widget  )  [virtual]

Sets focus to a Widget. Widget::lostFocus and Widget::gotFocus will be called.

Parameters:
widget the Widget to focus.

void gcn::FocusHandler::setFocus ( Widget widget  )  [virtual]

Sets focus immediately.

void gcn::FocusHandler::requestDrag ( Widget widget  )  [virtual]

Sets drag to a Widget.

Parameters:
widget the Widget to drag.

void gcn::FocusHandler::requestModalFocus ( Widget widget  )  [virtual]

Sets modal focus to a Widget. If another Widget already has modal focus will an exception be thrown.

Parameters:
widget the Widget to focus modal.
Exceptions:
Exception when another widget already has modal focus.

void gcn::FocusHandler::releaseModalFocus ( Widget widget  )  [virtual]

Releases modal focus if the Widget has modal focus. Otherwise nothing will be done.

Parameters:
widget the Widget to release modal focus for.

Widget * gcn::FocusHandler::getFocused (  )  const [virtual]

Gets the Widget with focus.

Returns:
the Widget with focus. NULL will be returned if no Widget has focus.

Widget * gcn::FocusHandler::getDragged (  )  const [virtual]

Gets the widget that is dragged.

Returns:
the widget that is dragged. NULL will be returned if no Widget is dragged.

Widget * gcn::FocusHandler::getModalFocused (  )  const [virtual]

Gets the Widget with modal focus.

Returns:
the Widget with modal focus. NULL will be returned if no Widget has modal focus.

void gcn::FocusHandler::focusNext (  )  [virtual]

Focuses the next Widget. If no Widget has focus the first Widget gets focus. The order in which the Widgets are focused depends on the order you add them to the GUI.

void gcn::FocusHandler::focusPrevious (  )  [virtual]

Focuses the previous Widget. If no Widget has focus the first Widget gets focus. The order in which the widgets are focused depends on the order you add them to the GUI.

bool gcn::FocusHandler::hasFocus ( const Widget widget  )  const [virtual]

Checks if a Widget has focus.

Parameters:
widget widget to check if it has focus..
Returns:
true if the widget has focus.

bool gcn::FocusHandler::isDragged ( const Widget widget  )  const [virtual]

Checks if a widget is being dragged

Parameters:
widget the Widget to check if it is being dragged.
Returns:
true if the widget is being dragged.

void gcn::FocusHandler::add ( Widget widget  )  [virtual]

Adds a widget to the FocusHandler.

Parameters:
widget the widget to add.

void gcn::FocusHandler::remove ( Widget widget  )  [virtual]

Removes a widget from the FocusHandler.

Parameters:
widget the widget to remove.

void gcn::FocusHandler::focusNone (  )  [virtual]

Focuses nothing.

void gcn::FocusHandler::tabNext (  )  [virtual]

Focuses the next Widget which allows tab in unless current focused Widget disallows tab out.

void gcn::FocusHandler::tabPrevious (  )  [virtual]

Focuses the previous Widget which allows tab in unless current focused Widget disallows tab out.

void gcn::FocusHandler::applyChanges (  )  [virtual]

Applies the changes.

void gcn::FocusHandler::dragNone (  )  [virtual]

Drag nothing.

void gcn::FocusHandler::checkHotKey ( const KeyInput keyInput  )  [virtual]

Check if a hot key was pressed.


Member Data Documentation


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.