home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
VSCPPv8.zip
/
VACPP
/
IBMCPP
/
samples
/
IOC
/
DRAG2
/
DMSAMP2.HPP
< prev
next >
Wrap
Text File
|
1995-01-20
|
3KB
|
51 lines
#include <idmprov.hpp>
#include <idmitem.hpp>
#include <idmevent.hpp>
class ABitmapItem : public IDMItem {
/*******************************************************************************
* Objects of this class provide "bitmap control" drop behavior when a *
* source bitmap file is dropped on a bitmap control properly configured *
* with a target handler and a ABitmapProvider. *
*******************************************************************************/
public:
/*------------------------------- Constructor ----------------------------------
| Objects of this class are constructed from a generic item handle. |
------------------------------------------------------------------------------*/
ABitmapItem ( const IDMItem::Handle& item );
/*------------------------------ Drop Behavior ---------------------------------
| targetDrop - Take the dropped file, create a PM bitmap object, |
| and set it into the target window. |
------------------------------------------------------------------------------*/
virtual Boolean
targetDrop ( IDMTargetDropEvent& event );
};
class ABitmapProvider : public IDMItemProviderFor< ABitmapItem > {
/*******************************************************************************
* Objects of this class are attached to bitmap controls in order to have *
* ABitmapItem objects created when a bitmap file is dropped on such a *
* control. *
*******************************************************************************/
public:
/*------------------------------- Target Support -------------------------------
| provideEnterSupport - Verify that we're dealing with a bitmap object before |
| allowing a drop, as well as draw the target emphasis. |
| provideLeaveSupport - Remove the target emphasis. |
| drawEmphasis - Draw or remove the target emphasis. |
------------------------------------------------------------------------------*/
virtual Boolean
provideEnterSupport ( IDMTargetEnterEvent& event ),
provideLeaveSupport ( IDMTargetLeaveEvent& event );
virtual ABitmapProvider
&drawEmphasis ( IBitmapControl* bitmapControl,
IDMTargetEvent& event,
Boolean draw = true );
private:
static Boolean
bAlreadyDrawn;
};