IDMCnrItem

The IDMCnrItem class represents container-specific items in a direct manipulation. Containers create objects of the IDMCnrItem class when either of the following occurs:

In addition to attributes inherited from IDMItem, objects of this class have a pointer to the source container that is the source of the direct manipulation, the source container's identifier (ID), and a pointer to the container object that the container item represents.

This class provides virtual functions that implement direct manipulation support for the container. You can derive item classes to support the direct manipulation of container items if the default Open Class Library support does not meet your requirements.


IDMCnrItem - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of this class.


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

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IDMCnrItem


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

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

Use this constructor to construct IDMCnrItem objects for the target of a direct manipulation. It is called by the member function, IDMItemProviderFor::provideTargetItemFor, of the container's item provider for the container item class.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
IDMCnrItem( IContainerControl* container, IContainerObject* object, IDMSourceOperation* sourceOperation, const ISize& imageOffset )

container
A pointer to the source container control.
object
A pointer to the source container object.
sourceOperation
A pointer to the drag source operation object to which this container item object is to be added.
imageOffset
A reference to the offset of the drag image from the pointing device.

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

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Drop Processing

Use these members during the drop operation of a direct manipulation.


[view class]
targetDrop
public:
virtual bool targetDrop(IDMTargetDropEvent& event)

Implements container-item-specific rendering when the container item that represents a container object is dropped on a target container. This function adds the object into the target container. Derived classes should override this function to insert the associated container object into the target container if the default support does not meet your requirements.
Note: If multiple container items are dropped, this function is called once for each item. The items are processed in the reverse order in which they were added to the source operation in the member function, IDMCnrItem::generateSourceItems.

Exception

IInvalidRequest The drop cannot be completed. A source object must exist for this operation.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Source Items

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


[view class]
containerId
public:
virtual unsigned long containerId() const

Returns the source container's ID.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


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

Generates container drag items that represent container objects selected in the source container. This function is called by the container's implementation of IDMItemProvider::provideSourceItems in the template class IDMItemProviderFor.

The default implementation of this function in this class creates IDMCnrItem 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 IDMCnrItem::generateSourceItems in your derived container item class. In your implementation, create one or more objects of your derived container item class and call IDMOperation::addItem to add the objects to the source operation.
Note: Use the sourceOperation parameter to access IDMOperation::addItem.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
sourceContainer
public:
virtual IContainerControl* sourceContainer() const

Returns a pointer to the source container.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IDMCnrItem - Inherited Member Functions and Data

Inherited Public Functions

IDMItem
IMRefCounted

Inherited Public Data

IDMItem

Inherited Protected Functions

IMRefCounted
IDMItem

Inherited Protected Data

IDMItem