UI::Menu Class Reference

A graphical menu for the game. More...

#include <Menu.h>

Inheritance diagram for UI::Menu:

UI::PauseMenu List of all members.

Public Member Functions

 Menu ()
virtual ~Menu ()
void insert_item (MenuItem *item)
 Add an item to those shown on the menu.
void draw ()
 Draw the menu on the screen.
void take_input (Engine::InputReport &report)
 Update the menu when input devices report menu events.
bool want_to_quit ()
 return true if we would like the menu to close.

Protected Member Functions

unsigned int get_total_width ()

Protected Attributes

std::vector< MenuItem * > items
unsigned int max_width
std::size_t selected_item
Menuactive_sub_menu
Menuparent
bool quit

Detailed Description

A graphical menu for the game.

Definition at line 24 of file Menu.h.


Constructor & Destructor Documentation

UI::Menu::Menu (  ) 

Definition at line 21 of file Menu.cpp.

UI::Menu::~Menu (  )  [virtual]

Definition at line 30 of file Menu.cpp.


Member Function Documentation

void UI::Menu::draw (  ) 

Draw the menu on the screen.

Definition at line 60 of file Menu.cpp.

unsigned int UI::Menu::get_total_width (  )  [protected]

Definition at line 149 of file Menu.cpp.

void UI::Menu::insert_item ( MenuItem item  ) 

Add an item to those shown on the menu.

Parameters:
item The MenuItem to add. It must remain alive until draw and take_input are no longer called.

Definition at line 34 of file Menu.cpp.

void UI::Menu::take_input ( Engine::InputReport report  ) 

Update the menu when input devices report menu events.

Definition at line 81 of file Menu.cpp.

bool UI::Menu::want_to_quit (  ) 

return true if we would like the menu to close.

This occurs when the user tries back out of the menu.

Definition at line 144 of file Menu.cpp.


Member Data Documentation

Menu* UI::Menu::active_sub_menu [protected]

Definition at line 47 of file Menu.h.

std::vector<MenuItem *> UI::Menu::items [protected]

Definition at line 44 of file Menu.h.

unsigned int UI::Menu::max_width [protected]

Definition at line 45 of file Menu.h.

Menu* UI::Menu::parent [protected]

Definition at line 48 of file Menu.h.

bool UI::Menu::quit [protected]

Definition at line 49 of file Menu.h.

std::size_t UI::Menu::selected_item [protected]

Definition at line 46 of file Menu.h.


The documentation for this class was generated from the following files:
Get Racer at SourceForge.net. Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:19 2010 by Doxygen version 1.4.7 for Racer version svn335.