home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
draglb.zip
/
DRAGLB.HPP
< prev
next >
Wrap
Text File
|
1994-06-08
|
4KB
|
84 lines
#ifndef DRAGLB_HPP
#define DRAGLB_HPP
#include <idmitem.hpp >
#include <idmprov.hpp >
#include <idmevent.hpp>
class LBItem : public IDMItem {
typedef IDMItem
Inherited;
/*******************************************************************************
* Objects of this class represent list box items that are created when either *
* a drag operation starts in an source list box or when a text object is *
* dropped on a target list box. *
*******************************************************************************/
public:
/*------------------------- Constructors/Destructor ----------------------------
| Objects of this class are constructed in the following manner: |
| o By providing a pointer to the drag source operation object and a |
| reference to a list item. |
| o By providing a reference to a generic drag item handle. |
------------------------------------------------------------------------------*/
LBItem ( IDMSourceOperation *pSrcOp,
IString &listItem );
LBItem ( const IDMItem::Handle &item );
virtual
~LBItem ( );
/*------------------------------ Source Items ----------------------------------
| generateSourceItems - Generates list box text items based upon data in the |
| source list box object. |
------------------------------------------------------------------------------*/
static Boolean
generateSourceItems ( IDMSourceOperation *pSrcOp );
/*-------------------------------- Accessors -----------------------------------
| object - Returns a pointer to the item text that represents a list item. |
------------------------------------------------------------------------------*/
virtual void
*object ( ) const;
/*------------------------------ Drop Processing -------------------------------
| targetDrop - Inserts list box item into the target list box. |
| sourceEnd - Remove source list item to complete the move operation. |
------------------------------------------------------------------------------*/
virtual Boolean
targetDrop ( IDMTargetDropEvent & ),
sourceEnd ( IDMSourceEndEvent &event );
/*---------------------------- Discard Processing ------------------------------
| sourceDiscard - Remove list box item that was dropped on the shredder. |
------------------------------------------------------------------------------*/
virtual Boolean
sourceDiscard ( IDMSourceDiscardEvent &event );
protected:
/*------------------------------ Implementation --------------------------------
| deleteItem - Delete selected list box item. |
------------------------------------------------------------------------------*/
virtual Boolean
deleteItem ( IListBox *listBox );
};
class LBProvider : public IDMItemProviderFor< LBItem > {
/*******************************************************************************
* Template class that is used to generate LBProvider derived class for LBItem. *
*******************************************************************************/
public:
/*-------------------------- Target Enter Processing ---------------------------
| provideEnterSupport - Verify that we understand the type of the drag item |
| during target enter event processing. |
------------------------------------------------------------------------------*/
virtual Boolean
provideEnterSupport ( IDMTargetEnterEvent &event );
};
#endif