Hosting courtesy of Sourceforge

SourceForge Logo
Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Menu::InputGetter Class Reference

#include <MenuManager.h>

Inheritance diagram for Menu::InputGetter:

Inheritance graph
[legend]
Collaboration diagram for Menu::InputGetter:

Collaboration graph
[legend]
List of all members.

Public Methods

MenuHandleResult handleEvent (SDL_Event *e)

Protected Methods

 InputGetter (const std::string &name, const SDL_Color &selectedCol=DEFAULT_SELECTED_COL, const SDL_Color &unselectedCol=DEFAULT_DESELECTED_COL, const SDL_Color &activeCol=DEFAULT_ACTIVE_COL)
const SDL_Color & getCurrentColor ()
bool isActive ()

Detailed Description

Abstract class for MenuItem that get input (directly change a variable). Such items have another state, rather than just selected and deselected, they also can be active. Active implies that the the input is currently being modified, and occurs (by this implementation, at least) when the enter key was pressed while the item was selected. It leaves this state when the escape was pressed, and is then selected but inactive. This additional state is neccesary to determine whether keypresses should be handled by the MenuManager, or whether it should change the input.

Definition at line 182 of file MenuManager.h.


Constructor & Destructor Documentation

InputGetter::InputGetter const std::string &    n,
const SDL_Color &    s = DEFAULT_SELECTED_COL,
const SDL_Color &    u = DEFAULT_DESELECTED_COL,
const SDL_Color &    a = DEFAULT_ACTIVE_COL
[protected]
 

Parameters:
name  title of menu
activeCol  color of the menu when active

Definition at line 191 of file MenuManager.cpp.


Member Function Documentation

const SDL_Color & InputGetter::getCurrentColor   [protected, virtual]
 

Returns:
currentColor, if !isActive() returns DefaultMenuItem::getCurrentColor(), else returns activeCol

Reimplemented from Menu::DefaultMenuItem.

Definition at line 217 of file MenuManager.cpp.

MenuHandleResult InputGetter::handleEvent SDL_Event *    e [virtual]
 

When inactive, becomes active upon press of enter and returns EVENT_HANDLED, else returns EVENT_PASSED When active, becomes inactive upon press of esc and returns EVENT_HANDLED, else returns EVENT_PASSED

Reimplemented from Menu::MenuItem.

Reimplemented in Menu::KeyInputter, and Menu::IntInputter.

Definition at line 197 of file MenuManager.cpp.

bool Menu::InputGetter::isActive   [protected]
 

Returns:
true iff active,
See also:
InputGetter

Definition at line 199 of file MenuManager.h.


The documentation for this class was generated from the following files:
Generated on Tue May 21 07:26:56 2002 for BomberLAN by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001