Hosting courtesy of Sourceforge

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

Menu::DefaultMenuItem Class Reference

#include <MenuManager.h>

Inheritance diagram for Menu::DefaultMenuItem:

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

Collaboration graph
[legend]
List of all members.

Public Methods

virtual void select ()
virtual void deselect ()
void draw (SDL_Surface *surf, TTF_Font *font, int centerX, int centerY)

Protected Methods

 DefaultMenuItem (const std::string &name, const SDL_Color &selected=DEFAULT_SELECTED_COL, const SDL_Color &unselected=DEFAULT_DESELECTED_COL)
virtual const SDL_Color & getCurrentColor ()

Detailed Description

Partial implementation of MenuItem, implementing some useful behavior. It implements the text rendering in draw() as well as well as manages the current color of the item.

Definition at line 83 of file MenuManager.h.


Constructor & Destructor Documentation

virtual Menu::DefaultMenuItem::~DefaultMenuItem   [virtual]
 

Definition at line 89 of file MenuManager.h.

DefaultMenuItem::DefaultMenuItem const std::string &    n,
const SDL_Color &    selected = DEFAULT_SELECTED_COL,
const SDL_Color &    deselected = DEFAULT_DESELECTED_COL
[protected]
 

Parameters:
name  the name of the item, rendered on screen in draw()
selected  color of the rendered text when selected
unselected  color of the rendered text when unselected

Definition at line 111 of file MenuManager.cpp.


Member Function Documentation

void DefaultMenuItem::deselect   [virtual]
 

Changes color to deselected

Reimplemented from Menu::MenuItem.

Definition at line 123 of file MenuManager.cpp.

void DefaultMenuItem::draw SDL_Surface *    surf,
TTF_Font *    font,
int    centerX,
int    centerY
[virtual]
 

Renders the item's name to surf, centered about centerX and centerY

Reimplemented from Menu::MenuItem.

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

Definition at line 127 of file MenuManager.cpp.

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

Returns:
the item's current color, varies based on whether or not the item is selected

Reimplemented in Menu::InputGetter.

Definition at line 140 of file MenuManager.cpp.

void DefaultMenuItem::select   [virtual]
 

Changes color to selected

Reimplemented from Menu::MenuItem.

Definition at line 119 of file MenuManager.cpp.


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