StarTrekV3_Linux  Version3
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Pages
TMenuItem Class Reference

#include <Menu.h>

Public Member Functions

 TMenuItem (int a_nX, int a_nY, int a_nWidth, int a_nHeight, TMenu *a_pParent, void(*a_pCallBack)())
 Menu item Constructor. More...
 
void ProcessMouseEvent (ALLEGRO_MOUSE_EVENT *mouse_event)
 Mouse event handler for menu item. More...
 
void Draw (ALLEGRO_FONT *a_pFont)
 Draw this menu item. More...
 

Friends

class TMenu
 

Detailed Description

TMenuItem is a clickable menuItem that calls a given callback function when clicked

Constructor & Destructor Documentation

TMenuItem::TMenuItem ( int  a_nX,
int  a_nY,
int  a_nWidth,
int  a_nHeight,
TMenu a_pParent,
void(*)()  a_pCallback 
)

Menu item Constructor.

Parameters
inta_nX X position of menu item
inta_nY Y position of menu item
inta_nWidth Width of menu item
inta_nHeight Height of menu item
TMenu* a_pParent the owner of this menu item... A menu
void(* a_pCallBack)() Pointer to a function to be called when this menuitem is clicked

Member Function Documentation

void TMenuItem::Draw ( ALLEGRO_FONT *  a_pFont)

Draw this menu item.

Parameters
ALLEGRO_FONT* a_pFont a pointer to a font to use for text
void TMenuItem::ProcessMouseEvent ( ALLEGRO_MOUSE_EVENT *  mouse_event)

Mouse event handler for menu item.

Parameters
ALLEGRO_MOUSE_EVENT* mouse_event a mouse event passed by allegro

Friends And Related Function Documentation

friend class TMenu
friend

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