IDMMenuItem

The IDMMenuItem class represents menu-specific items in a direct manipulation. Menus create objects of the IDMMenuItem class when a direct manipulation begins in a source menu.

This class provides virtual functions that implement direct manipulation support for menus. You can derive item classes to support the direct manipulation of menu drag items if the default Open Class Library support does not meet your requirements.
Note: This class does not support menus as the target of a direct manipulation.


IDMMenuItem - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of this class.


[view class]
~IDMMenuItem
public:
virtual ~IDMMenuItem()

Dismisses the menu if it has not been dismissed, because one of the following occurs:

Supported Platforms

Windows OS/2 AIX
Ignored Yes Ignored


[view class]
IDMMenuItem


Overload 1
public:
IDMMenuItem(const IDMItem::Handle& dragItem)

dragItem
A reference to a handle of a generic drag item that is created by the Open Class Library.

This constructor is not used. Its definition is necessary to satisfy the requirements of the IDMItemProviderFor template class.

Supported Platforms

Windows OS/2 AIX
Ignored Yes Ignored


Overload 2
public:
IDMMenuItem(IDMSourceOperation* sourceOperation)

sourceOperation
A pointer to the drag source operation object to which this menu drag item object is to be added.

Use this constructor to construct IDMMenuItem objects for the source of a direct manipulation. It is called by the member function, IDMMenuItem::generateSourceItems.

This constructor determines which menu item is directly under the pointing device when the direct manipulation begins and selects the menu item as a visual cue. It also disables the dismissing of the menu until the direct manipulation is complete.

Supported Platforms

Windows OS/2 AIX
Ignored Yes Ignored


Menu Cleanup

Use these members to handle cleanup of the menu after the direct manipulation has completed.


[view class]
sourceEnd
public:
virtual bool sourceEnd(IDMSourceEndEvent& event)

Processes a source end event for the menu drag item. This function dismisses the menu that is the source of the direct manipulation.

Supported Platforms

Windows OS/2 AIX
Ignored Yes Ignored


Menu Item Operations

Use these members to set the supported direct manipulation operations for this class.


[view class]
supportedOperationsFor
public:
virtual unsigned long supportedOperationsFor( const IString& selectedRMFs ) const

Returns IDMItem::linkable as the only operation the menu drag item supports.

Supported Platforms

Windows OS/2 AIX
Ignored Yes Ignored


Source Items

Use these members to access and manipulate source items involved in a direct manipulation.


[view class]
generateSourceItems
public:
static bool generateSourceItems( IDMSourceOperation* sourceOperation )

Generates a menu drag item that represents a menu item object. The menu item object is selected in the source menu.

This function is called by the menu's implementation of IDMItemProvider::provideSourceItems in the template class IDMItemProviderFor.

The default implementation of this function in this class creates IDMMenuItem objects and adds them to the source operation. If you use the IDMItemProviderFor template class and you have defined a derived item class, you must implement IDMMenuItem::generateSourceItems in your derived menu drag item class. In your implementation, create an object of your derived menu item class and call IDMOperation::addItem to add the objects to the source operation.

The default drag operation for menu drag items is IDMItem::linkable.
Note: Use the sourceOperation parameter to access IDMOperation::addItem.

Supported Platforms

Windows OS/2 AIX
Ignored Yes Ignored


IDMMenuItem - Inherited Member Functions and Data

Inherited Public Functions

IDMItem
IMRefCounted

Inherited Public Data

IDMItem

Inherited Protected Functions

IMRefCounted
IDMItem

Inherited Protected Data

IDMItem