home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / draglb.zip / OPERFIX.HPP < prev    next >
Text File  |  1994-06-08  |  1KB  |  37 lines

  1. #ifndef _OPERFIX_
  2. #define _OPERFIX_
  3. extern "C"
  4. {
  5.   /* define what subsections of PM headers to include */
  6.   #define INCL_WINSTDDRAG       // Standard drag stuff
  7.   #include <os2.h>
  8. }
  9.  
  10.  
  11. class OperFix : private IDMSourceOperation {
  12. typedef IDMSourceOperation
  13.   Inherited;
  14. /*******************************************************************************
  15. * This class is defined to workaround a design bug which prevents the source   *
  16. * of a drag operation from determing what operation actually occurred at the   *
  17. * target (i.e. copy or move).  The source requires this information, because   *
  18. * the IDMItem::sourceEnd function is overridden to remove the item from the    *
  19. * source list box if a move occurred.                                          *
  20. *******************************************************************************/
  21. public:
  22. /*-------------------------- Operation Determination ---------------------------
  23. | dropOperation - Returns the operation that occurred during the drop.         |
  24. ------------------------------------------------------------------------------*/
  25. static unsigned long
  26.   dropOperation( IDMSourceEndEvent &event )
  27.   {
  28.     OperFix *p = (OperFix *)event.dragItem()->sourceOperation();
  29.     return( p->dragInfo()->usOperation );
  30.   }
  31.  
  32. private:
  33.   OperFix ( );
  34. };
  35.  
  36. #endif // _OPERFIX_
  37.