Snoke
Menu Class Reference

#include <menu.h>

Inheritance diagram for Menu:
Collaboration diagram for Menu:

Public Member Functions

void add (const char *name)
 
void focus (int index)
 
void unfocus (int index)
 
void draw ()
 
 Menu (int x, int y, int width, int height)
 
- Public Member Functions inherited from Widget
void _parent (Widget *parentWidget)
 
WidgetfirstChild ()
 
WidgetlastChild ()
 
Widgetparent ()
 
void _next (Widget *nextWidget)
 
Widgetnext ()
 
void _previous (Widget *previousWidget)
 
Widgetprevious ()
 
void add (Widget *child)
 
unsigned short childLength ()
 
std::vector< Widget * > children ()
 
bool event (unsigned char name)
 
void listener (unsigned char name, Listener function)
 
void dispatch (unsigned char name)
 
 Widget ()
 

Private Attributes

int x
 
int y
 
int width
 
int height
 

Additional Inherited Members

- Public Attributes inherited from Widget
WidgetparentWidget
 
Widgetstart
 
Widgetending
 
WidgetnextWidget
 
WidgetpreviousWidget
 
unsigned short length
 
unsigned char events
 
std::map< unsigned char, std::list< Listener > > listeners
 

Detailed Description

Menu (list of selestable items) widget class

Parameters
{list<MenuButton>}buttons - buttons included in menu
{int}x - x coordinate of left menu side
{int}y - y coordinate of top menu side
{int}width - menu width
{int}height - menu height

Definition at line 31 of file menu.h.

Constructor & Destructor Documentation

Menu::Menu ( int  x,
int  y,
int  width,
int  height 
)
Parameters
{int}x - x coordinate of left menu side
{int}y - y coordinate of top menu side
{int}width - menu width
{int}height - menu height

Definition at line 73 of file menu.cpp.

Member Function Documentation

void Menu::add ( const char *  name)

Adds button to the menu

Parameters
{constchar*} name - text drawn at the button

Definition at line 21 of file menu.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Menu::draw ( )
virtual

Draws Menu in console window

Reimplemented from Widget.

Definition at line 56 of file menu.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Menu::focus ( int  index)

Event listener activated by Navigator module when user selects on widget Navigator::listener

Parameters
{int}index - index of subunit of the widget

Definition at line 35 of file menu.cpp.

Here is the caller graph for this function:

void Menu::unfocus ( int  index)

Event listener activated by Navigator module when user removes selection from widget Navigator::listener

Parameters
{int}index - index of subunit of the widget

Definition at line 47 of file menu.cpp.

Here is the caller graph for this function:

Member Data Documentation

int Menu::height
private

Definition at line 34 of file menu.h.

int Menu::width
private

Definition at line 34 of file menu.h.

int Menu::x
private

Definition at line 34 of file menu.h.

int Menu::y
private

Definition at line 34 of file menu.h.


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