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 >
Text File  |  1995-01-20  |  3KB  |  51 lines

  1. #include <idmprov.hpp>
  2. #include <idmitem.hpp>
  3. #include <idmevent.hpp>
  4.  
  5. class ABitmapItem : public IDMItem {
  6. /*******************************************************************************
  7. * Objects of this class provide "bitmap control" drop behavior when a          *
  8. * source bitmap file is dropped on a bitmap control properly configured        *
  9. * with a target handler and a ABitmapProvider.                                 *
  10. *******************************************************************************/
  11. public:
  12. /*------------------------------- Constructor ----------------------------------
  13. | Objects of this class are constructed from a generic item handle.            |
  14. ------------------------------------------------------------------------------*/
  15.   ABitmapItem ( const IDMItem::Handle& item );
  16.  
  17. /*------------------------------ Drop Behavior ---------------------------------
  18. | targetDrop - Take the dropped file, create a PM bitmap object,               |
  19. |              and set it into the target window.                              |
  20. ------------------------------------------------------------------------------*/
  21. virtual Boolean
  22.   targetDrop ( IDMTargetDropEvent& event );
  23. };
  24.  
  25. class ABitmapProvider : public IDMItemProviderFor< ABitmapItem > {
  26. /*******************************************************************************
  27. * Objects of this class are attached to bitmap controls in order to have       *
  28. * ABitmapItem objects created when a bitmap file is dropped on such a          *
  29. * control.                                                                     *
  30. *******************************************************************************/
  31. public:
  32. /*------------------------------- Target Support -------------------------------
  33. | provideEnterSupport - Verify that we're dealing with a bitmap object before  |
  34. |                       allowing a drop, as well as draw the target emphasis.  |
  35. | provideLeaveSupport - Remove the target emphasis.                            |
  36. | drawEmphasis        - Draw or remove the target emphasis.                    |
  37. ------------------------------------------------------------------------------*/
  38. virtual Boolean
  39.   provideEnterSupport ( IDMTargetEnterEvent& event ),
  40.   provideLeaveSupport ( IDMTargetLeaveEvent& event );
  41.  
  42. virtual ABitmapProvider
  43.  &drawEmphasis        ( IBitmapControl*      bitmapControl,
  44.                         IDMTargetEvent&      event,
  45.                         Boolean              draw = true );
  46. private:
  47. static Boolean
  48.   bAlreadyDrawn;
  49.  
  50. };
  51.