#include <focushandler.hpp>
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.
Definition at line 80 of file focushandler.hpp.
Public Member Functions | |
FocusHandler () | |
Constructor. | |
virtual | ~FocusHandler () |
Destructor. | |
virtual void | requestFocus (Widget *widget) |
Sets focus to a Widget. | |
virtual void | requestDrag (Widget *widget) |
Sets drag to a Widget. | |
virtual void | requestModalFocus (Widget *widget) |
Sets modal focus to a Widget. | |
virtual void | releaseModalFocus (Widget *widget) |
Releases modal focus if the Widget has modal focus. | |
virtual Widget * | getFocused () const |
Gets the Widget with focus. | |
virtual Widget * | getDragged () const |
Gets the widget that is dragged. | |
virtual Widget * | getModalFocused () const |
Gets the Widget with modal focus. | |
virtual void | focusNext () |
Focuses the next Widget. | |
virtual void | focusPrevious () |
Focuses the previous Widget. | |
virtual bool | hasFocus (const Widget *widget) const |
Checks if a Widget has focus. | |
virtual bool | isDragged (const Widget *widget) const |
Checks if a widget is being dragged. | |
virtual void | add (Widget *widget) |
Adds a widget to the FocusHandler. | |
virtual void | remove (Widget *widget) |
Removes a widget from the FocusHandler. | |
virtual void | focusNone () |
Focuses nothing. | |
virtual void | tabNext () |
Focuses the next Widget which allows tab in unless current focused Widget disallows tab out. | |
virtual void | tabPrevious () |
Focuses the previous Widget which allows tab in unless current focused Widget disallows tab out. | |
virtual void | applyChanges () |
Applies the changes. | |
virtual void | dragNone () |
Drag nothing. | |
Protected Types | |
typedef std::vector< Widget * > | WidgetVector |
typedef WidgetVector::iterator | WidgetIterator |
Protected Attributes | |
WidgetVector | mWidgets |
Widget * | mFocusedWidget |
Widget * | mDraggedWidget |
Widget * | mToBeFocused |
Widget * | mToBeDragged |
Widget * | mModalFocusedWidget |
|
Adds a widget to the FocusHandler.
Definition at line 246 of file focushandler.cpp. Referenced by gcn::Widget::_setFocusHandler(). |
|
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. Definition at line 126 of file focushandler.cpp. References gcn::Widget::gotFocus(), and gcn::Widget::lostFocus(). |
|
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. Definition at line 178 of file focushandler.cpp. References gcn::Widget::gotFocus(), and gcn::Widget::lostFocus(). |
|
Gets the widget that is dragged.
Definition at line 116 of file focushandler.cpp. Referenced by gcn::Gui::logic(). |
|
Gets the Widget with focus.
Definition at line 111 of file focushandler.cpp. Referenced by gcn::DropDown::_keyInputMessage(), and gcn::Gui::logic(). |
|
Gets the Widget with modal focus.
Definition at line 121 of file focushandler.cpp. Referenced by gcn::Widget::_keyInputMessage(), gcn::Widget::_mouseInputMessage(), and gcn::Widget::hasModalFocus(). |
|
Checks if a Widget has focus.
Definition at line 236 of file focushandler.cpp. Referenced by gcn::Widget::hasFocus(), and remove(). |
|
Checks if a widget is being dragged.
Definition at line 241 of file focushandler.cpp. Referenced by gcn::Widget::isDragged(). |
|
Releases modal focus if the Widget has modal focus. Otherwise nothing will be done.
Definition at line 103 of file focushandler.cpp. Referenced by gcn::Widget::releaseModalFocus(). |
|
Removes a widget from the FocusHandler.
Definition at line 251 of file focushandler.cpp. References hasFocus(). Referenced by gcn::Widget::_setFocusHandler(), gcn::Widget::removeActionListener(), gcn::Widget::removeKeyListener(), and gcn::Widget::removeMouseListener(). |
|
Sets drag to a Widget.
Definition at line 78 of file focushandler.cpp. Referenced by gcn::Widget::_mouseInputMessage(). |
|
Sets focus to a Widget. Widget::lostFocus and Widget::gotFocus will be called.
Definition at line 73 of file focushandler.cpp. Referenced by gcn::DropDown::dropDown(), and gcn::Widget::requestFocus(). |
|
Sets modal focus to a Widget. If another Widget already has modal focus will an exception be thrown.
Definition at line 83 of file focushandler.cpp. References dragNone(), focusNone(), and gcn::Widget::hasModalFocus(). Referenced by gcn::Widget::requestModalFocus(). |