Main Page | Modules | Namespace List | Class Hierarchy | Compound List | File List | Compound Members | File Members

Menu Class Reference
[Control]

Menu control and display object. More...

#include <menu.h>

Inheritance diagram for Menu:

AdsoLuaInterface Overlay KeyboardHandler List of all members.

Public Member Functions

int event (int)
bool onKeyEvent (SDLKey key)
 Called on keyboard events.

void show ()
void hide ()
void setPage (int p)
int getPage ()
void setCondition (int n, bool c)
int isHidden ()
void draw ()
 Draw overlay object.

void setText (char *t)
 Set text for all menu pages.

void setPageText (const char *t, int page, int line)
 Update text for menu page page starting at line line.

void clearPage (int page, int line, int count)
void setVariable (char *name, const char *value)
 Set value of menu variable name.

void bindVariable (char *name, const char *str)
 Bind str to menu variable name.

void setCursor (int p, int l, int c)
void pushCursorPos (int p, int l, int c)
void popCursorPos ()
void mprint (const char *fmt,...)
 Update menu text from cursor position.

 Menu ()

Public Attributes

AdsoLua menuCtrl

Detailed Description

Menu control and display object.

The menu system implements the overall userinterface to the application. The menu consists of a number of text pages that may be displayed as Overlay objects. The pages are preloaded at start-up from the file scripts/menu.txt. The pages may be used statically to display information (such as the "Mission objective" page) or they may be updated dynamically to implement dialog-like user inteface (such as the NetLink page). The Menu class does not implement any menu content functionality. All content functionality is implemented in the Lua script scripts/menu.lua. The Lua script defines how the menu system responds to user input (and certain application events). This division makes it possible to change the user interface without recomplilation.

Menu text is regular text with a few escape code listed below:

\V<var-name>
Menu variable reference.
\L
Display large text
\Cn
Display conditional text (where 'n' is the condition number). Conditional text is dimmed if the condition is false (see setCondition()).
\Z
Zenter align text.
\E
Emphasis text (use in pairs to emphasis a word or part of a line).


Constructor & Destructor Documentation

Menu::Menu  ) 
 


Member Function Documentation

void Menu::bindVariable char *  name,
const char *  str
 

Bind str to menu variable name.

void Menu::clearPage int  page,
int  line,
int  count
 

void Menu::draw  )  [virtual]
 

Draw overlay object.

Implements Overlay.

int Menu::event int   ) 
 

int Menu::getPage  )  [inline]
 

void Menu::hide  ) 
 

int Menu::isHidden  )  [inline]
 

void Menu::mprint const char *  fmt,
... 
 

Update menu text from cursor position.

bool Menu::onKeyEvent SDLKey  key  )  [virtual]
 

Called on keyboard events.

This function should return true if the handler is able to process the key event and false otherwise.

Implements KeyboardHandler.

void Menu::popCursorPos  ) 
 

void Menu::pushCursorPos int  p,
int  l,
int  c
 

void Menu::setCondition int  n,
bool  c
[inline]
 

void Menu::setCursor int  p,
int  l,
int  c
 

void Menu::setPage int  p  )  [inline]
 

void Menu::setPageText const char *  t,
int  page,
int  line
 

Update text for menu page page starting at line line.

Use this instead of mprint() for larger text blocks.

void Menu::setText char *  t  ) 
 

Set text for all menu pages.

void Menu::setVariable char *  name,
const char *  value
 

Set value of menu variable name.

void Menu::show  ) 
 


Member Data Documentation

AdsoLua Menu::menuCtrl
 


The documentation for this class was generated from the following files:
Generated on Mon Jul 21 10:44:48 2003 for Rover by doxygen 1.3.2