PaletteContextMenu Class Reference

#include <palmenu.h>

Inheritance diagram for PaletteContextMenu:

ContextMenu List of all members.

Public Member Functions

virtual BOOL Build ()
 Base class implementation of menu builder. This function builds a menu statically by creating the appropriate objects. It does NOT call teh menu script interpreter because I am unhappy about the reliability of repeatedly calling that code.

Detailed Description

Definition at line 138 of file palmenu.h.


Member Function Documentation

BOOL PaletteContextMenu::Build void   )  [virtual]
 

Base class implementation of menu builder. This function builds a menu statically by creating the appropriate objects. It does NOT call teh menu script interpreter because I am unhappy about the reliability of repeatedly calling that code.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pRootMenu Pointer to root menu item to add new items to. [INPUTS]
- [OUTPUTS]
Returns:
TRUE if menu built OK FALSE (and sets error) otherwise
An overloaded version of this function could be written which takes in a reference to a "file" to be opened and interpreted.

Note also that by building the menu programmatically it can change depending on the context within which it is opened...

The standard layout for pop-up menus is: Clicked object's primary commands Transfer commands Other commands supported by the clicked object The "What's this?" command The Properties... command These are only guidelines and you can omit any sections you don't need.

To implement an overriden version of this function you simply need to make it add new menu items to the root menu. There are helper functions to make this easier: BuildTransferCommands will add Cut,Copy,Paste,etc. BuildCommand will take any OPTOKEN you give it and build an item linked to that OPTOKEN.

Returns:
Errors: -

Reimplemented from ContextMenu.

Definition at line 127 of file palmenu.cpp.

00128 {
00129     //  Use this variable to hold the status of the menu build. If it goes FALSE, 
00130     //  then something went wrong.
00131     BOOL ok = TRUE;
00132 
00133     //  Add all the menu items, together with separators.
00134     if( ok ) 
00135         ok = ok && BuildCommand( OPTOKEN_PALETTE_LOCKED );
00136     if( ok ) 
00137         ok = ok && BuildCommand( OPTOKEN_PALETTE_WEB_SAFE );
00138     if( ok )
00139         ok = ok && BuildCommand( OPTOKEN_PALETTE_TRANSPARENT_BACKGROUND );
00140     if( ok ) 
00141         ok = ok && BuildCommand( OPTOKEN_PALETTE_TRANSPARENT, TRUE );
00142 
00143 
00144     if( ok ) 
00145         ok = ok && BuildCommand( OPTOKEN_PALETTE_RESTORE );
00146     if( ok )
00147         ok = ok && BuildCommand( OPTOKEN_PALETTE_DELETE, TRUE);
00148 
00149     if( ok ) 
00150         ok = ok && BuildCommand( OPTOKEN_PALETTE_SYSTEM_COLOURS, TRUE );
00151 
00152     if( ok ) 
00153         ok = ok && BuildCommand( OPTOKEN_PALETTE_SORT_BY_USE );
00154     if( ok ) 
00155         ok = ok && BuildCommand( OPTOKEN_PALETTE_SORT_BY_LUMINANCE );
00156     if( ok ) 
00157         ok = ok && BuildCommand( OPTOKEN_PALETTE_SORT_BY_HUE );
00158 
00159     return ok;
00160 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:59:25 2007 for Camelot by  doxygen 1.4.4