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

  1. //
  2. //  Source render drag/drop sample
  3. //
  4. //  Author : Andrew Clinch
  5. //
  6. //  Disclaimer :
  7. //  In no event shall Andrew Clinch be liable for any damages whatsoever
  8. //  (including, without limitation, damaged or loss of business profits, business
  9. //  interruption, loss of business information, or other pecuniary loss) arising
  10. //  out of the use or inability to use this sample code, even if Andrew Clinch
  11. //  has been advised of the possibility of such damages.
  12. //
  13.  
  14. #******************************************************************************
  15. #   Include the class definition file for the parent class
  16. #******************************************************************************
  17.  
  18. include <wptrans.sc>
  19.  
  20. #******************************************************************************
  21. #   Define the new class
  22. #******************************************************************************
  23.  
  24. class: SrcTransient,
  25.        external stem   = src,
  26.        local,
  27.        external prefix = src_,
  28.        classprefix     = srcM_,
  29.        major version   = 1,
  30.        minor version   = 1;
  31.  
  32. --
  33. -- CLASS: VCDataFile
  34. --
  35. -- CLASS HIERARCHY:
  36. --
  37. --     SOMObject
  38. --       └── WPObject
  39. --             └── WPTransient
  40. --                   └── SrcTransient
  41. --
  42. -- DESCRIPTION:
  43. --
  44. --    
  45. --
  46. --    
  47. --
  48.  
  49. #******************************************************************************
  50. #   Specify the parent class
  51. #******************************************************************************
  52.  
  53. parent: WPTransient;
  54.  
  55. #******************************************************************************
  56. #   Passthru IMPLEMENTATION definitions to the .xih file - BEFORE
  57. #******************************************************************************
  58.  
  59. passthru: C.xih, before;
  60.  
  61.    #define INCL_WIN
  62.    #define INCL_DOS
  63.    #define INCL_GPIBITMAPS
  64.    #define INCL_DOSERRORS
  65.    #include <os2.h>
  66.    #include <string.h>
  67.    #include <stdio.h>
  68.    #include <memory.h>
  69.    #include <stdlib.h>
  70.    #include <setjmp.h>
  71.  
  72.    #define INCL_WPCLASS
  73.    #define INCL_WPFOLDER
  74.    #include <pmwp.h>
  75.  
  76.    #include "srctrans.ph"
  77.  
  78. endpassthru;   /* .xih after */
  79.  
  80. #******************************************************************************
  81. #   Passthru IMPLEMENTATION definitions to the .xih file - AFTER
  82. #******************************************************************************
  83.  
  84. passthru: C.xih, after;
  85.  
  86.     /*
  87.      *   DRAGSTRUCT:  Structure used for object window
  88.      */
  89.     typedef struct _DRAGSTRUCT
  90.     {
  91.         USHORT      cb;
  92.         SrcTransient  *somSelf;
  93.     } DRAGSTRUCT;
  94.     typedef DRAGSTRUCT *PDRAGSTRUCT;
  95.  
  96. endpassthru;   /* .xih after */
  97.  
  98. #******************************************************************************
  99. #   Define methods
  100. #******************************************************************************
  101.  
  102. methods:
  103.  
  104. #******************************************************************************
  105. #   Specify methods being overridden
  106. #******************************************************************************
  107.  
  108. -----------------------------------------------------------------------------
  109. --   Methods from the WPObject class
  110. -----------------------------------------------------------------------------
  111.  
  112. override wpFormatDragItem;
  113. --
  114. -- METHOD: wpFormatDragItem                               ( ) PRIVATE
  115. --                                                        (X) PUBLIC
  116. -- DESCRIPTION:
  117. --
  118. --   Allow the object to set its drag info
  119. --
  120. --
  121.  
  122. #******************************************************************************
  123. #   Define class methods
  124. #******************************************************************************
  125.  
  126. HMODULE  clsQueryModuleHandle (), class;
  127. --
  128. -- METHOD: clsQueryModuleHandle                           ( ) PRIVATE
  129. --                                                        (X) PUBLIC
  130. -- DESCRIPTION:
  131. --
  132. --   This method returns the module handle of this class.  If this is the
  133. --   first invocation, DosQueryModuleHandle is called to save the handle
  134. --   for future invocations.
  135. --
  136. -- RETURN:
  137. --
  138. --   0              Unsuccessful
  139. --   non-zero       module handle
  140. --
  141.  
  142. #******************************************************************************
  143. #   Specify class methods being overridden
  144. #******************************************************************************
  145.  
  146. override wpclsQueryIconData, class;
  147. --
  148. -- METHOD: clsQueryIconData                               ( ) PRIVATE
  149. --                                                        (X) PUBLIC
  150. -- DESCRIPTION:
  151. --
  152. --   Return the class icon.
  153. --
  154.  
  155.