home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / info / redbook4 / record.csc < prev    next >
Text File  |  1992-06-28  |  4KB  |  182 lines

  1.  
  2. #
  3. # Include the class definition file for the parent class
  4. #
  5. include <wptrans.sc>
  6.  
  7. #
  8. # Define the new class
  9. #
  10. class: Record,
  11.        file stem = record,
  12.        external prefix = record_,
  13.        class prefix = recordcls_,
  14.        major version = 1,
  15.        minor version = 1,
  16.        local;
  17.  
  18. #
  19. # Specify the parent class
  20. #
  21. parent: WPTransient;
  22.  
  23. #
  24. # Passthru a debug message box to the .ih file
  25. # (for inclusion in the .c file)
  26. #
  27. passthru: C.h, after;
  28.  
  29. #define DebugBox(title, text)  WinMessageBox(HWND_DESKTOP,HWND_DESKTOP, \
  30.                                (PSZ) text , (PSZ) title, 0, \
  31.                                MB_OK | MB_INFORMATION )
  32.  
  33. endpassthru;
  34.  
  35. #
  36. # Define some instance data for the class
  37. #
  38. data:
  39. PSZ pRecordData;
  40. -- This is the pointer the the text buffer
  41. -- that contains the record data
  42. #
  43. # Define some new methods
  44. #
  45. methods:
  46.  
  47. BOOL SetRecordInfo( PSZ szData );
  48. --
  49. -- METHOD:   SetRecordInfo                               PUBLIC
  50. --
  51. -- PURPOSE:  Copy the szData string in to the
  52. --           Record objects text buffer
  53. --
  54.  
  55. BOOL GetRecordInfo( PSZ szData );
  56. --
  57. -- METHOD:   GetRecordInfo                               PUBLIC
  58. --
  59. -- PURPOSE:  Copy the  Record objects text buffer
  60. --           in to the szData string
  61. --
  62.  
  63. BOOL clsQueryDatabase( PSZ szSearch, WPObject *Folder), classmethod;
  64. --
  65. -- METHOD:   clsQueryDatabase                            PUBLIC
  66. --
  67. -- PURPOSE:  Search the record database for all entries
  68. --           that match the patern in the search string.
  69. --           This results in the creation of new objects
  70. --           in the Folder specified
  71. --
  72.  
  73. BOOL clsRestartServer(), classmethod;
  74. --
  75. -- METHOD:   clsRestartServer                            PUBLIC
  76. --
  77. -- PURPOSE:  Restarts the server program.
  78. --
  79.  
  80. #
  81. # Specify instance methods being overridden
  82. #
  83.  
  84. override wpInitData;
  85. --
  86. -- METHOD:   wpInitData                                  PUBLIC
  87. --
  88. -- PURPOSE:  Initialise the object memory for
  89. --           the record text buffer
  90. --
  91.  
  92. override wpUnInitData;
  93. --
  94. -- METHOD:   wpInitData                                  PUBLIC
  95. --
  96. -- PURPOSE:  Free the object memory for
  97. --           the record text buffer
  98. --
  99.  
  100. override wpModifyPopupMenu;
  101. --
  102. -- METHOD:   wpModifyPopupMenu                           PUBLIC
  103. --
  104. -- PURPOSE:  Add any new options for the records
  105. --           context menu
  106. --
  107.  
  108. override wpMenuItemSelected;
  109. --
  110. -- METHOD:   wpMenuItemSelected                          PUBLIC
  111. --
  112. -- PURPOSE:  Processing for record objects menu
  113. --
  114.  
  115. override wpOpen;
  116. --
  117. -- METHOD:   wpOpen                                      PUBLIC
  118. --
  119. -- PURPOSE:  Open a view of the object ( see also
  120. --           wpclsQueryDefaultView )
  121. --
  122.  
  123. override wpSetup;
  124. --
  125. -- METHOD:   wpSetup                                     PUBLIC
  126. --
  127. -- PURPOSE:  Process the records Setup strings
  128. --
  129.  
  130. #
  131. # Specify class methods being overridden
  132. #
  133.  
  134. override wpclsInitData, classmethod;
  135. --
  136. -- METHOD:   wpclsInitData                               PUBLIC
  137. --
  138. -- PURPOSE:  Initialises the Class
  139. --           This involves :
  140. --              Initialising class variables
  141. --              Loading class resources
  142. --              Starting the IPC requester thread
  143. --              Registering the Viewing window PM Class
  144. --
  145.  
  146. override wpclsUnInitData, classmethod;
  147. --
  148. -- METHOD:   wpclsUnInitData                             PUBLIC
  149. --
  150. -- PURPOSE:  Free Class resources
  151. --
  152.  
  153. override wpclsQueryTitle, classmethod;
  154. --
  155. -- METHOD:   wpclsQueryTitle                             PUBLIC
  156. --
  157. -- PURPOSE:  Return the string "Record" as the default
  158. --           title for new record objects
  159. --
  160.  
  161. override wpclsQueryIcon, classmethod;
  162. --
  163. -- METHOD:   wpclsQueryIcon                              PUBLIC
  164. --
  165. -- PURPOSE:  Returns the default record icon pointer.
  166. --
  167.  
  168. override wpclsQueryDefaultView, classmethod;
  169. --
  170. -- METHOD:   wpclsQueryDefaultView                       PUBLIC
  171. --
  172. -- PURPOSE:  Returns the default view for a
  173. --           new instance of the record object.
  174. --
  175.  
  176. override wpclsFindObjectFirst, classmethod;
  177. --
  178. -- METHOD:   wpclsFindObjects                            PUBLIC
  179. --
  180. -- PURPOSE:  Shell entry to finding record objects
  181. --
  182.