Mana
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
FocusHandler Class Reference

The focus handler. More...

#include <focushandler.h>

Inheritance diagram for FocusHandler:

Public Member Functions

void requestModalFocus (gcn::Widget *widget) override
 Sets modal focus to a widget.
 
void releaseModalFocus (gcn::Widget *widget) override
 Releases modal focus of a widget.
 
void remove (gcn::Widget *widget) override
 Removes a widget from the focus handler.
 
void tabNext () override
 Overloaded to allow windows to move to the top when one of their widgets is tabbed to when tabbing through focusable elements.
 
void tabPrevious () override
 

Private Member Functions

void checkForWindow ()
 Checks to see if the widget tabbed to is in a window, and if it is, it requests the window be moved to the top.
 

Private Attributes

std::list< gcn::Widget * > mModalStack
 Stack of widgets that have requested modal forcus.
 

Detailed Description

The focus handler.

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 33 of file focushandler.h.

Member Function Documentation

◆ checkForWindow()

void FocusHandler::checkForWindow ( )
private

Checks to see if the widget tabbed to is in a window, and if it is, it requests the window be moved to the top.

Definition at line 80 of file focushandler.cpp.

◆ releaseModalFocus()

void FocusHandler::releaseModalFocus ( gcn::Widget *  widget)
override

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 40 of file focushandler.cpp.

◆ remove()

void FocusHandler::remove ( gcn::Widget *  widget)
override

Removes a widget from the focus handler.

Also makes sure no dangling pointers remain in modal focus stack.

Definition at line 59 of file focushandler.cpp.

◆ requestModalFocus()

void FocusHandler::requestModalFocus ( gcn::Widget *  widget)
override

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 26 of file focushandler.cpp.

◆ tabNext()

void FocusHandler::tabNext ( )
override

Overloaded to allow windows to move to the top when one of their widgets is tabbed to when tabbing through focusable elements.

Definition at line 66 of file focushandler.cpp.

◆ tabPrevious()

void FocusHandler::tabPrevious ( )
override

Definition at line 73 of file focushandler.cpp.

Member Data Documentation

◆ mModalStack

std::list<gcn::Widget*> FocusHandler::mModalStack
private

Stack of widgets that have requested modal forcus.

Definition at line 73 of file focushandler.h.


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