home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / srctrn.zip / READ.ME < prev    next >
Text File  |  1994-01-11  |  3KB  |  67 lines

  1.                         Source Render Drag/Drop Example
  2.                         Author: Andrew Clinch
  3.                         Date: 10th January, 1994
  4.  
  5.  
  6. Introduction
  7. ------------
  8.  
  9. This small offering shows how to perform a source rendered drag/drop in the 
  10. WPS of OS/2.  All drag/drop operations performed in the WPS are target
  11. rendered, so you have no control if you are coding a WPS class which needs
  12. to be part of the rendering in such an operation.
  13.  
  14. The example simply shows a copy command being performed on an object that is
  15. dragged and dropped in a folder.
  16.  
  17.  
  18. How It Works
  19. ------------
  20.  
  21. It turns out (after much dialog on CIS) that the solution to getting a source
  22. render is quite simple.  These are the key steps :
  23.  
  24.         1 -     Override the wpFormatDragItem method in your source class.
  25.                 In this method, remove the hstrSourceName field contents
  26.                 from the DRAGITEM structure, and change the hstrRMF field
  27.                 to be <DRM_OS2FILE, DRF_UNKNOWN> (this is set to
  28.                 <DRM_OBJECT, DRF_OBJECT> by the parent method.  Then create
  29.                 an object window, and substitute the hwndItem field with
  30.                 the handle to the object window.
  31.  
  32.         2 -     In the object window procedure, code for the DM_RENDER
  33.                 message.  This is sent by the target, as there is not
  34.                 sufficient information for it to complete the rendering.
  35.  
  36. And thats it boys and girls.
  37.  
  38.  
  39. Thanks To
  40. ---------
  41.  
  42. Many thanks go to Dan Kehn and Gregory Czaja for helping me get this sort of
  43. stuff working.  Hope the sample helps for your work!
  44.  
  45.  
  46. Installation
  47. ------------
  48.  
  49. Just run inst.exe, passing as the only parameter the fully qualified path
  50. name of the srctrans.dll (eg. 'c:\os2\dll\srctrans.dll').  It will
  51. create a SrcTransient instance called "dragit" on the Desktop.  Just drag
  52. and drop this in another folder, and it should (not going to commit myself
  53. here) copy the object to where you dropped it (regardless of the modification
  54. keys you hold down).  This copy is done by the source object, not the
  55. target folder.
  56.  
  57.  
  58. Disclaimer
  59. ----------
  60.  
  61. In no event shall Andrew Clinch be liable for any damages whatsoever
  62. (including, without limitation, damaged or loss of business profits, business
  63. interruption, loss of business information, or other pecuniary loss) arising
  64. out of the use or inability to use this sample code, even if Andrew Clinch
  65. has been advised of the possibility of such damages.
  66.  
  67.