Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

TMenuItem Class Reference

Instances of TMenuItem serve as elements of a menu. More...

#include <menus.h>

Inheritance diagram for TMenuItem::

TSubMenu List of all members.

Public Methods

 TMenuItem (const char *aName, ushort aCommand, ushort aKeyCode, ushort aHelpCtx=hcNoContext, char *p=0, TMenuItem *aNext=0)
 TMenuItem (const char *aName, ushort aKeyCode, TMenu *aSubMenu, ushort aHelpCtx=hcNoContext, TMenuItem *aNext=0)
 ~TMenuItem ()
void append (TMenuItem *aNext)

Public Attributes

TMenuItem* next
const char* name
ushort command
Boolean disabled
ushort keyCode
ushort helpCtx
const char* param
TMenusubMenu

Detailed Description

Instances of TMenuItem serve as elements of a menu.

They can be individual menu items that cause a command to be generated or a TSubMenu pull-down menu that contains other TMenuItem instances. TMenuItem's different constructors set the data members appropriately. TMenuItem also serves as a base class for TSubMenu.

Definition at line 52 of file menus.h.


Constructor & Destructor Documentation

TMenuItem::TMenuItem ( const char * aName,
ushort aCommand,
ushort aKeyCode,
ushort aHelpCtx = hcNoContext,
char * p = 0,
TMenuItem * aNext = 0 )
 

Creates an individual menu item with the given values. Data member disabled is set if `aCommand' is disabled.

TMenuItem::TMenuItem ( const char * aName,
ushort aKeyCode,
TMenu * aSubMenu,
ushort aHelpCtx = hcNoContext,
TMenuItem * aNext = 0 )
 

Creates a pull-down submenu object with the given values. Data member command is set to zero.

TMenuItem::~TMenuItem ( )
 

If param is used, deallocates the space used to store name and param. If subMenu is used, deallocates space used to store name and subMenu.


Member Function Documentation

void TMenuItem::append ( TMenuItem * aNext ) [inline]
 

Appends the given TMenuItem to the list of TMenuItems by setting next data member to `aNext'.

Definition at line 135 of file menus.h.


Member Data Documentation

ushort TMenuItem::command
 

The command word of the event generated when this menu item is selected if there isn't a submenu item.

Definition at line 101 of file menus.h.

Boolean TMenuItem::disabled
 

True if the menu item is disabled. The menu item will be drawn using the appropriate palette entry.

Definition at line 106 of file menus.h.

ushort TMenuItem::helpCtx
 

The menu item's help context. When the menu item is selected, this data member represents the help context of the application, unless the context number is hcNoContext, in which case there is no help context.

See also:
TView::getHelpCtx , TView::helpCtx

Definition at line 119 of file menus.h.

ushort TMenuItem::keyCode
 

The scan code for the associated hot key.

Definition at line 110 of file menus.h.

const char * TMenuItem::name
 

The name of the item that appears in the menu box.

Definition at line 96 of file menus.h.

TMenuItem * TMenuItem::next
 

A non-zero next points to the next TMenuItem object in the linked list associated with a menu. If next = 0, this is the last item in the list.

Definition at line 92 of file menus.h.

const char* TMenuItem::param
 

param is used to display the hot key associated with this menu item.

Definition at line 126 of file menus.h.

TMenu* TMenuItem::subMenu
 

subMenu points to the submenu to be created when this menu item is selected, if a command is not generated.

Definition at line 131 of file menus.h.


The documentation for this class was generated from the following file:
Generated at Sat Sep 22 20:19:29 2001 for TVision by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001