#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. | |
IlvMessageLabel * | getPortion (IlUInt portion) |
Returns the label of a given portion. | |
IlvMarkingMenu * | getSubMenu (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) |
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.
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.
display | The connection to the display. |
portions | The number of portions in the menu. |
cmlIn | The inside radius of the circular message label. |
cmlOut | The outside radius of the circular message label. |
cmlSegment | The segment number of each circular message label. |
space | The space between two circular message labels. |
palette | The palette of the circular message label. |
invertedPalette | The inverted palette of the circular message label. |
|
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:
|
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.
origin | Position 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 |
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 |
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 |
Attaches a menu item and a callback to a menu portion.
i | The portion to which the callback is set ([0,portions-1] ). |
label | The label of the menu item associated with the portion. This label is copied. |
callback | The callback. Its type must be the following: void (IlvMarkingMenuCallback)(IlvMarkingMenu menu, IlUShort portion, IlAny arg) |
b | The bitmap of the menu item associated with the portion. It can be 0 . |
alignment | The alignment of the label and the bitmap. |
arg | The callback argument. |
opaque | A Boolean value specifying whether the item should be opaque (IlTrue ) or not (IlFalse ). When an item is opaque, its label has a background. |
isCircular | A Boolean value specifying whether the shape of the item should be circular (IlTrue or not (IlFalse ). |
|
virtual |
Attaches a submenu to a menu portion.
i | The portion to which the submenu is attached ([0,portions-1] ). |
label | The label of the submenu item associated with the portion. This label is copied. |
b | The bitmap of the submenu item associated with the portion. It can be 0 . |
alignment | The alignment of the label and the bitmap. |
markingMenu | The marking menu. This marking menu will not be deleted by the current object destructor. |
opaque | A Boolean value specifying whether the item should be opaque (IlTrue ) or not (IlFalse ). When an item is opaque, its label has a background. |
isCircular | A 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 |
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.