#include <focushandler.h>
This focus handler does exactly the same as the Guichan focus handler, but keeps a stack of modal widgets to be able to handle multiple modal focus requests.
Definition at line 34 of file focushandler.h.
Public Member Functions | |
void | requestModalFocus (gcn::Widget *widget) |
Sets modal focus to a widget. | |
void | releaseModalFocus (gcn::Widget *widget) |
Releases modal focus of a widget. | |
void | remove (gcn::Widget *widget) |
Removes a widget from the focus handler. | |
Private Attributes | |
std::list< gcn::Widget * > | mModalStack |
Stack of widgets that have requested modal forcus. |
void FocusHandler::requestModalFocus | ( | gcn::Widget * | widget | ) |
Sets modal focus to a widget.
When there is already a modal widget then that widget loses modal focus and will regain it after this widget releases his modal focus.
Definition at line 24 of file focushandler.cpp.
void FocusHandler::releaseModalFocus | ( | gcn::Widget * | widget | ) |
Releases modal focus of a widget.
When this widget had modal focus and there are other widgets that had also requested modal focus, then modal focus will be transfered to the last of those.
Definition at line 38 of file focushandler.cpp.
void FocusHandler::remove | ( | gcn::Widget * | widget | ) |
Removes a widget from the focus handler.
Also makes sure no dangling pointers remain in modal focus stack.
Definition at line 57 of file focushandler.cpp.
std::list<gcn::Widget*> FocusHandler::mModalStack [private] |