home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / WSTBSK.ZIP / WASTEBSK.CSC < prev    next >
Text File  |  1993-03-04  |  7KB  |  197 lines

  1. ##########################################################
  2. #  WASTEBSK.CSC  Written by: Dave Hock                   #
  3. #                            UCANDU Software, Inc.       #
  4. #                            P.O Box 336                 #
  5. #                            Cary, NC 27512              #
  6. ##########################################################
  7. #
  8. # Include the class definition file for the parent class
  9. #
  10. include <wpfolder.sc>
  11.  
  12. #
  13. #   Define the new class
  14. #
  15. class: WPWasteBskt,
  16.        file stem = wastebsk,
  17.        external prefix = wpwastebskt_,
  18.        class prefix = wpwastebsktcls_,
  19.        major version = 1,
  20.        minor version = 1,
  21.        local;
  22. -- PWFolder is a replacement for the shredder
  23. -- It is derived as follows:
  24. --        SOMOject
  25. --          - WPObject
  26. --             - WPFileSystem
  27. --                - WPFolder
  28. --                   - WPWasteBskt
  29. #
  30. # Specify the parent class
  31. #
  32. parent: WPFolder;
  33.  
  34. #
  35. # Specify the release order of new methods
  36. #
  37. release order:SetAutoEmptyFlag, QueryAutoEmptyFlag;
  38. # passthru to C compiler
  39. passthru: C.ih;
  40. #define IDKEY_AUTOEMPTY 9000
  41. endpassthru;
  42. #
  43. #
  44. # Define instance data for the class
  45. #
  46. data:
  47. BOOL bAutoEmpty;
  48. #
  49. # Define new methods
  50. #
  51. methods:
  52.  
  53. BOOL QueryAutoEmptyFlag(), private;
  54. --
  55. --  METHOD:   QueryAutoEmptyFlag                                   PRIVATE
  56. --  PURPOSE:  Returns flag
  57. --  INVOKED:  From AutoEmptyDlgProc
  58. --
  59.  
  60. BOOL SetAutoEmptyFlag(BOOL bAutoEmpty), private;
  61. --
  62. --  METHOD:   SetAutoEmptyFlag                                     PRIVATE
  63. --  PURPOSE:  Sets instance data to value.
  64. --  INVOKED:  From AutoEmptyDlgProc
  65. --
  66.  
  67. #
  68. # Specify methods being overridden
  69. #
  70. override wpInitData;
  71. --
  72. --  METHOD:   wpInitData                                  PUBLIC
  73. --  PURPOSE:  Initializes instance data
  74. --  INVOKED:  By Workplace Shell, upon instantiation of the object instance.
  75. --
  76.  
  77. override wpModifyPopupMenu;
  78. --
  79. --  METHOD:   wpModifyPopupMenu                           PUBLIC
  80. --  PURPOSE:  Adds an additional "Empty now" item to the object's context menu.
  81. --  INVOKED:  By Workplace Shell, upon instantiation of the object instance.
  82. --
  83.  
  84. override wpMenuItemSelected;
  85. --
  86. --  METHOD:   wpMenuItemSelected                          PUBLIC
  87. --  PURPOSE:  Processes the user's selections from the context menu.  The
  88. --            overridden method processes only the added "Empty now" item, before
  89. --            invoking the parent's default processing to handle other items.
  90. --  INVOKED:  By Workplace Shell, upon selection of a menu item by the user.
  91. --
  92.  
  93. override wpSetup;
  94. --
  95. --  METHOD:   wpSetup                                     PUBLIC
  96. --  PURPOSE:  Sets folder properties based upon a setup string passed by the
  97. --            object's creator as part of the WinCreateObject() call.  The
  98. --            overridden method simply processes the AUTOEMPTY keyword to set
  99. --            the folder's autoempty status and period, before
  100. --            invoking the parent's default processing to handle all other
  101. --            keywords.
  102. --  INVOKED:  By the Workplace Shell, upon instantiation of the object
  103. --            instance.
  104. --
  105.  
  106. override wpSaveState;
  107. --
  108. --  METHOD:   wpSaveState                                 PUBLIC
  109. --  PURPOSE:  Saves the object instance's persistent state data.  The
  110. --            overridden method simply saves the autoempty info , then invokes
  111. --            the parent's default processing to handle any other instance
  112. --            data defined by ancestor classes.
  113. --  INVOKED:  By the Workplace Shell, when the object becomes dormant.
  114.  
  115. override wpRestoreState;
  116. --
  117. --  METHOD:   wpRestoreState                              PUBLIC
  118. --  PURPOSE:  Restores the object instance's persistent state data.  The
  119. --            overridden method simply restores the autoempty data, then
  120. --            invokes the parent's default processing to handle any other
  121. --            instance data defined by ancestor classes.
  122. --  INVOKED:  By the Workplace Shell, when the object becomes awake.
  123. --
  124.  
  125. override wpQueryStyle;
  126. --
  127. --  METHOD:   wpQueryStyle                                 PUBLIC
  128. --  PURPOSE: Allows us to force a style such as OBJSYTLE_NOCOPY or NODELETE
  129. --  INVOKED:  By the Workplace Shell, when object(s) are dragged over the wastebasket
  130. --
  131.  
  132. override wpDragOver;
  133. --
  134. --  METHOD:   wpDragOver                                 PUBLIC
  135. --  PURPOSE: To detect if the user is trying to drag permanent/undeletable objects to
  136. --              the wastebasket.  If they are, we will put up the no-drop sign.
  137. --  INVOKED:  By the Workplace Shell, when object(s) are dragged over the wastebasket
  138. --
  139.  
  140. override wpAddFolderIncludePage;
  141. --
  142. --  METHOD:   wpAddFolderIncludePage                                 PUBLIC
  143. --  PURPOSE:  Allows us to remove the include page so the user can't hide any of the
  144. --              items in the waste basket.  This is important for we want the user to
  145. --              always see the items so that something important is not accidentally
  146. --              emptied.
  147. --  INVOKED:  By the Workplace Shell, when the include page is added to the settings view.
  148. --
  149.  
  150. override wpAddSettingsPages;
  151. --
  152. --  METHOD:   wpAddSettingsPages                              PUBLIC
  153. --  PURPOSE:  Allows us to add the AutoEmpty page to the settings view.
  154. --  INVOKED:  By the Workplace Shell, when the settings view is openned.
  155. --
  156.  
  157. override wpclsQueryTitle, classmethod;
  158. --
  159. --  METHOD:   wpclsQueryTitle                             PUBLIC
  160. --  PURPOSE:  This class method returns the default folder title for any
  161. --            instance of the password protected folder class.  This title
  162. --            is used if a title is not supplied in the WinCreateObject()
  163. --            call.
  164. --  INVOKED:  By the Workplace Shell, upon instantiation of the object
  165. --            instance.
  166. --
  167.  
  168. override wpclsInitData, classmethod;
  169. --
  170. --  METHOD:   wpclsInitData                               PUBLIC
  171. --  PURPOSE:  This class method allows the initialization of any class data
  172. --            items.  The overridden method simply obtains a module handle
  173. --            to be used when accessing Presentation Manager resources, then
  174. --            invokes the parent's default processing.
  175. --  INVOKED:  By the Workplace Shell, upon loading the class DLL.
  176. --
  177.  
  178. override wpclsQueryIcon, classmethod;
  179. --
  180. --  METHOD:   wpclsQueryIcon                                 PUBLIC
  181. --  PURPOSE:  This class method returns the handle to the default icon for
  182. --            the class. Allows setting of the icon to a wastebasket.
  183. --  INVOKED:  By the Workplace Shell, upon instantiation of the object
  184. --            instance.
  185. --
  186.  
  187. override wpclsUnInitData, classmethod;
  188. --
  189. --  METHOD:   wpclsUnInitData                             PUBLIC
  190. --
  191. --  PURPOSE:  This class method allows the release of any class data items
  192. --            or resources.  The overridden method releases the module handle
  193. --            obtained by wpclsInitData, then invokes the parent's default
  194. --            processing.
  195. --  INVOKED:  By the Workplace Shell, upon unloading the class DLL.
  196. --
  197.