IDMHandler

The IDMHandler class is the base class for the source handler class, IDMSourceHandler, and the target handler class, IDMTargetHandler.

This base class provides static functions to enable you to add source and target direct manipulation support to your application's windows and controls.

Windows Considerations

You are required to use the enabling functions for direct manipulation support to your application's windows and controls. These enablers initialize the Windows specific direct manipulation support.
Note: This requirement does not prevent you from using your own source and target handlers. Just be sure to set the default source and target handler prior to calling the enabling functions.


IDMHandler - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of this class. This class can only be used as the base class for concrete-derived classes, such as IDMSourceHandler and IDMTargetHandler.


[view class]
~IDMHandler
protected:
virtual ~IDMHandler()

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IDMHandler
protected:
IDMHandler()

Provides the default constructor, which takes no arguments.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Default Handlers

Use these static members to get and set the default source and target handlers used by the various enabling functions.


[view class]
defaultDragHandler
public:
static IDMDragHandler& defaultDragHandler()

Returns the default drag handler.

Supported Platforms

Windows OS/2 AIX
Yes No No


[view class]
defaultDropTargetHandler
public:
static IDMDropTargetHandler& defaultDropTargetHandler()

Returns the default drop target handler.

Supported Platforms

Windows OS/2 AIX
Yes No No


[view class]
defaultSourceHandler
public:
static IDMSourceHandler& defaultSourceHandler()

Returns the default source handler.
Note: The handler returned by this function may have been, or will be, attached to any window for which any of the enabling functions (enableDragFrom, enableDropOn, or enableDragDropFor) have been called. Any changes you make to this handler, such as adding renderers, removing renderers, or changing the renderers effects all of these windows.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
defaultTargetHandler
public:
static IDMTargetHandler& defaultTargetHandler()

Returns the default target handler.
Note: The handler returned by this function may have been, or will be, attached to any window for which any of the enabling functions (enableDragFrom, enableDropOn, or enableDragDropFor) have been called. Any changes you make to this handler, such as adding renderers, removing renderers, or changing the renderers effects all of these windows.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setDefaultSourceHandler
public:
static void setDefaultSourceHandler( IDMSourceHandler& source )

Sets the default source handler to the specified handler. This handler is attached to windows on subsequent calls to IDMHandler::enableDragFrom or IDMHandler::enableDragDropFor.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setDefaultTargetHandler
public:
static void setDefaultTargetHandler( IDMTargetHandler& target )

Sets the default target handler to the specified handler. This handler is attached to windows on subsequent calls to IDMHandler::enableDragFrom or IDMHandler::enableDragDropFor.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Enabling Direct Manipulation

Use these static members to provide a simple means of enabling direct manipulation for application windows and controls.


[view class]
enableDragDropFor

Attaches the default source and target handlers to the specified window and the default source and target renderers to their respective handlers.


Overload 1
public:
static void enableDragDropFor(IMultiLineEdit* mle)

mle
A pointer to the multiline edit object.

This overload of the function is used for multiline edit source and target enablement. A drag item provider is attached to the multiline edit (MLE) by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the MLE, you must attach your own drag item providers.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

Attaches the default drag and drop target handlers to the specified window.


Overload 2
public:
static void enableDragDropFor( IToolBarButton* toolBarButton )

toolBarButton
A pointer to the tool bar button object.

This overload of the function is used for tool bar button source and target enablement. A drag item provider is attached to the tool bar button by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the tool bar button, you must attach your own drag item providers.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

Attaches the default drag and drop target handlers to the specified window.


Overload 3
public:
static void enableDragDropFor(IWindow* window)

window
A pointer to the window object.

This overload of the function is used for the source and target enablement of controls that are not supported by the default Open Class Library support for direct manipulation. These controls can be system-defined controls or custom controls.
Note: You must attach a drag item provider for any types of windows or controls that are not supported by the Open Class Library to enable them to support direct manipulation.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

Attaches the default drag and drop target handlers to the specified window.


Overload 4
public:
static void enableDragDropFor(IEntryField* entryField)

entryField
A pointer to the entry field object.

This overload of the function is used for entry field source and target enablement. A drag item provider is attached to the entry field by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the entry field, you must attach your own drag item providers.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

Attaches the default drag and drop target handlers to the specified window.


Overload 5
public:
static void enableDragDropFor(IContainerControl* container)

container
A pointer to the container object.

This overload of the function is used for container source and target enablement. A drag item provider is attached to the container by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the container, you must attach your own drag item providers.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

Attaches the default drag and drop target handlers to the specified window.


[view class]
enableDragFrom

Attaches the default source handler to the specified window and the default source renderer to the handler.


Overload 1
public:
static void enableDragFrom(IContainerControl* container)

container
A pointer to the container object.

This overload of the function is used for container source enablement. A drag item provider is attached to the container by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the container, you must attach your own drag item providers.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

Attaches the default drag handler to the specified window.


Overload 2
public:
static void enableDragFrom(IWindow* window)

window
A pointer to the window object.

This overload of the function is used for the source enablement of controls that are not supported by the default Open Class Library support for direct manipulation. These controls can be system-defined controls or custom controls.
Note: You must attach a drag item provider for any types of windows or controls that are not supported by the Open Class Library to enable them to support direct manipulation.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

Attaches the default drag handler to the specified window.


Overload 3
public:
static void enableDragFrom(IEntryField* entryField)

entryField
A pointer to the entry field object.

This overload of the function is used for entry field source enablement. A drag item provider is attached to the entry field by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the entry field, you must attach your own drag item providers.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

Attaches the default drag handler to the specified window.


Overload 4
public:
static void enableDragFrom(IMultiLineEdit* mle)

mle
A pointer to the multiline edit object.

This overload of the function is used for multiline edit source enablement. A drag item provider is attached to the multiline edit (MLE) by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the MLE, you must attach your own drag item providers.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

Attaches the default drag handler to the specified window.


[view class]
enableDropOn

Attaches the default target handler to the specified window and the default target renderer to the handler.


Overload 1
public:
static void enableDropOn(IToolBar* toolBar)

toolBar
A pointer to the tool bar object.

This overload of the function is used for tool bar target enablement. A drag item provider is attached to the tool bar by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the tool bar, you must attach your own drag item providers.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

Attaches the default drop target handler to the specified window.


Overload 2
public:
static void enableDropOn(IContainerControl* container)

container
A pointer to the container object.

This overload of the function is used for container target enablement. A drag item provider is attached to the container by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the container, you must attach your own drag item providers.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

Attaches the default drop target handler to the specified window.


Overload 3
public:
static void enableDropOn(IMultiLineEdit* mle)

mle
A pointer to the multiline edit object.

This overload of the function is used for multiline edit target enablement. A drag item provider is attached to the multiline edit (MLE) by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the MLE, you must attach your own drag item providers.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

Attaches the default drop target handler to the specified window.


Overload 4
public:
static void enableDropOn(IEntryField* entryField)

entryField
A pointer to the entry field object.

This overload of the function is used for entry field target enablement. A drag item provider is attached to the entry field by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the entry field, you must attach your own drag item providers.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 5
public:
static void enableDropOn(IWindow* window)

window
A pointer to the window object.

This overload of the function is used for the target enablement of controls that are not supported by the default Open Class Library support for direct manipulation. These controls can be system-defined controls or custom controls.
Note: You must attach a drag item provider for any types of windows or controls that are not supported by the Open Class Library to enable them to support direct manipulation.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

Attaches the default drop target handler to the specified window.


Handler Processing

Handler-processing members query information about the windows that the handler is attached to.


[view class]
isContainerControl
protected:
bool isContainerControl(const IWindow* window) const

Returns true if the window is a container control.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Item Providers

These static members set a default item provider for the argument window.
Note: In most cases, the Open Class Library will provide an item provider when you enable a window for direct manipulation. Please see Enabling Direct Manipulation for details.


[view class]
setItemProvider

Sets the default item provider for the argument window.


Overload 1
protected:
static void setItemProvider(IMultiLineEdit* mle)

mle
A pointer to the multiline edit object.

Sets the default item provider for the multiline edit object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
protected:
static void setItemProvider(IToolBarButton* toolBar)

toolBar
A pointer to the tool bar button object.

Sets the default item provider for the tool bar button object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 3
protected:
static void setItemProvider(IContainerControl* container)

container
A pointer to the container object.

Sets the default item provider for the container object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 4
protected:
static void setItemProvider(IEntryField* entryField)

entryField
A pointer to the entry field object.

Sets the default item provider for the entry field object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 5
protected:
static void setItemProvider(IToolBar* toolBar)

toolBar
A pointer to the tool bar object.

Sets the default item provider for the tool bar object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Rendering

These members provide a means of accessing the base IDMRenderer objects involved in the direct manipulation described by objects of this class. These objects are used to handle the rendering of drag item objects that are compatible with the supported rendering mechanisms and formats (RMFs).


[view class]
addRenderer
protected:
virtual IDMHandler& addRenderer( const IDMRenderer& newRenderer )

Adds a specified renderer to this handler. The renderer is added to the end of the renderer collection.
Note: Renderers are maintained by position, which are 1-based.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
numberOfRenderers
protected:
virtual unsigned numberOfRenderers()

Returns the number of renderers currently in the renderer collection.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
removeRenderer

Removes the specified renderer from this handler.
Note: Renderers are maintained by position, which are 1-based.


Overload 1
protected:
virtual IDMHandler& removeRenderer(unsigned position)

position
A value that represents the location of the renderer in the renderer collection.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
protected:
virtual IDMHandler& removeRenderer( const IDMRenderer& rendererToRemove )

rendererToRemove
A reference to the renderer object to remove from the renderer collection.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
renderer
protected:
virtual IDMRenderer* renderer(unsigned position)

Returns the renderer at the given position.
Note: Renderers are maintained by position, which are 1-based.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
replaceRenderer
protected:
virtual IDMHandler& replaceRenderer( unsigned position, const IDMRenderer& replacement )

Replaces a renderer with another specified renderer.
Note: Renderers are maintained by position, which are 1-based.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setRenderer
protected:
virtual IDMHandler& setRenderer( const IDMRenderer& newRenderer )

Sets the renderer for this handler. Removes any pre-existing renderers.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IDMHandler - Inherited Member Functions and Data

Inherited Public Functions

IHandler

Inherited Public Data

Inherited Protected Functions

IHandler

Inherited Protected Data