home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / source / wpshidl / samples / wpsamps / dragexam.c next >
Encoding:
C/C++ Source or Header  |  1993-11-18  |  2.7 KB  |  86 lines

  1. /******************************************************************************
  2. *
  3. *  Module Name: DRAGEXAM.C
  4. *
  5. *  OS/2 Work Place Shell IDL File BETA Sample Program
  6. *
  7. *  Copyright (C) 1993 IBM Corporation
  8. *
  9. *      DISCLAIMER OF WARRANTIES.  The following [enclosed] code is
  10. *      sample code created by IBM Corporation. This sample code is not
  11. *      part of any standard or IBM product and is provided to you solely
  12. *      for  the purpose of assisting you in the development of your
  13. *      applications.  The code is provided "AS IS", without
  14. *      warranty of any kind.  IBM shall not be liable for any damages
  15. *      arising out of your use of the sample code, even if they have been
  16. *      advised of the possibility of such damages.                                                    *
  17. *
  18. ******************************************************************************/
  19.  
  20. #define  INCL_PM
  21. #define  INCL_DOS
  22. #define  INCL_DOSERRORS
  23. #include <os2.h>
  24. #include <string.h>
  25.  
  26. #define DRAGEXAM_Class_Source
  27. #include "dragexam.ih"
  28.  
  29. /* The following section is for the definition of methods and method overrides
  30.  * for the DRAGEXAM class.
  31.  */
  32.  
  33. /*
  34.  * SOM_Scope BOOL   SOMLINK drag_wpFormatDragItem(DRAGEXAM *somSelf,
  35.  *                 PDRAGITEM pdrgItem)
  36.  *
  37.  * an object of class DRAGEXAM can only be dropped on an object of
  38.  * class DRAGFOLD.  To set this up, we can use a rendering mechanism
  39.  * and format that is foreign to the WPSH: <DRM_OUROWNSPECIAL,DRF_OBJECT>
  40.  *
  41.  * This RMF will be understood only by objects of class DRAGFOLD.
  42.  *
  43.  * So, we want to load up the DRAGITEM with the proper information at
  44.  * the point where the drag begins: wpFormatDragItem
  45.  *
  46.  */
  47.  
  48. SOM_Scope BOOL  SOMLINK drag_wpFormatDragItem(DRAGEXAM *somSelf,
  49.                                               PDRAGITEM pdrgItem)
  50. {
  51. /*    DRAGEXAMData *somThis = DRAGEXAMGetData(somSelf); */
  52.     DRAGEXAMMethodDebug("DRAGEXAM","drag_wpFormatDragItem");
  53.  
  54.     parent_wpFormatDragItem(somSelf,pdrgItem);
  55.  
  56.     /* We do NOT want to really let the workplace shell render
  57.      * our object, so change the rendering mechanism and format
  58.      * to be ours.
  59.      */
  60.     DrgDeleteStrHandle(pdrgItem->hstrRMF);
  61.  
  62.     pdrgItem->hstrRMF = DrgAddStrHandle("<DRM_OUROWNSPECIAL,DRF_OBJECT>");
  63.  
  64.     return TRUE;
  65. }
  66.  
  67.  
  68. /* The following section is reserved for class method definitions and overrides
  69.  */
  70. #undef SOM_CurrentClass
  71. #define SOM_CurrentClass SOMMeta
  72.  
  73. /*
  74.  * SOM_Scope PSZ   SOMLINK dragM_wpclsQueryTitle(M_DRAGEXAM *somSelf)
  75.  */
  76.  
  77. SOM_Scope PSZ  SOMLINK dragM_wpclsQueryTitle(M_DRAGEXAM *somSelf)
  78. {
  79.     /* M_DRAGEXAMData *somThis = M_DRAGEXAMGetData(somSelf); */
  80.     M_DRAGEXAMMethodDebug("M_DRAGEXAM","dragM_wpclsQueryTitle");
  81.  
  82.     return "Drag Example";
  83. }
  84.  
  85.  
  86.