IDMTBarButtonItem

The IDMTBarButtonItem class represents tool-bar-button-specific items in a direct manipulation. Tool bars create objects of the IDMTBarButtonItem class when one of the following occurs:

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


IDMTBarButtonItem - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of this class.


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

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IDMTBarButtonItem


Overload 1
public:
IDMTBarButtonItem(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 IDMToolBarButtonItem objects for the target of a direct manipulation. It is called by the member function, IDMItemProviderFor::provideTargetItemFor, of the tool bar button's item provider for the tool bar button item class.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
IDMTBarButtonItem(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 IDMToolBarButtonItem objects for the source of a direct manipulation. It is called by the member function, IDMTBarButtonItem::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 tool-bar-button-item-specific rendering when the drag item that represents a tool bar button object, a menu item object, or a bitmap file object is dropped on a tool bar button. This function processes the drop in one of the following ways:

Derived classes should override this function if the default support does not meet your requirements.
Note: Each tool tool bar button, within the context of a tool bar, must have a unique identifier (ID). The drop is rejected if a duplicate ID is detected within the same tool bar.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Shredder Support

Use these members for tool bar button deletion when a tool bar button item is dropped on the system shredder.


[view class]
sourceDiscard
public:
virtual bool sourceDiscard(IDMSourceDiscardEvent& event)

Implements tool-bar-button-item-specific rendering when the operating system issues a discard request.

Derived classes should override this function when the default support does not meet your requirements.

Supported Platforms

Windows OS/2 AIX
Ignored Yes Ignored

OS/2 Considerations

This function deletes the tool bar button object that is dropped on the Workplace Shell shredder object.


Source and Target Tool Bar

Use these members to query the source and target tool bar and the tool bar buttons.


[view class]
sourceToolBar
public:
virtual IToolBar* sourceToolBar() const

Returns the tool bar that contains the source tool bar button.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
sourceToolBarButton
public:
virtual IToolBarButton* sourceToolBarButton() const

Returns the source tool bar button where the direct manipulation started.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
targetToolBar
public:
virtual IToolBar* targetToolBar() const

Returns the tool bar that contains the target tool bar button.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
targetToolBarButton
public:
virtual IToolBarButton* targetToolBarButton() const

Returns the target tool bar button where the drop occurred.

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]
generateSourceItems
public:
static bool generateSourceItems( IDMSourceOperation* sourceOperation )

Generates a tool bar button item that represents a tool bar button item object.

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

The default implementation of this function in this class creates IDMTBarButtonItem 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 IDMTBarButtonItem::generateSourceItems in your derived tool bar button item class. In your implementation, create an object of your derived tool bar button item class and call IDMOperation::addItem to add the objects to the source operation.

The default drag operation for tool bar button items is IDMItem::moveable.
Note: Use the sourceOperation parameter to access IDMOperation::addItem.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Tool Bar Button 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::moveable as the only operation the tool bar button item supports.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IDMTBarButtonItem - Inherited Member Functions and Data

Inherited Public Functions

IDMItem
IMRefCounted

Inherited Public Data

IDMItem

Inherited Protected Functions

IMRefCounted
IDMItem

Inherited Protected Data

IDMItem