home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 14 Text / 14-Text.zip / RB3774.ZIP / RECORD.ZIP / RECFLDER.CSC < prev    next >
Text File  |  1992-04-01  |  3KB  |  143 lines

  1. ##########################################################
  2. #                                                        #
  3. #  RECFLDER.CSC          (c) IBM Corporation 1992        #
  4. #                                                        #
  5. #  A WPS Example : This class derives from WPFolder      #
  6. #  and is to be used to illustrate WPS programming       #
  7. #  for the ITSC Redbook.                                 #
  8. #                                                        #
  9. ##########################################################
  10.  
  11. #
  12. # Include the class definition file for the parent class
  13. #
  14. include <wpfolder.sc>
  15.  
  16. #
  17. #   Define the new class
  18. #
  19. class: RecordFolder,
  20.        file stem = recflder,
  21.        external prefix = recflder_,
  22.        class prefix = recfldercls_,
  23.        major version = 1,
  24.        minor version = 1,
  25.        local;
  26.  
  27. -- RecordFolder is a folder in which Record objects can be
  28. -- instantiated.
  29. -- Its derived as follows:
  30. --        SOMOject
  31. --          - WPObject
  32. --             - WPFileSystem
  33. --                - WPFolder
  34. --                   - RecordFolder
  35.  
  36.  
  37.  
  38. #
  39. # Specify the parent class
  40. #
  41. parent: WPFolder;
  42.  
  43. #
  44. # Passthru a debug message box to the .ih file
  45. # (for inclusion in the .c file)
  46. #
  47. passthru: C.h, after;
  48.  
  49. #define DebugBox(title, text)  WinMessageBox(HWND_DESKTOP,HWND_DESKTOP, \
  50.                                (PSZ) text , (PSZ) title, 0, \
  51.                                MB_OK | MB_INFORMATION )
  52.  
  53. endpassthru;
  54.  
  55. #
  56. # Define some instance data for the class
  57. #
  58. data:
  59. CHAR szLastQuery[200];
  60. --  This is the last query made from this folder
  61. --  to get some records instaciated from the Record
  62. --  class
  63.  
  64. #
  65. # Define some new methods
  66. #
  67. methods:
  68.  
  69. BOOL UpdateLastQuery(PSZ szQuery);
  70. --
  71. -- METHOD:   UpdateLastQuery                             PRIVATE
  72. --
  73. -- PURPOSE:  Saves the last query that return a result
  74. --           from the Record class
  75. --
  76.  
  77. #
  78. # Specify methods being overridden
  79. #
  80. override wpInitData;
  81. --
  82. -- OVERRIDE: wpInitData                                  PUBLIC
  83. --
  84. -- PURPOSE:  Initialize our instance variables.
  85. --
  86.  
  87. override wpModifyPopupMenu;
  88. --
  89. -- OVERRIDE: wpModifyPopupMenu                           PUBLIC
  90. --
  91. -- PURPOSE:  Add the extra find option to
  92. --           the context menu.
  93. --
  94.  
  95. override wpMenuItemSelected;
  96. --
  97. -- OVERRIDE: wpMenuItemSelected                          PUBLIC
  98. --
  99. -- PURPOSE:  Process input from the extra
  100. --           menu option that we have added.
  101. --
  102.  
  103. override wpSaveState;
  104. --
  105. -- OVERRIDE: wpSaveState                                 PUBLIC
  106. --
  107. -- PURPOSE:  Here we can store our persistent instance
  108. --           data so that it can be restored from
  109. --           wpRestoreState
  110. --
  111.  
  112. override wpRestoreState;
  113. --
  114. -- OVERRIDE: wpRestoreState                              PUBLIC
  115. --
  116. -- PURPOSE:  Allow us to resend the last query to
  117. --           the Record class
  118. --
  119.  
  120. override wpclsQueryTitle, classmethod;
  121. --
  122. -- METHOD: wpclsQueryTitle                               PUBLIC
  123. --
  124. -- PURPOSE:
  125. --   Return the string "Record Folder"
  126. --
  127.  
  128. override wpclsInitData, classmethod;
  129. --
  130. -- METHOD: wpclsInitData                                 PUBLIC
  131. --
  132. -- PURPOSE:
  133. --   We can do class specific initialisation here
  134. --
  135.  
  136. override wpclsUnInitData, classmethod;
  137. --
  138. -- METHOD: wpclsUnInitData                               PUBLIC
  139. --
  140. -- PURPOSE:
  141. --   Here we release any class resources
  142. --
  143.