rwlogo

Rogue Wave Views
Gadgets Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
List of all members | Public Member Functions | Static Public Member Functions
IlvMarkingMenu Class Reference

#include <ilviews/gadgets/mmenu.h>

Public Member Functions

 IlvMarkingMenu (IlvDisplay *display, IlUInt portions=4, IlvPalette *palette=0, IlvPalette *invertedPalette=0, IlUInt space=5, IlUInt cmlIn=50, IlUInt cmlOut=110, IlUInt cmlSegment=5)
 Constructor. More...
 
virtual ~IlvMarkingMenu ()
 Destructor. More...
 
virtual void doIt (IlvPoint *origin=0)
 Activates the menu. More...
 
IlAny getCallbackArg (IlUInt portion)
 Returns the argument passed to a menu item when the portion is activated.
 
IlUInt getCardinal () const
 Returns the number of portions in the menu.
 
IlvMessageLabelgetPortion (IlUInt portion)
 Returns the label of a given portion.
 
IlvMarkingMenugetSubMenu (IlUInt portion)
 Returns the submenu attached to the portion, if any.
 
void moveSelectedItem (IlBoolean move)
 
void setPalette (IlvPalette *palette)
 
virtual void setPortionCallback (IlShort i, const char *label, IlvMarkingMenuCallback callback, IlAny arg=0, IlvBitmap *b=0, IlvPosition alignment=IlvCenter, IlBoolean opaque=IlTrue, IlBoolean isCircular=IlFalse)
 Attaches a menu item and a callback to a menu portion. More...
 
virtual void setPortionSubMenu (IlShort i, const char *label, IlvMarkingMenu *markingMenu, IlvBitmap *b=0, IlvPosition alignment=IlvCenter, IlBoolean opaque=IlTrue, IlBoolean isCircular=IlFalse)
 Attaches a submenu to a menu portion. More...
 
void setReplacePointer (IlBoolean replace)
 
virtual void unsetPortion (IlShort i)
 Cancels the settings defined by setPortionCallback or setPortionSubMenu. Does nothing if the portion is already inactive.
 

Static Public Member Functions

static void SetDelayDrawTime (IlUInt ddt)
 
static void SetNeutralZoneRadius (IlUInt nzr)
 
static void SetTrace (IlBoolean trace)
 

Detailed Description

Library: ilvadvgdt

The class IlvMarkingMenu defines marking menus. A marking menus is divided into portions (generally four or height), which can contain each a menu item. Note that some portions of a marking menu may be empty. For example, a marking menu can be made up of eight portions but can have only four menu items. Marking menus have the same functionality as conventional menus while providing a faster way for the user to access to menu items.

Constructor & Destructor Documentation

IlvMarkingMenu::IlvMarkingMenu ( IlvDisplay display,
IlUInt  portions = 4,
IlvPalette palette = 0,
IlvPalette invertedPalette = 0,
IlUInt  space = 5,
IlUInt  cmlIn = 50,
IlUInt  cmlOut = 110,
IlUInt  cmlSegment = 5 
)

Constructor.

Parameters
displayThe connection to the display.
portionsThe number of portions in the menu.
cmlInThe inside radius of the circular message label.
cmlOutThe outside radius of the circular message label.
cmlSegmentThe segment number of each circular message label.
spaceThe space between two circular message labels.
paletteThe palette of the circular message label.
invertedPaletteThe inverted palette of the circular message label.
virtual IlvMarkingMenu::~IlvMarkingMenu ( )
virtual

Destructor.

Destroys the menu and its menu items. If there are submenus attached to menu items, these are not destroyed because they can be shared by other menus. When you destroy a menu, check whether it has attached submenus like this:

for (IlUInt i = 0; i < mm->getCardinal(); i++) {
IlvMarkingMenu* submm = mm->getSubMenu(i);
MyCallbackArg* arg = (MyCallbackArg)mm->getCallbackArg(i);
mm->unsetPortion(i);
if (arg)
delete arg;
if (submm)
delete submm; // Note: this must be recursively called...
}
delete mm;

Member Function Documentation

virtual void IlvMarkingMenu::doIt ( IlvPoint origin = 0)
virtual

Activates the menu.

This member function activates the menu and processes the actions that the user performs until the mouse button is released. The menu can be displayed at the mouse location, or at the specified position. Typically, this member function is called when the user triggers an IlvButtonDown event with the appropriate modifier key. It processes the user input until a portion is chosen or not. If a portion is chosen, the corresponding callback is invoked before the function returns.

Parameters
originPosition of the center of the marking menu on the screen. Most of the time, this parameter is provided by the IlvButtonDown event.
void IlvMarkingMenu::moveSelectedItem ( IlBoolean  move)

none Moves the portion item on the selection.

This option modifies the item position on the selection.

static void IlvMarkingMenu::SetDelayDrawTime ( IlUInt  ddt)
static

none Sets and gets the drawing time delay.

delayDrawTime The time that elapses between the moment when the user activates the menu and the menu is redrawn.

static void IlvMarkingMenu::SetNeutralZoneRadius ( IlUInt  nzr)
static

none Sets the radius of the neutral zone.

The neutral zone is the area at the center of the marking menu where the user can release the mouse button without choosing a menu item. neutralZoneRadius The radius of the neutral zone expressed in pixels.

void IlvMarkingMenu::setPalette ( IlvPalette palette)

none Sets and gets the palette and the inverted palette.

virtual void IlvMarkingMenu::setPortionCallback ( IlShort  i,
const char *  label,
IlvMarkingMenuCallback  callback,
IlAny  arg = 0,
IlvBitmap b = 0,
IlvPosition  alignment = IlvCenter,
IlBoolean  opaque = IlTrue,
IlBoolean  isCircular = IlFalse 
)
virtual

Attaches a menu item and a callback to a menu portion.

Parameters
iThe portion to which the callback is set ([0,portions-1]).
labelThe label of the menu item associated with the portion. This label is copied.
callbackThe callback. Its type must be the following: void (IlvMarkingMenuCallback)(IlvMarkingMenu menu, IlUShort portion, IlAny arg)
bThe bitmap of the menu item associated with the portion. It can be 0.
alignmentThe alignment of the label and the bitmap.
argThe callback argument.
opaqueA Boolean value specifying whether the item should be opaque (IlTrue) or not (IlFalse). When an item is opaque, its label has a background.
isCircularA Boolean value specifying whether the shape of the item should be circular (IlTrue or not (IlFalse).
virtual void IlvMarkingMenu::setPortionSubMenu ( IlShort  i,
const char *  label,
IlvMarkingMenu markingMenu,
IlvBitmap b = 0,
IlvPosition  alignment = IlvCenter,
IlBoolean  opaque = IlTrue,
IlBoolean  isCircular = IlFalse 
)
virtual

Attaches a submenu to a menu portion.

Parameters
iThe portion to which the submenu is attached ([0,portions-1]).
labelThe label of the submenu item associated with the portion. This label is copied.
bThe bitmap of the submenu item associated with the portion. It can be 0.
alignmentThe alignment of the label and the bitmap.
markingMenuThe marking menu. This marking menu will not be deleted by the current object destructor.
opaqueA Boolean value specifying whether the item should be opaque (IlTrue) or not (IlFalse). When an item is opaque, its label has a background.
isCircularA Boolean value specifying whether the shape of the item should be circular (IlTrue or not (IlFalse).
void IlvMarkingMenu::setReplacePointer ( IlBoolean  replace)

none Sets and gets the option for moving the pointer to its original position.

When this option is active, the mouse pointer is moved back to its original position, when the menu is deactivated.

static void IlvMarkingMenu::SetTrace ( IlBoolean  trace)
static

none Activates or deactivates the traces left on the screen when a menu item is chosen. Note: Due to the Xor mode, these traces cannot be eliminated completely.


© Copyright 2015, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.