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

TMenuBar Class Reference

The horizontal menu bar from which you make menu selections. More...

#include <menus.h>

Inheritance diagram for TMenuBar::

TMenuView TView TObject TStreamable List of all members.

Public Methods

 TMenuBar (const TRect &bounds, TMenu *aMenu)
 TMenuBar (const TRect &bounds, TSubMenu &aMenu)
 ~TMenuBar ()
virtual void draw ()
virtual TRect getItemRect (TMenuItem *item)

Static Public Methods

TStreamablebuild ()

Static Public Attributes

const char* const name

Protected Methods

 TMenuBar (StreamableInit)

Detailed Description

TMenuBar objects represent the horizontal menu bars from which menu selections can be made by:

  1. direct clicking
  2. F10 selection and hot keys
  3. selection (highlighting) and pressing Enter
  4. hot keys
The main menu selections are displayed in the top menu bar. This is represented by an object of type TMenuBar, usually owned by your TApplication object.

Submenus are displayed in objects of type TMenuBox. Both TMenuBar and TMenuBox are derived from TMenuView (which is in turn derived from TView).

For most TVision applications, you will not be involved directly with menu objects. By overriding TApplication::initMenuBar() with a suitable set of nested new TMenuItem and new TMenu calls, TVision takes care of all the standard menu mechanisms.

Definition at line 462 of file menus.h.


Constructor & Destructor Documentation

TMenuBar::TMenuBar ( const TRect & bounds,
TMenu * aMenu )
 

Creates a menu bar by calling TMenuView::TMenuView(bounds). The growMode data member is set to gfGrowHiX. The options data member is set to ofPreProcess to allow hot keys to operate.

See also:
TMenuView::TMenuView

The menu data member is set to `aMenu', providing the menu selections.

TMenuBar::TMenuBar ( const TRect & bounds,
TSubMenu & aMenu )
 

Undocumented.

TMenuBar::~TMenuBar ( )
 

Undocumented.

TMenuBar::TMenuBar ( StreamableInit ) [protected]
 

Each streamable class needs a "builder" to allocate the correct memory for its objects together with the initialized virtual table pointers. This is achieved by calling this constructor with an argument of type StreamableInit.


Member Function Documentation

TStreamable * TMenuBar::build ( ) [static]
 

Called to create an object in certain stream-reading situations.

Reimplemented from TMenuView.

void TMenuBar::draw ( ) [virtual]
 

Draws the menu bar with the default palette. The TMenuItem::name and TMenuItem::disabled data members of each TMenuItem object in the menu linked list are read to give the menu legends in the correct colors. The current (selected) item is highlighted.

Reimplemented from TView.

TRect TMenuBar::getItemRect ( TMenuItem * item ) [virtual]
 

Returns the rectangle occupied by the given menu item. It can be used with mouseInView() to determine if a mouse click has occurred on a given menu selection.

Reimplemented from TMenuView.


Member Data Documentation

const char *const TMenuBar::name [static]
 

Undocumented.

Reimplemented from TMenuView.

Definition at line 512 of file menus.h.


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