home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ctdemo.zip / classes / @CLSLIB1.ZIP / cls / iclui / ahlwndw5.out < prev    next >
Text File  |  1994-09-05  |  6KB  |  153 lines

  1. /////V ahlwndw5  f:\cls_ibm\cls\iclui 1  PM 05.09.94 21:55:14
  2.  
  3. /////I AHelloWindow5 ICLUI example @ 0 @  @ 
  4. This is a port of the IBM C/Set++ ICLUI example HELLO5 (located in
  5. \ibmcpp\samples\iclui\hello5).
  6.  
  7. It demonstrates how an existing multi file ICLUI application with
  8. PM resources and online help can be (re)structured within
  9. CTHROUGH.
  10.  
  11. It is mainly used as an example of a simple "Post Build Procedure"
  12.  
  13. /////I List of Files @ 1 @  @ 
  14. The example consists of the following files and classes:
  15.  
  16. 1.) converted class files
  17.      AHLWNDW5.CPP    : class AHelloWindow5, AHelpHandler
  18.     converted from:    AHELLOW5.HPP + AHELLOW5.CPP
  19.  
  20.     AERTWNDW.CPP : class AEarthWindow
  21.     converted from:    AEARTHW5.HPP + AEARTHW5.CPP
  22.  
  23.     ATXTDLOG.CPP : class ATextDialog
  24.     converted from:    ADIALOG5.CPP + ADIALOG5.HPP
  25.  
  26. 2.) unmodified IBM support files
  27.     ADIALOG5.DLG
  28.     AHELLOW5.RC
  29.     AHELLOW5.IPF
  30.     AHELLOW5.H
  31.  
  32. 3.) CTHROUGH support files
  33.     AHLWNDW5.OUT    : this file
  34.     AHLWNDW5.CMD    : post build procedure example
  35.  
  36. /////I Conversion Process @ 1 @  @ 
  37. With the post build procedure mechanism, only the class files have
  38. to be converted. The order of conversion is of no importance.
  39.  
  40.     add a new source directory that should hold the new classes
  41.     via the HierarchyViewer DirPane popup "Add"
  42.     (e.g. "d:\cthru\clstest1") 
  43.     open a ClassConverter
  44.  
  45.     select the *.hpp, *.cpp sources from the C/Set++ directory
  46.     (\ibmcpp\samples\iclui\hello5) via ClassConverter popoup
  47.     "Open Source"
  48.     position cursor of *.hpp source window on "class" keyword
  49.     and start "Scan Class"
  50.     when asked for the class location, select the new source dir
  51.     start "Scan Import" from the source window popup
  52.     (if required) select the appropriate text (e.g. forward
  53.     declarations) in the *.hpp source window and start "Scan Insert"
  54.     bring *.cpp source window to top, start "Scan Functions"
  55.     repeat these steps for all 3 classes
  56.  
  57.     copy the IBM support files (*.rc, *.ipf, *.dlg, *.ico) to your new
  58.     source directory
  59.  
  60. /////I Conversion Hints @ 1 @  @ 
  61. There are a few things to consider when converting the sources:
  62.  
  63. 1.) "AHelloWindow" class name should be renamed
  64.  
  65. There already is a "AHelloWindow" class in the CLSTEST dir.
  66. In order to keep this class, prior to the "Scan Class" of the
  67. AHELLOW5.HPP, the class name "AHelloWindow" should be replaced
  68. by "AHelloWindow5" in both the AHELLOW5.HPP and AHELLOW5.CPP
  69. (can be done via the "Find/Replace.." popup menu item in the
  70. source window)
  71.  
  72.  
  73. 2.)  make "AHelpHandler" class an auxiliary class
  74.  
  75. This class (defined in AHELLOW5.HPP) is too small (just a single,
  76. 2-line function) to make it a toplevel class. Rather than converting
  77. it in a toplevel class of itself, it is kept as a auxiliary class
  78. (located in an insert) within the AHelloWindow5 class. However,
  79. there would be other ways to structure this (toplevel class, 
  80. C++ local class etc.)
  81.  
  82. 3.) copy global "main ()" to AHelloWindow5
  83.  
  84. Since global functions cannot be attached automatically to 
  85. converted classes, the main() function of AHELLOW5.CPP has
  86. to be copied manually to class AHelloWindow5. Select and copy the
  87. function definitin to the clipboard, paste it to the TextPane of the
  88. ClassEditor and select "save". Depending on the prior function
  89. selection of the ClassEditor, you may get a "function attributes
  90. changed due to inconsistency" message (can be ignored). This is
  91. due to the fact that the ClassEditor tries to apply the attributes
  92. (e.g. "private") of the currently selected func to the saved func
  93. definition from the TextPane (which will not work because "main()"
  94. is a global func instead of a member func).
  95.  
  96.  
  97. 4.) be aware of import positions
  98.  
  99. Most  imports of the original IBM sources are split (i.e. there is
  100. a forward class decl in the *.hpp and an #include in the *.cpp).
  101. If you don't want to set all import positions to "pre", make sure
  102. that you have the forward decls that are required (locate it
  103. in a "pre" insert).
  104.  
  105. Currently, the ClassConverter does not recognize import positions
  106. and will default all imports to "pre"
  107.  
  108.  
  109. 5.) set PM linkage for AHelloWindow5 class
  110.  
  111. To force a default PM linkage of the application, open the
  112. ClassDialog (via from "Class->Class Spec") from the AHelloWindow5
  113. ClassEditor and select the "define:_PM_" category from the
  114. CategoryPane of the ClassDialog. If you don't specify this category,
  115. you will have to set the PM linkage manually each time an
  116. AppsBuilder is opened for this class (otherwise the app will not
  117. run correctly).
  118.  
  119. /////I Create a "Post Build Procedure" @ 1 @  @ 
  120. To enable the use of unmodified support files (*.rc, *.ipf etc),
  121. the user has to specify a "Post Build Procedure" that specifies
  122. how the application has to be processed after a successful build.
  123.  
  124. A Post Build Procedure is simply a REXX procedure that has the
  125. same filename stem and path as the application class (e.g.
  126. AHelloWindow5). There is no restriction of what can be done
  127. from a Post Build Procedure.
  128.  
  129. To create a new or edit an existing Post Build Proc, open the
  130. AppsBuilder for the class "AHelloWindow5" and select the
  131. "File->Edit Post Proc" menu item. A TextViewer will appear that
  132. can be used to edit the contents of the Proc File.
  133.  
  134. /////I Usage of "Post Build Procedures" @ 1 @  @ 
  135. Since all compilation and linking is done with a response file
  136. for ICC.EXE, there is no automatic support for the processing that
  137. should take place after the application has been linked.
  138.  
  139. Usually such things (e.g. compiling and linking *.rc files, compiling
  140. *.ipf files etc.) are done within a makefile. Because the
  141. AppsBuilder does the MAKE stuff (and all additional things like
  142. storing object attributes) by itself, no makefile is used.
  143.  
  144. There is support for automatically compiling and linking a resource
  145. file (if an appropriate *.rc file is found) after a successful build.
  146. However, this often requires an explicit path setting from within
  147. the *.rc file because it is compiled from the TMP dir and RC does
  148. not support partly specified paths very well.
  149.  
  150. Such problems can be circumvented by the usage of a Post Build
  151. Proc. You can switch directories and call whatever you want
  152. from such a procedure (even NMAKE if you like to do so).
  153.