home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv4.zip / VACPP / IBMCPP / HELP / CPPVBHDI.INF (.txt) < prev    next >
OS/2 Help File  |  1995-05-10  |  1MB  |  8,846 lines

  1.  
  2. ΓòÉΓòÉΓòÉ <hidden> About this Information ΓòÉΓòÉΓòÉ
  3.  
  4. The How Do I... information provides solutions to common tasks that you would 
  5. perform with the various components of VisualAge C++. Before you begin to use 
  6. this information, it would be helpful to understand how to navigate through it: 
  7.  
  8.      Use the Contents and Index facilities to locate topics. 
  9.      Use the Search facility to search the text of this document. 
  10.      Use hypertext links to acquire related information on the current topic. 
  11.       Hypertext links appear in a different color (which you can customize 
  12.       using the OS/2 Scheme Palette). For example, below there are two lists of 
  13.       hypertext links. By double-clicking on the text of the link or by 
  14.       pressing Enter on a highlighted link, you will open a panel of related 
  15.       information. To shift the focus to other links using the keyboard, use 
  16.       the Tab key. 
  17.  
  18.  For more information on using this help facility, see: 
  19.  
  20.      How to Use the Contents 
  21.      How to Obtain Additional Information 
  22.      How to Access and Use IPF Facilities 
  23.  
  24.  For more information, see: 
  25.  
  26.      Other Information You Might Find Helpful 
  27.      Communicating Your Comments to IBM 
  28.      Notices 
  29.      Trademarks 
  30.  
  31.  
  32. ΓòÉΓòÉΓòÉ <hidden> How to Use the Contents ΓòÉΓòÉΓòÉ
  33.  
  34. The Contents window is the first to appear. Some topics have a plus ( ) icon 
  35. beside them. This icon indicates that additional topics are available. 
  36.  
  37. To expand the Contents if you are using a mouse, click on the plus ( ) icon. If 
  38. you are using the keyboard, use the Up or Down Arrow key to highlight the 
  39. topic, and press the plus (+) key. To see additional topics for a heading with 
  40. a plus ( ) icon, click on the icon or highlight that topic and press the plus 
  41. (+) key. 
  42.  
  43. To view a topic, double-click on the topic (or press the Up or Down Arrow key 
  44. to highlight the topic, and then press the Enter key). 
  45.  
  46.  
  47. ΓòÉΓòÉΓòÉ <hidden> How to Obtain Additional Information ΓòÉΓòÉΓòÉ
  48.  
  49. After you select a topic, the information for that topic appears in a window. 
  50. Highlighted words or phrases indicate that additional information is available. 
  51. Certain words and phrases are highlighted in a different color from the 
  52. surrounding text. These are called hypertext terms. 
  53.  
  54. If you are using a mouse, double-click on the highlighted word. If you are 
  55. using a keyboard, press the Tab key to move to the highlighted word, and then 
  56. press the Enter key. Additional information then appears in a window. 
  57.  
  58.  
  59. ΓòÉΓòÉΓòÉ <hidden> How to Access and Use IPF Facilities ΓòÉΓòÉΓòÉ
  60.  
  61. Several choices are available for managing the information presented in this 
  62. document. There are three PullDown menus: the Services menu, the Options menu, 
  63. and the Help menu. 
  64.  
  65. The actions that are selectable from the Services menu operate on the active 
  66. window currently displayed on the screen. These actions include the following: 
  67.  
  68.  Placing Bookmarks 
  69.    You can set a placeholder so you can retrieve information of interest to 
  70.    you. 
  71.  
  72.  Searching for Information 
  73.    You can find occurrences of a word or phrase in the current topic, selected 
  74.    topics, or all topics. 
  75.  
  76.  Printing Information 
  77.    You can print one or more topics. You can also print a set of topics by 
  78.    first marking the topics in the Contents list. 
  79.  
  80.  Copying Information to a File 
  81.    You can copy a topic that you are viewing to the System Clipboard or to a 
  82.    file that you can edit. This method is particularly useful for copying 
  83.    syntax definitions and program samples into the application that you are 
  84.    developing. 
  85.  
  86.  Using the actions that are selectable from the Options menu, you can change 
  87.  the way your Contents list is displayed. To expand the Contents and show all 
  88.  levels for all topics, choose Expand all from the Options PullDown menu. You 
  89.  can also press the Ctrl, Shift and * keys together. 
  90.  
  91.  The actions that are selectable from the Help menu allow you to select 
  92.  different types of help information. 
  93.  
  94.  For information about any of the menu choices, highlight the choice in the 
  95.  menu and press F1. 
  96.  
  97.  
  98. ΓòÉΓòÉΓòÉ <hidden> Placing Bookmarks ΓòÉΓòÉΓòÉ
  99.  
  100. When you place a bookmark on a topic, it is added to a list of bookmarks you 
  101. have previously set.  You can view the list, and you can remove one or all 
  102. bookmarks from the list.  If you have not set any bookmarks, the list is empty. 
  103.  
  104. To set a bookmark, do the following: 
  105.  
  106.    1. Select a topic from the Contents. 
  107.    2. When that topic appears, select the Bookmark option from the Services 
  108.       menu. 
  109.    3. If you want to change the name used for the bookmark, type the new name 
  110.       in the field. 
  111.    4. Click on the Place radio button (or press the Up or Down Arrow key to 
  112.       select it). 
  113.    5. Click on OK (or select it and press Enter). The bookmark is then added to 
  114.       the bookmark list. 
  115.  
  116.  
  117. ΓòÉΓòÉΓòÉ <hidden> Searching for Information ΓòÉΓòÉΓòÉ
  118.  
  119. You can specify a word or phrase to be searched.  You can also limit the search 
  120. to a set of topics by first marking the topics in the Contents list. 
  121.  
  122. To search for a word or phrase in all topics, do the following: 
  123.  
  124.    1. Select the Search option from the Services menu. 
  125.    2. Type the word or words to be searched for. 
  126.    3. Click on All sections (or press the Up or Down Arrow keys to select it). 
  127.    4. Click on Search (or select it and press Enter) to begin the search. 
  128.    5. The list of topics where the word or phrase appears is displayed. 
  129.  
  130.  
  131. ΓòÉΓòÉΓòÉ <hidden> Printing Information ΓòÉΓòÉΓòÉ
  132.  
  133. You can print one or more topics, the index, or the table of contents.  Make 
  134. sure that your printer is connected to the serial port, configured correctly, 
  135. and ready for input. To print: 
  136.  
  137.    1. Select Print from the Services menu. 
  138.    2. Select what you want to print. Note that the This section and Marked 
  139.       sections choices are only available if you are viewing a topic or if you 
  140.       have marked topics, respectively.  To mark topics in the table of 
  141.       contents, press the Ctrl key and click on the topics, or use the arrow 
  142.       keys. 
  143.    3. Select Print to print what you've chosen on your printer. 
  144.  
  145.  
  146. ΓòÉΓòÉΓòÉ <hidden> Copying Information to a File ΓòÉΓòÉΓòÉ
  147.  
  148. You can copy a topic that you are viewing in two ways: 
  149.  
  150.      Copy copies the topic that you are viewing into the System Clipboard. If 
  151.       you are using a Presentation Manager (PM) editor (for example, the 
  152.       Enhanced Editor) that copies or cuts (or both) to the System Clipboard, 
  153.       and pastes to the System Clipboard, you can easily add the copied 
  154.       information to your program source module. 
  155.  
  156.      Copy to file copies the topic that you are viewing into a temporary file 
  157.       named TEXT.TMP. You can later edit that file by using any editor. 
  158.       TEXT.TMP is placed in the directory where your viewable document resides. 
  159.  
  160.  To copy a topic, do the following: 
  161.  
  162.    1. Expand the Contents list and select a topic. 
  163.    2. When the topic appears, select Copy to file from the Services menu. 
  164.    3. The system puts the text pertaining to that topic into the temporary file 
  165.       TEXT.TMP. 
  166.  
  167.  
  168. ΓòÉΓòÉΓòÉ <hidden> Other Information You Might Find Helpful ΓòÉΓòÉΓòÉ
  169.  
  170. The VisualAge C++ provides a number of online guides and references that we 
  171. hope you'll find helpful as you develop applications. This information 
  172. includes: 
  173.  
  174.      User's Guide information provides conceptual and usage information, 
  175.      Reference information is organized for quick access, and 
  176.      How Do I... information gives you specific instructions for performing 
  177.       common tasks. 
  178.  
  179.  You can get to this online information from the Information folder inside the 
  180.  main product folder. You can also get to it from the Help menu in any of the 
  181.  components of the product. 
  182.  
  183.  
  184. ΓòÉΓòÉΓòÉ <hidden> Communicating Your Comments to IBM ΓòÉΓòÉΓòÉ
  185.  
  186. If there is something you like, or dislike, about this document, please let us 
  187. know. You can use one of the methods listed below to send your comments to IBM. 
  188. Please be sure to include the complete title of the publication that you are 
  189. commenting on. For example, you would refer to the How Do I... information for 
  190. the Browser as: 
  191.   VisualAge C++ Browser: How Do I... for OS/2. 
  192.  
  193. The comments you send should only pertain to the information in this document 
  194. and its presentation. To request additional publications or to ask questions or 
  195. make comments about the functions of IBM products or systems, you should talk 
  196. to your IBM representative or your authorized IBM remarketer. 
  197.  
  198. When you send comments to IBM, you grant IBM a nonexclusive right to use or 
  199. distribute your comments in any way it believes appropriate without incurring 
  200. any obligation to you. 
  201.  
  202. You can send your comments to IBM in the following ways: 
  203.  
  204.      By mail to the following address: 
  205.  
  206.             IBM Canada Ltd. Laboratory
  207.             Information Development
  208.             2G/345/1150/TOR
  209.             1150 EGLINTON AVENUE EAST
  210.             NORTH YORK, ONTARIO
  211.             CANADA M3C 1H7
  212.  
  213.      By FAX to the following number: 
  214.  
  215.         -  United States and Canada: (416) 448-6161 
  216.         -  Other countries (+1) 416-448-6161 
  217.  
  218.      By electronic mail to one of the following IDs.  Be sure to include your 
  219.       entire network address if you wish to get a reply. 
  220.  
  221.         -  Internet: torrcf@vnet.ibm.com 
  222.         -  IBMLink: toribm(torrcf) 
  223.         -  IBM/PROFS: torolab4(torrcf) 
  224.         -  IBMMAIL: ibmmail(caibmwt9) 
  225.  
  226.  
  227. ΓòÉΓòÉΓòÉ <hidden> Notices ΓòÉΓòÉΓòÉ
  228.  
  229. Copyright International Business Machines Corporation, 1995. All rights 
  230. reserved. 
  231.  
  232. Note to U.S. Government Users - Documentation related to restricted rights - 
  233. Use, duplication, or disclosure is subject to restrictions set forth in GSA ADP 
  234. Schedule Contract with IBM Corp. 
  235.  
  236. This edition applies to Version 3.0 of IBM VisualAge C++ for OS/2 (30H1664, 
  237. 30H1665, 30H1666) and to all subsequent releases and modifications until 
  238. otherwise indicated in new editions.  Make sure you are using the correct 
  239. edition for the level of the product. 
  240.  
  241. This publication could include technical inaccuracies or typographical errors. 
  242. Changes are periodically made to the information herein; any such changes will 
  243. be reported in subsequent revisions. 
  244.  
  245. Requests for publications and for technical information about IBM products 
  246. should be made to your IBM Authorized Dealer or your IBM Marketing 
  247. Representative. 
  248.  
  249. When you send information to IBM, you grant IBM a nonexclusive right to use or 
  250. distribute the information in any ways it believes appropriate without 
  251. incurring any obligation to you. 
  252.  
  253. Any reference to an IBM licensed program in this publication is not intended to 
  254. state or imply that only IBM's licensed program may be used. Any functionally 
  255. equivalent product, program, or service that does not infringe any of IBM's 
  256. intellectual property rights may be used instead of the IBM product, program, 
  257. or service. Evaluation and verification of operation in conjunction with other 
  258. products, except  those expressly designated by IBM, is the user's 
  259. responsibility. 
  260.  
  261. IBM may have patents or pending patent applications covering subject matter in 
  262. this document.  The furnishing of this document does not give you any license 
  263. to these patents.  You can send license inquiries, in writing, to the IBM 
  264. Director of Licensing. IBM Corporation, 500 Columbus Avenue, Thornwood, NY, 
  265. 10594, USA. 
  266.  
  267. This publication contains examples of data and reports used in daily business 
  268. operations. To illustrate them as completely as possible, the examples include 
  269. the names of individuals, companies, brands, and products. All of these names 
  270. are fictitious and any similarity to the names and addresses used by an actual 
  271. business enterprise is entirely coincidental. 
  272.  
  273.  
  274. ΓòÉΓòÉΓòÉ <hidden> Trademarks and Service Marks ΓòÉΓòÉΓòÉ
  275.  
  276. The following terms used in this publication are trademarks or service marks of 
  277. IBM Corporation in the United States or other countries: 
  278.  
  279.  C/2                      C Set/2 
  280.  C Set ++                 Common User Access 
  281.  CUA                      IBM 
  282.  Operating System/2       OS/2 
  283.  Personal System/2        Presentation Manager 
  284.  PS/2                     VisualAge 
  285.  WorkFrame/2 
  286.  
  287.  Other company, product, and service names, which may be denoted by a double 
  288.  asterisk(**), may be trademarks or service marks of others. 
  289.  
  290.  
  291. ΓòÉΓòÉΓòÉ 1. ...Create a simple Visual Builder application ΓòÉΓòÉΓòÉ
  292.  
  293. Creating the To-Do List application consists of the following steps: 
  294.  
  295.      Starting Visual Builder for the To-Do List application 
  296.  
  297.      Creating a new visual part for the To-Do List application 
  298.  
  299.      Placing parts in the application window 
  300.  
  301.      Resizing and aligning the parts 
  302.  
  303.      Connecting the parts 
  304.  
  305.      Generating the C++ code for your application 
  306.  
  307.      Building the application 
  308.  
  309.      Running the application 
  310.  
  311.      Exiting the Composition Editor and Visual Builder 
  312.  
  313.  
  314. ΓòÉΓòÉΓòÉ 1.1. Start Visual Builder for the To-Do List application ΓòÉΓòÉΓòÉ
  315.  
  316. Before you create the To-Do List application, start Visual Builder. For this 
  317. sample application, start Visual Builder from the Tools folder, as follows: 
  318.  
  319.    1. Double-click on the VisualAge C++ folder icon on your desktop. 
  320.  
  321.       The VisualAge C++ folder opens. 
  322.  
  323.    2. Double-click on the Tools folder icon. 
  324.  
  325.       The Tools folder opens. 
  326.  
  327.    3. Double-click on the Visual Builder icon. 
  328.  
  329.       Visual Builder displays the Visual Builder window, as shown in the 
  330.       following figure. 
  331.  
  332.  Now it is time to create a new visual part for the To-Do List application. 
  333.  
  334.  
  335. ΓòÉΓòÉΓòÉ 1.2. Create a new visual part for the To-Do List application ΓòÉΓòÉΓòÉ
  336.  
  337. The next thing to do when creating the To-Do List application is to create the 
  338. main part, a new visual part, as follows: 
  339.  
  340.    1. Select PartNew. 
  341.  
  342.       Visual Builder displays the Part - New window, as shown in the following 
  343.       figure: 
  344.  
  345.       The Part - New window provides the following fields in which you can 
  346.       enter information about your part: 
  347.  
  348.           The Class name field, where you enter the name of your part. Each 
  349.            composite part must have a name. 
  350.  
  351.            For the To-Do List application, enter the following: 
  352.  
  353.                       ToDoList
  354.  
  355.           The Description field, where you enter a description of your part. 
  356.  
  357.            For this example, enter the following: 
  358.  
  359.                       The To-Do List application
  360.  
  361.           The File name field, where you enter the name of the .vbb file in 
  362.            which you want Visual Builder to store your part. 
  363.  
  364.            For this example, you can either leave this field blank or enter the 
  365.            following: 
  366.  
  367.                       ToDoList.vbb
  368.  
  369.            This causes Visual Builder to store the ToDoList part in a file 
  370.            named todolist.vbb. If you leave this field blank, Visual Builder 
  371.            uses the part name as the name of the .vbb file by default, so the 
  372.            result is the same. 
  373.  
  374.           The Part type field, where you indicate the type of part. This field 
  375.            initially contains Visual part. However, you can specify a different 
  376.            type of part to create by selecting one from the field's drop-down 
  377.            list box. 
  378.  
  379.            For this example, do not select a different part type because you 
  380.            want to create a visual part for the To-Do List application. 
  381.  
  382.           The Base class field, where you specify the class that you want to 
  383.            be the base class of the part that you are creating. The base class 
  384.            is the part that part you are creating inherits attributes, events, 
  385.            and actions from. The Base class field contains the default base 
  386.            class name of IFrameWindow, which Visual Builder uses when you 
  387.            specify that you want to create a new visual part. 
  388.  
  389.            For this example, leave IFrameWindow as the base class. 
  390.  
  391.    2. Select the Open push button to create a visual part named ToDoList whose 
  392.       parent is IFrameWindow. This causes Visual Builder to display the 
  393.       Composition Editor. 
  394.  
  395.  If you look back at the Visual Builder window, you see that the file 
  396.  todolist.vbb is now included in the list of loaded files. This file was 
  397.  created for you when you selected the Open push button in the Part - New 
  398.  window. 
  399.  
  400.  Before you place any parts in the application window, first edit its title. 
  401.  
  402.  Changing the title of the To-Do List application window 
  403.  
  404.  The new visual part that you just created contains an IFrameWindow* part. This 
  405.  will be the To-Do List application window. Change the title of this window by 
  406.  doing the following: 
  407.  
  408.    1. Hold down the Alt key. 
  409.  
  410.    2. Click on the title bar with mouse button 1. 
  411.  
  412.    3. Type the new title text, such as To-Do List. 
  413.  
  414.    4. Press Shift+Enter after you have changed the window title. 
  415.  
  416.  
  417. ΓòÉΓòÉΓòÉ 1.3. Place parts in the application window ΓòÉΓòÉΓòÉ
  418.  
  419. Now that you have created your new visual part and edited the title of the 
  420. application window, it is time to place the other parts of the To-Do List 
  421. application in the application window. 
  422.  
  423. Placing a static text part in the window 
  424.  
  425. The To-Do List application needs two static text parts. Follow these steps to 
  426. place the first static text part in the To-Do List application window: 
  427.  
  428.    1. Select , the Data entry category, from the row of icons on the left-hand 
  429.       side of the parts palette. 
  430.  
  431.    2. Select , the IStaticText* icon, from the row of icons on the right-hand 
  432.       side of the parts palette. 
  433.  
  434.       When you move the mouse pointer over the free-form surface, you see that 
  435.       it has changed to crosshairs. This means the mouse pointer is loaded with 
  436.       the IStaticText* part. 
  437.  
  438.    3. Place the crosshairs in the upper-left corner of the To-Do List 
  439.       application window's client area and click mouse button 1. 
  440.  
  441.       A static text part is placed in the window. 
  442.  
  443.    4. Change the text of the static text part to To-do item. Use the same 
  444.       method for changing text that you learned previously when you changed the 
  445.       title of the To-Do List application window. 
  446.  
  447.  Placing an entry field in the window 
  448.  
  449.  The To-Do List application needs an entry field part. Follow these steps to 
  450.  place an entry field part in the To-Do List application window: 
  451.  
  452.    1. Select , the Data entry category, from the row of icons on the left-hand 
  453.       side of the parts palette. 
  454.  
  455.    2. Select , the IEntryField* icon, from the row of icons on the right-hand 
  456.       side of the parts palette. 
  457.  
  458.    3. Place the crosshairs beneath the first static text part and click mouse 
  459.       button 1. 
  460.  
  461.       The entry field part is placed beneath the static text part. 
  462.  
  463.  Placing another static text part in the window 
  464.  
  465.  The To-Do List application needs another static text part. Follow these steps 
  466.  to place and modify this part: 
  467.  
  468.    1. Place the second static text part in the To-Do List application window. 
  469.       Use the same method for placing a static text part that you learned 
  470.       previously when you placed the first static text part in the To-Do List 
  471.       application window. 
  472.  
  473.    2. Change the text of the static text part to To-do list. Use the same 
  474.       method for changing text that you learned when you changed the title of 
  475.       the To-Do List application window. 
  476.  
  477.  Placing a list box in the window 
  478.  
  479.  Because the to-do list is to consist of a list of text strings, you want to 
  480.  store that list in an IListBox* part. Follow these steps to place a list box 
  481.  part in the To-Do List application window: 
  482.  
  483.    1. Select , the Lists category, from the row of icons on the left-hand side 
  484.       of the parts palette. 
  485.  
  486.    2. Select , the IListBox* icon, from the row of icons that Visual Builder 
  487.       displays on the right-hand side of the parts palette. 
  488.  
  489.    3. Place the crosshairs below the second static text part and click mouse 
  490.       button 1. 
  491.  
  492.       The list box part is placed beneath the second static text part. 
  493.  
  494.  Placing the push buttons in the window 
  495.  
  496.  The To-Do List application needs two push buttons, one for adding items to the 
  497.  list and one for removing items from the list. Follow these steps to place two 
  498.  push button parts in the To-Do List application window: 
  499.  
  500.    1. Select , the Buttons category, from the row of icons on the left-hand 
  501.       side of the parts palette. 
  502.  
  503.    2. Select , the IPushButton* icon, from the row of icons on the right-hand 
  504.       side of the parts palette. 
  505.  
  506.    3. Place the crosshairs below the lower-left corner of the list box and 
  507.       click mouse button 1. 
  508.  
  509.       The first push button part is placed in the window. 
  510.  
  511.    4. Select the IPushButton* icon again. 
  512.  
  513.    5. Place the crosshairs to the right of the first push button and click 
  514.       mouse button 1. 
  515.  
  516.       The second push button is placed in the window. 
  517.  
  518.    6. Change the text of the first push button to Add. Use the same method you 
  519.       used to change the text in the title bar. 
  520.  
  521.    7. Change the text of the second push button to Remove. 
  522.  
  523.  
  524. ΓòÉΓòÉΓòÉ 1.4. Size and align the parts ΓòÉΓòÉΓòÉ
  525.  
  526. Now that you have placed all of the parts you need in the application window, 
  527. it is time to resize and align them. When you have finished, your application 
  528. window should look like the following figure: 
  529.  
  530. Matching the width of the list box to the width of the entry field 
  531.  
  532. Follow these steps to match the width of the list box to the width of the entry 
  533. field: 
  534.  
  535.    1. Move the mouse pointer over the list box. 
  536.  
  537.    2. Press and hold mouse button 1. 
  538.  
  539.       The selection handles appear at the four corners of the list box. 
  540.  
  541.    3. While holding down mouse button 1, move the mouse pointer to the entry 
  542.       field. 
  543.  
  544.       The selection handles on the list box become hollow and black selection 
  545.       handles appear on the four corners of the entry field. This means that 
  546.       both parts are selected, but the entry field is the anchor part. 
  547.       Therefore, any sizing actions performed using the tool bar cause the list 
  548.       box to match the size of its anchor part, the entry field. 
  549.  
  550.    4. Select , the Match Width tool, from the row of icons on the tool bar, 
  551.       located beneath the menu bar. 
  552.  
  553.       The width of the list box changes to match that of the entry field. 
  554.  
  555.  Matching the width of the Add push button to that of the Remove push button 
  556.  
  557.  Using the techniques you learned in the preceding steps, match the width of 
  558.  the Add push button to that of the Remove push button. 
  559.  
  560.  Dragging and dropping parts in the application window 
  561.  
  562.  Before you align the parts, you might want to drag and drop some of them to 
  563.  put them in closer proximity to each other. For example, you might want the 
  564.  static text parts to be closer to the parts that they label. Follow these 
  565.  steps to drag and drop the parts in the application window: 
  566.  
  567.  Note:  The following instructions are written for dragging and dropping 
  568.         multiple parts simultaneously. If you just want to drag and drop one 
  569.         part at a time, you can skip the first step. 
  570.  
  571.    1. Select all of the parts you want to drag using the technique you learned 
  572.       previously when matching the width of the list box to the width of the 
  573.       entry field. 
  574.  
  575.    2. Move the mouse pointer over one of the parts that you selected to drag. 
  576.  
  577.    3. Press and hold mouse button 2 and move the mouse cursor. 
  578.  
  579.       Visual Builder displays an outline of the parts that you are dragging. 
  580.  
  581.    4. Move the outline to the place where you want to drop the parts and 
  582.       release mouse button 2. 
  583.  
  584.       The parts are moved to their new location. 
  585.  
  586.  Resizing the application window 
  587.  
  588.  At this point, the parts in the application window are closer to the left 
  589.  window border than to the right window border. Follow these steps to resize 
  590.  the application window: 
  591.  
  592.    1. Select the application window by clicking mouse button 1 on the title 
  593.       bar. 
  594.  
  595.    2. Move the mouse pointer over the selection handle on the lower-right 
  596.       corner of the application window. 
  597.  
  598.    3. Press and hold mouse button 1. 
  599.  
  600.    4. Resize the application window by dragging the mouse pointer towards the 
  601.       left until the right border of the application window is approximately 
  602.       the same distance from the entry field and list box as the left border 
  603.       is. 
  604.  
  605.            To size the window in only one direction, either horizontally or 
  606.            vertically, hold down the Shift key while dragging the mouse 
  607.            pointer. 
  608.  
  609.  Centering the entry field and list box within the application window 
  610.  
  611.  The entry field and list box need to be centered within the application 
  612.  window. Follow these steps to center them: 
  613.  
  614.    1. Select the entry field. 
  615.  
  616.    2. Select , the Distribute Horizontally tool, from the row of icons on the 
  617.       tool bar. 
  618.  
  619.       Visual Builder centers the entry field between the left and right borders 
  620.       of the application window. 
  621.  
  622.    3. Select the list box and then the entry field, making the entry field the 
  623.       anchor part. Use the multiple part selection technique you learned 
  624.       previously. 
  625.  
  626.    4. Select , the Align Center tool, from the row of icons on the tool bar. 
  627.  
  628.       The list box is centered beneath the entry field. 
  629.  
  630.  Aligning the static text, entry field, and list box parts so their left edges 
  631.  are even 
  632.  
  633.  The static parts need to be aligned evenly with the left edges of the entry 
  634.  field and list box. Follow these steps to align them: 
  635.  
  636.    1. Select the first static text part and then select the entry field, making 
  637.       the entry field the anchor part. Use the multiple part selection 
  638.       technique you learned previously. 
  639.  
  640.    2. Select , the Align Left tool, from the row of icons on the tool bar. 
  641.  
  642.       The first static text part is aligned even with the left edge of the 
  643.       entry field. 
  644.  
  645.    3. Repeat steps 1 and 2 for the second static text part and the list box. 
  646.  
  647.       The second static text part is aligned even with the left edge of the 
  648.       list box. 
  649.  
  650.  Aligning the top edges of the push buttons 
  651.  
  652.  The push buttons need to be aligned so that their top edges are even. Follow 
  653.  these steps to align them: 
  654.  
  655.    1. Select the Add push button and then select the Remove push button. Use 
  656.       the multiple part selection technique you learned previously. 
  657.  
  658.    2. Select , the Align Top tool. 
  659.  
  660.       Visual Builder aligns the Add push button even with the top of the Remove 
  661.       push button. 
  662.  
  663.  Spacing the push buttons evenly across the application window 
  664.  
  665.  The push buttons need to be evenly spaced across the width of the application 
  666.  window. Follow these steps to space them: 
  667.  
  668.    1. Select both push buttons. You can make either push button the anchor 
  669.       part. Use the multiple part selection technique you learned previously. 
  670.  
  671.    2. Select , the Distribute Horizontally tool. 
  672.  
  673.       Visual Builder spaces both push buttons evenly across the application 
  674.       window. 
  675.  
  676.  Centering the push buttons between the bottom edge of the list box and the 
  677.  bottom border of the application window 
  678.  
  679.  The push buttons need to be centered between the bottom edge of the list box 
  680.  and the bottom border of the application window. Follow these steps to center 
  681.  them: 
  682.  
  683.    1. Select both push buttons. You can make either push button the anchor 
  684.       part. Use the multiple part selection technique you learned previously. 
  685.  
  686.    2. Move the mouse pointer over either push button. 
  687.  
  688.    3. Press and hold mouse button 2, and position the push buttons midway 
  689.       between the bottom edge of the list box and the bottom window border. 
  690.  
  691.    4. When the push buttons are in place, release mouse button 2. 
  692.  
  693.  Your application should now look like the one shown in the following figure: 
  694.  
  695.  
  696. ΓòÉΓòÉΓòÉ 1.4.1. Connect the parts ΓòÉΓòÉΓòÉ
  697.  
  698. Now it is time for you to connect the parts so that your application can add 
  699. items to and remove items from the to-do list. You need to connect the push 
  700. buttons to the list box and entry field. The following steps show you how to do 
  701. this. 
  702.  
  703.            Before you start connecting parts, it is a good idea to make sure 
  704.            none of your parts is selected. Otherwise, the correct pop-up menus 
  705.            may not appear. To do this, hold down the Ctrl key, point to each 
  706.            item that is selected, and press mouse button 1. When the selection 
  707.            handles disappear, you know that the part is no longer selected. 
  708.  
  709.  Connecting the Add push button to the list box 
  710.  
  711.  The connection between the Add push button and the list box provides the 
  712.  information your application needs to add items to the list box. 
  713.  
  714.    1. With the mouse pointer over the Add push button, click mouse button 2. 
  715.  
  716.       A pop-up menu is displayed. 
  717.  
  718.    2. Select Connect. 
  719.  
  720.       A cascaded menu, called the connection menu, of the Add push button is 
  721.       displayed. 
  722.  
  723.    3. Select the buttonClickEvent feature. 
  724.  
  725.       Selecting the buttonClickEvent feature means that you want something to 
  726.       happen whenever a user clicks this push button. The mouse pointer changes 
  727.       to look like a spider, indicating that it is ready for you to select 
  728.       another feature. 
  729.  
  730.    4. Move the mouse pointer to the list box and click mouse button 1. 
  731.  
  732.       A pop-up menu is displayed showing the connection menu of the list box. 
  733.  
  734.    5. Select the addAsLast action. 
  735.  
  736.       Selecting the addAsLast action means that you want new items to be added 
  737.       to the end of the to-do list whenever a user clicks the Add push button. 
  738.       The connection is shown in the following figure: 
  739.  
  740.       The line connecting the Add push button to the list box is dark green. It 
  741.       points from the push button to the list box, showing that the event that 
  742.       occurs when the push button is selected will cause the list box to 
  743.       perform an action. 
  744.  
  745.       Notice that the connection line is dashed instead of solid. A dashed line 
  746.       means that the connection is incomplete. The connection is supposed to 
  747.       add something to the list box when the Add push button is clicked, but 
  748.       you have not yet supplied what needs to be added. The next step does 
  749.       that. 
  750.  
  751.    6. Move the mouse pointer to the dashed connection line between the Add push 
  752.       button and the list box. 
  753.  
  754.    7. To take a shortcut to display connection menus, hold down the Alt key and 
  755.       click mouse button 2. 
  756.  
  757.       The pop-up menu for the connection is displayed. 
  758.  
  759.    8. Select the text parameter. 
  760.  
  761.       The text parameter is the reason the connection line is dashed. You need 
  762.       to give this parameter a value. 
  763.  
  764.    9. Move the mouse pointer over the entry field, and click mouse button 1. 
  765.  
  766.       Visual Builder displays the connection menu for the list box. 
  767.  
  768.   10. Select the text attribute. 
  769.  
  770.       Selecting the text attribute here means that you want to pass the text 
  771.       that a user enters in the entry field to the text parameter of the 
  772.       addAsLast action. This text string is added to the end of the to-do list 
  773.       whenever the addAsLast action is called, which occurs whenever the Add 
  774.       push button is clicked. The completed connection is shown in the 
  775.       following figure: 
  776.  
  777.       The line connecting the entry field to the connection between the Add 
  778.       push button and the list box is violet. The solid arrow head points to 
  779.       the entry field, showing that the text attribute is the target of the 
  780.       connection. 
  781.  
  782.       The hollow arrow head points to the connection line, indicating that the 
  783.       text parameter of the addAsLast action is the source of the connection. 
  784.       When the text parameter needs a value, which occurs when a user clicks on 
  785.       the Add push button, the connection invokes the get member function of 
  786.       the entry field's text attribute. The value of that attribute (the text 
  787.       in the entry field) is returned to the text parameter and the addAsLast 
  788.       action puts the text string in the list box. 
  789.  
  790.       Notice that both of the connection lines are solid. This means that the 
  791.       connection between the Add push button and the list box now has the 
  792.       information it needs to perform its function, so the connection is 
  793.       complete. 
  794.  
  795.  Connecting the Remove push button to the list box 
  796.  
  797.  The connection between the Remove push button and the list box provides the 
  798.  information your application needs to remove items from the list box. 
  799.  
  800.    1. With the mouse pointer over the Remove push button, hold down the Alt key 
  801.       and click mouse button 2. 
  802.  
  803.       Visual Builder displays the connection menu for the Remove push button. 
  804.  
  805.    2. Select the buttonClickEvent feature. 
  806.  
  807.    3. Move the mouse pointer to the list box and click mouse button 1. 
  808.  
  809.       Visual Builder displays the connection menu for the list box. 
  810.  
  811.    4. Select the remove action. 
  812.  
  813.       Selecting the remove action means that you want your application to 
  814.       remove the selected item in the to-do list whenever a user clicks the 
  815.       Remove push button. Once again, the connection is incomplete. 
  816.  
  817.    5. Move the mouse pointer to the connection between the Remove push button 
  818.       and the list box. 
  819.  
  820.    6. Hold down the Alt key and click mouse button 2. 
  821.  
  822.       Visual Builder displays the connection menu for the connection. 
  823.  
  824.    7. Select the index parameter. 
  825.  
  826.       The index parameter is the reason the connection line is dashed. You need 
  827.       to give this parameter a value. 
  828.  
  829.    8. Move the mouse pointer over the list box and click mouse button 1. 
  830.  
  831.       Visual Builder displays the connection menu for the list box. 
  832.  
  833.    9. Select the selection attribute. 
  834.  
  835.       Selecting the selection attribute means that you want to pass the index 
  836.       of the selected item in the list box to the index parameter of the remove 
  837.       action. The remove action uses this index to determine which item to 
  838.       remove whenever the Remove push button is clicked. 
  839.  
  840.       Making this connection completes your application. It should now look 
  841.       like the one shown in the following figure: 
  842.  
  843.       Note:  In the preceding figure, we changed the shape of the connection 
  844.              between the Remove push button and the list box to make it easier 
  845.              for you to see. You can do this by selecting the connection and 
  846.              dragging the middle selection handle. 
  847.  
  848.  Now that you have made all of the connections, the next step is to generate 
  849.  your C++ source code. 
  850.  
  851.  
  852. ΓòÉΓòÉΓòÉ 1.5. Generate the C++ code for my application ΓòÉΓòÉΓòÉ
  853.  
  854. The first thing you must do to get your application ready to build is to 
  855. generate the C++ code. This is a two-part process that consists of generating 
  856. the source code for your new visual part and then generating the source code 
  857. for your main procedure. 
  858.  
  859. Generating the source code for your visual part 
  860.  
  861. To generate the C++ source code for your visual part, select FileSave and 
  862. GeneratePart source. 
  863.  
  864.            Another way to generate part code is to select , the Part Code 
  865.            Generation tool, on the tool bar. The results are the same. 
  866.  
  867.  Visual Builder generates the following files in the working directory: 
  868.  
  869.  todolist.cpp   The C++ code for your ToDoList part. 
  870.  todolist.hpp   The C++ header file for your ToDoList part. 
  871.  todolist.h     The resource header file for your todolist.cpp file. 
  872.  todolist.rc    The resource file for your todolist.cpp file. 
  873.  
  874.  Generating the source code for your main() function 
  875.  
  876.  To generate the source code for your main() procedure, select FileSave and 
  877.  Generatemain() for part. Visual Builder generates the following files in the 
  878.  working directory: 
  879.  
  880.  todolist.app   The main function for your application. 
  881.  
  882.                 Note:  If you start Visual Builder from a WorkFrame project, 
  883.                        the name of this file is vbmain.cpp. 
  884.  todolist.mak   The make file that you specify when you build your application. 
  885.  
  886.  You have now generated the C++ code for your application. The next step is to 
  887.  build the application. 
  888.  
  889.  
  890. ΓòÉΓòÉΓòÉ 1.6. Build the application ΓòÉΓòÉΓòÉ
  891.  
  892. Building your application consists of compiling and linking it. To build your 
  893. application, do the following: 
  894.  
  895.    1. Open an OS/2 window. 
  896.  
  897.    2. Change to your Visual Builder working directory. 
  898.  
  899.    3. Enter the following command: 
  900.  
  901.             nmake todolist.mak
  902.  
  903.       This command produces the following files: 
  904.  
  905.       todolist.exe        The executable file for your application. 
  906.       todolist.map        The application configuration map. 
  907.       todolist.o          The object file for your application. 
  908.  
  909.                           Note:  If you start Visual Builder from a WorkFrame 
  910.                                  project, the name of this file is vbmain.obj. 
  911.       todolist.obj        The object file for your part. Visual Builder 
  912.                           provides a separate object module for your part that 
  913.                           is used when compiling this part with other parts. 
  914.       todolist.res        The binary resource file that is bound to 
  915.                           todolist.exe. 
  916.  
  917.  You have now built your application; the next step is to run your application. 
  918.  
  919.  
  920. ΓòÉΓòÉΓòÉ 1.7. Run the application ΓòÉΓòÉΓòÉ
  921.  
  922. To run your application from the same OS/2 command prompt from which you 
  923. entered the nmake command, enter the following: 
  924.  
  925. todolist
  926.  
  927. Once your application is running, experiment with it to make sure it works as 
  928. you designed it. That is all there is to it! 
  929.  
  930. You can add a finishing touch to your application by creating an OS/2 program 
  931. object. Create a program object from the OS/2 Templates folder, specifying the 
  932. name todolist.exe as the program name and the directory that contains 
  933. todolist.exe as the working directory. Once you have done this, you can run 
  934. your application by simply double-clicking on the program object you just 
  935. created. 
  936.  
  937.  
  938. ΓòÉΓòÉΓòÉ 1.8. Exit the Composition Editor and Visual Builder ΓòÉΓòÉΓòÉ
  939.  
  940. To exit either the Composition Editor or Visual Builder, do either of the 
  941. following. 
  942.  
  943. Note:  When you exit Visual Builder, any changes you have made to the 
  944.        selections in the Options menu are saved. Therefore, if you want certain 
  945.        options to be selected or deselected the next time you start Visual 
  946.        Builder, be sure to select or deselect them before exiting Visual 
  947.        Builder. 
  948.  
  949.      Select FileExit. 
  950.      Double-click on the system menu icon in the window. 
  951.  
  952.  If you try to exit Visual Builder while one or more editor windows is open, 
  953.  Visual Builder displays a message asking if you want to close the editors and 
  954.  Visual Builder. You can select either of the following: 
  955.  
  956.      The OK push button to exit the windows. 
  957.      The Cancel push button to cancel the exit request. 
  958.  
  959.  If you select the OK push button with this message displayed or try to exit an 
  960.  editor and the open editor window contains unsaved changes, Visual Builder 
  961.  displays a message asking if you want to save the changes for each open editor 
  962.  before exiting. You can select either of the following: 
  963.  
  964.      The Yes push button to save the changes and exit. 
  965.      The No push button to exit without saving the changes. 
  966.      The Cancel push button to cancel the exit request. 
  967.  
  968.  
  969. ΓòÉΓòÉΓòÉ 2. ...Set up and starting Visual Builder ΓòÉΓòÉΓòÉ
  970.  
  971. This chapter tells you how to do the following: 
  972.  
  973.      Set up your WorkFrame project to use Visual Builder 
  974.  
  975.      Start Visual Builder 
  976.  
  977.  
  978. ΓòÉΓòÉΓòÉ 2.1. Set up my WorkFrame project to use Visual Builder ΓòÉΓòÉΓòÉ
  979.  
  980. If you have created a WorkFrame project and will be running Visual Builder from 
  981. the project folder, you should set up the project as follows before starting 
  982. Visual Builder. 
  983.  
  984. Note:  We recommend that you use a Project Smarts Visual Builder template in 
  985.        your WorkFrame project. Refer to the VisualAge C++ User's Guide for 
  986.        information on how to do this. 
  987.  
  988.    1. Open the settings notebook for the project folder by doing the following: 
  989.  
  990.         a. Click on the project folder with mouse button 2. 
  991.  
  992.         b. Select OpenSettings. 
  993.  
  994.            The settings notebook appears. 
  995.  
  996.    2. Set the names of the executable file and the make file by doing the 
  997.       following: 
  998.  
  999.         a. On the Target page, type the name that you want your executable file 
  1000.            to have in the Name field. 
  1001.  
  1002.         b. Type the name that you want your make file to have in the Makefile 
  1003.            field. 
  1004.  
  1005.    3. Set the directory in which your project files will be stored by doing the 
  1006.       following: 
  1007.  
  1008.         a. Select the tab for the Location OS/2 Files page. 
  1009.  
  1010.         b. Type the full path for the directory in which you want to store your 
  1011.            project files in the multiline edit field on this page. This is the 
  1012.            directory in which Visual Builder puts the files for your 
  1013.            application when you generate your source code. 
  1014.  
  1015.    4. Inherit the settings of a C++ project by doing the following: 
  1016.  
  1017.         a. Select the tab for the Inheritance page. 
  1018.  
  1019.         b. Select the Add push button. 
  1020.  
  1021.            A dialog is displayed in which you select the project whose settings 
  1022.            you want to inherit. 
  1023.  
  1024.         c. Double-click on the Desktop directory in the Directory list box. 
  1025.  
  1026.         d. Double-click on the VisualAge C++ 3.0 directory, also in the 
  1027.            Directory list box. 
  1028.  
  1029.         e. Select the C Set ++ Project file in the File list box. 
  1030.  
  1031.         f. Select the Inherit push button. 
  1032.  
  1033.            This puts all of the WorkFrame tools, including Visual Builder, that 
  1034.            you need for a C++ project in the project's pop-up menu, giving you 
  1035.            easier access to them. 
  1036.  
  1037.    5. Close the settings notebook. 
  1038.  start Visual Builder. 
  1039.  
  1040.  
  1041. ΓòÉΓòÉΓòÉ 2.2. Start Visual Builder ΓòÉΓòÉΓòÉ
  1042.  
  1043. You can start Visual Builder in the following ways: 
  1044.  
  1045.      From the C/C++ window 
  1046.      From the Tools folder icon 
  1047.      From a WorkFrame Project folder 
  1048.  
  1049.  Starting Visual Builder from the C/C++ window 
  1050.  
  1051.  To start Visual Builder from the C/C++ window, do the following: 
  1052.  
  1053.    1. Double-click on the icon for the VisualAge C++ folder. 
  1054.  
  1055.       The folder opens. 
  1056.  
  1057.    2. Double-click on the C/C++ Window icon. 
  1058.  
  1059.       The C/C++ window opens. 
  1060.  
  1061.    3. Type the following: 
  1062.  
  1063.             icsvb
  1064.  
  1065.    4. Press the Enter key. 
  1066.  
  1067.       Visual Builder displays the Visual Builder window, as shown in the 
  1068.       following figure. 
  1069.  
  1070.  Starting Visual Builder from the Tools folder 
  1071.  
  1072.  To start Visual Builder from the Tools folder, do the following: 
  1073.  
  1074.    1. Double-click on the icon for the VisualAge C++ folder. 
  1075.  
  1076.       The folder opens. 
  1077.  
  1078.    2. Double-click on the Tools folder icon. 
  1079.  
  1080.       The folder opens. 
  1081.  
  1082.    3. Double-click on the Visual Builder icon. 
  1083.  
  1084.       Visual Builder displays the Visual Builder window, as shown in the 
  1085.       preceding figure. 
  1086.  
  1087.  Starting Visual Builder from a WorkFrame Project folder 
  1088.  
  1089.  You can start Visual Builder from a WorkFrame Project folder in the following 
  1090.  ways. 
  1091.  
  1092.  Note:  The following steps assume that your project inherits the settings of a 
  1093.         C Set ++ project or that it was created using a Project Smarts 
  1094.         template. 
  1095.  
  1096.      If the WorkFrame Project folder is closed, you can click on the folder 
  1097.       with mouse button 2 and select Visual from the pop-up menu. 
  1098.  
  1099.      If the WorkFrame Project folder is open, you can do any one of the 
  1100.       following: 
  1101.  
  1102.         -  Double-click on the name of the .vbb file 
  1103.  
  1104.         -  Click on the name of the .vbb file with mouse button 2 and select 
  1105.            Visual from the pop-up menu. 
  1106.  
  1107.         -  Click on the white space in the project folder with mouse button 2 
  1108.            and select Visual from the pop-up menu. 
  1109.  
  1110.       Visual Builder displays the Visual Builder window, as shown in the 
  1111.       preceding figure. If you double-clicked on a .vbb file to open Visual 
  1112.       Builder, that file and all other .vbb files that you selected are 
  1113.       preloaded. 
  1114.  
  1115.  
  1116. ΓòÉΓòÉΓòÉ 3. ...Load part files ΓòÉΓòÉΓòÉ
  1117.  
  1118. To give Visual Builder access to parts, you must load the contents of the part 
  1119. files that contain those parts by doing the following: 
  1120.  
  1121.    1. Select FileLoad file in the Visual Builder window. 
  1122.  
  1123.       Visual Builder displays the window shown below: 
  1124.  
  1125.    2. Select the file or files that you want to load. 
  1126.  
  1127.    3. Select the OK push button. 
  1128.  
  1129.                      When you are just loading one file, it is quicker to 
  1130.                      double-click on the file name instead of selecting the 
  1131.                      file name and the OK push button. 
  1132.  
  1133.       The file name or names are displayed in the Loaded Part Files list box in 
  1134.       the Visual Builder window. The following figure shows the Visual Builder 
  1135.       window with multiple .vbb files loaded. 
  1136.  
  1137.  
  1138. ΓòÉΓòÉΓòÉ 4. ...Unload part files ΓòÉΓòÉΓòÉ
  1139.  
  1140. If a part file appears in the Loaded Part Files list box in the Visual Builder 
  1141. window, Visual Builder has access to the parts that the part file contains. If 
  1142. you do not want Visual Builder to have access to those parts, you can unload 
  1143. the part file, with the exception of vbbase.vbb. To unload one or more part 
  1144. files, do the following: 
  1145.  
  1146.    1. Select one or more files in the Loaded Part Files list box. 
  1147.  
  1148.       To select multiple files, hold down the Ctrl key while clicking on a file 
  1149.       name with mouse button 1. 
  1150.  
  1151.    2. Select FileUnload file. 
  1152.  
  1153.       The following window is displayed showing the files you selected to 
  1154.       unload: 
  1155.  
  1156.       At this point, you can review the files that you selected and make any 
  1157.       changes by deselecting any file or files that you want to remain loaded. 
  1158.  
  1159.    3. Select the Unload push button. 
  1160.  
  1161.       The window disappears and the file names are removed from the Loaded Part 
  1162.       Files list box. 
  1163.  
  1164.  
  1165. ΓòÉΓòÉΓòÉ 5. ...Select all part files ΓòÉΓòÉΓòÉ
  1166.  
  1167. To select all of the part files, select EditSelect all files. Visual Builder 
  1168. highlights all of the part files listed in the Loaded Part Files list box. 
  1169.  
  1170. At this point, you can review the list to see if you want to deselect any of 
  1171. the files. 
  1172.  
  1173.  
  1174. ΓòÉΓòÉΓòÉ 6. ...Deselect all part files ΓòÉΓòÉΓòÉ
  1175.  
  1176. To deselect all of the part files, select EditDeselect all files. Visual 
  1177. Builder removes the highlighting from all of the selected part files listed in 
  1178. the Loaded Part Files list box. 
  1179.  
  1180. At this point, you can review the list to see if you want to select any of the 
  1181. files. 
  1182.  
  1183.  
  1184. ΓòÉΓòÉΓòÉ 7. ...Customize the information area ΓòÉΓòÉΓòÉ
  1185.  
  1186. The following options allow you to specify the kind of information that Visual 
  1187. Builder displays in the information area for a selected part in the Visual 
  1188. Builder window. To use these options, select OptionsInformation area and then 
  1189. select one of the following options: 
  1190.  
  1191.  Show base class 
  1192.    Displays the C++ notation for a class and its base class. For example, if 
  1193.    you select IVBContainerControl when this option is selected, Visual Builder 
  1194.    displays the following in the information area to show that IControl is 
  1195.    IVBContainerControl's base class: 
  1196.  
  1197.       IVBContainerControl::IControl
  1198.  
  1199.  Show description 
  1200.    Displays a brief description of the selected part. For example, if you 
  1201.    select IVBContainerControl when this option is selected, Visual Builder 
  1202.    displays the following description in the information area: 
  1203.  
  1204.       IBM container control, any view
  1205.  
  1206.  Show full file names 
  1207.    Displays the name of the part file in which the part is stored. For example, 
  1208.    if you select IVBContainerControl when this option is selected, Visual 
  1209.    Builder displays the following file name in the information area to show 
  1210.    that VBBase.vbb contains the IVBContainerControl part. 
  1211.  
  1212.       VBBase.vbb
  1213.  
  1214.  
  1215. ΓòÉΓòÉΓòÉ 8. ...See the base files ΓòÉΓòÉΓòÉ
  1216.  
  1217. Select OptionsShow base files to see the names of the parts in the .vbb files 
  1218. that Visual Builder provides, as follows: 
  1219.  
  1220.  VBBase.vbb 
  1221.    Contains the base parts that Visual Builder provides. 
  1222.  
  1223.  VBCC.vbb 
  1224.    Contains sample parts based on the IBM Collection Class Library. 
  1225.  
  1226.  VBMM.vbb 
  1227.    Contains sample multimedia parts. 
  1228.  
  1229.  
  1230. ΓòÉΓòÉΓòÉ 9. ...See where part files are located ΓòÉΓòÉΓòÉ
  1231.  
  1232. Select OptionsShow full file names to see the drive and directory where each 
  1233. of your part files is stored. 
  1234.  
  1235.  
  1236. ΓòÉΓòÉΓòÉ 10. ...See the type list ΓòÉΓòÉΓòÉ
  1237.  
  1238. To display a type list, do the following: 
  1239.  
  1240.    1. Select the part file or files for which you want to see defined types. 
  1241.  
  1242.    2. Select OptionsShow type list. 
  1243.  
  1244.       A list box titled Loaded Type Information is displayed at the bottom of 
  1245.       the Visual Builder window, as shown in the following figure. 
  1246.  
  1247.  
  1248. ΓòÉΓòÉΓòÉ 11. ...Use File Allocation Table (FAT) file names ΓòÉΓòÉΓòÉ
  1249.  
  1250. Select Default to FAT file names if your system uses the File Allocation Table 
  1251. (FAT) file system instead of the High Performance File System (HPFS). This 
  1252. option is selected by default when you first install VisualAge C++. The FAT 
  1253. file system limits file names to a maximum of eight characters and file name 
  1254. extensions to a maximum of three characters. 
  1255.  
  1256.  
  1257. ΓòÉΓòÉΓòÉ 12. ...Generate make files ΓòÉΓòÉΓòÉ
  1258.  
  1259. Select Generate make files if you want Visual Builder to generate a make file 
  1260. for you when you generate the default source code for the main() function of 
  1261. your application. 
  1262.  
  1263.  
  1264. ΓòÉΓòÉΓòÉ 13. ...Set the working directory ΓòÉΓòÉΓòÉ
  1265.  
  1266. Select OptionsSet working directory if you want to store files created with 
  1267. Visual Builder in a different working directory. The default working directory 
  1268. is the directory in which you installed Visual Builder. 
  1269.  
  1270. When you select this option, Visual Builder displays the following window: 
  1271.  
  1272. To change the working directory, do the following: 
  1273.  
  1274.    1. Type the complete path to the directory in which you want to store Visual 
  1275.       Builder files that you create. 
  1276.  
  1277.       The path consists of all directories that must be opened to get to the 
  1278.       working directory. 
  1279.  
  1280.    2. Select the OK push button. 
  1281.  
  1282.  If the path you enter in the Working Directory window is invalid, Visual 
  1283.  Builder displays an error message and resets the path to the last valid path 
  1284.  that was entered. 
  1285.  
  1286.  
  1287. ΓòÉΓòÉΓòÉ 14. ...Refresh the display ΓòÉΓòÉΓòÉ
  1288.  
  1289. You might want to ensure that the information displayed in the Visual Builder 
  1290. window is current, for example, when you have loaded and unloaded several part 
  1291. files or moved parts from one part file to another. If such a situation occurs, 
  1292. you can cause the display to show the latest updates by selecting EditRefresh. 
  1293.  
  1294.  
  1295. ΓòÉΓòÉΓòÉ 15. ...Work with the Class Editor ΓòÉΓòÉΓòÉ
  1296.  
  1297.      Entering a description of a part 
  1298.  
  1299.      Moving a part to a different .vbb file 
  1300.  
  1301.      Seeing the base class of a part 
  1302.  
  1303.      Modifying a part's constructor 
  1304.  
  1305.      Specifying your own constructor code 
  1306.  
  1307.      Specifying your own destructor code 
  1308.  
  1309.      Specifying a library file 
  1310.  
  1311.      Specifying a starting resource ID 
  1312.  
  1313.      Specifying a unique icon for your part 
  1314.  
  1315.      Specifying the names of your code generation files 
  1316.  
  1317.      Specifying files to include when you build your application 
  1318.  
  1319.  
  1320. ΓòÉΓòÉΓòÉ 15.1. Enter a description of a part ΓòÉΓòÉΓòÉ
  1321.  
  1322. The Description field in the Class Editor is an entry field in which you can 
  1323. enter a description of your part. This description is used in the following 
  1324. places: 
  1325.  
  1326.      If you add your part to the parts palette, the description appears in the 
  1327.       information area at the bottom of the Composition Editor when you select 
  1328.       the part. 
  1329.  
  1330.      If you export your part information into a .vbe file, the description is 
  1331.       included in the first line. 
  1332.  
  1333.       In the following example, the text shown in quotation marks was taken 
  1334.       from the Description field for the ToDoList part. 
  1335.  
  1336.             //VBBeginPartInfo: ToDoList,"To-Do List sample application"
  1337.  
  1338.  
  1339. ΓòÉΓòÉΓòÉ 15.2. ...Move a part to a different .vbb file from the Class Editor ΓòÉΓòÉΓòÉ
  1340.  
  1341. The Part file specification field in the Class Editor shows the name of the 
  1342. .vbb file that contains this part. If you want to move this part to another 
  1343. .vbb file while using the Class Editor, do the following: 
  1344.  
  1345.    1. Replace the name of the current .vbb file with the name of another .vbb 
  1346.       file in which you want to store the part. 
  1347.  
  1348.    2. Select FileSave to apply the change. 
  1349.  
  1350.       Visual Builder moves the part from the former .vbb file to the one you 
  1351.       just specified. If the .vbb file you specified does not exist, Visual 
  1352.       Builder creates it for you. 
  1353.  
  1354.  
  1355. ΓòÉΓòÉΓòÉ 15.3. ...See the base class of a part ΓòÉΓòÉΓòÉ
  1356.  
  1357. The Base class - access level field in the Class Editor shows the name of the 
  1358. base class for your part. This is the class name that you specified as the base 
  1359. class when you created the part. 
  1360.  
  1361. This field also shows you the current access level to the base class:  public, 
  1362. protected, or private. 
  1363.  
  1364. You cannot modify the base class name or the access level. 
  1365.  
  1366.  
  1367. ΓòÉΓòÉΓòÉ 15.4. ...Modify a part's constructor ΓòÉΓòÉΓòÉ
  1368.  
  1369. The Constructor field in the Class Editor initially contains a default 
  1370. constructor that Visual Builder inserts for you. If the default constructor 
  1371. does not do exactly what you want it to do, you can modify it by typing over 
  1372. the text in this field. 
  1373.  
  1374. If you want your class to have multiple constructors, we recommend putting them 
  1375. in the .hpv and .cpv files that contain your default feature code and then 
  1376. including them when you generate your code. Otherwise, if you modify your code 
  1377. after generating it, your changes will be lost the next time you generate your 
  1378. code. 
  1379.  
  1380. For information about including files, see Specifying Files for Visual Builder 
  1381. to Include When You Build Your Application. 
  1382.  
  1383.  
  1384. ΓòÉΓòÉΓòÉ 15.5. ...Specify my own constructor code ΓòÉΓòÉΓòÉ
  1385.  
  1386. Use the User constructor code field in the Class Editor to enter your own 
  1387. constructor code for the part that you are editing. If you enter code in this 
  1388. field, it is added at the end of the default constructor that Visual Builder 
  1389. provides for you. If you have more than one line of code, put your code into a 
  1390. function and put the function name in this field. Put the code for this 
  1391. function in the files that Visual Builder creates when you generate your 
  1392. default feature code. These file names are specified in the User .hpv file and 
  1393. User .cpv file fields. 
  1394.  
  1395.  
  1396. ΓòÉΓòÉΓòÉ 15.6. ...Specify my own destructor code ΓòÉΓòÉΓòÉ
  1397.  
  1398. Use the User destructor code field in the Class Editor to enter your own 
  1399. destructor code for the part that you are editing. If you enter code in this 
  1400. field, it is added at the beginning of the default destructor that Visual 
  1401. Builder provides for you. If you have more than one line of code, put your code 
  1402. into a function and put the function name in this field. Put the code for this 
  1403. function in the files that Visual Builder creates when you generate your 
  1404. default feature code. These file names are specified in the User .hpv file and 
  1405. User .cpv file fields. 
  1406.  
  1407.  
  1408. ΓòÉΓòÉΓòÉ 15.7. ...Specify a library file ΓòÉΓòÉΓòÉ
  1409.  
  1410. Use the .LIB file name field in the Class Editor to specify the name of a 
  1411. library file (partname.lib) that you want to to be included when you generate 
  1412. the source code for your part. The library file points to a .dll file that 
  1413. contains information about a subpart in your application that was compiled 
  1414. separately. When you generate the source code for your part, Visual Builder 
  1415. includes a #pragma statement to include the library file. 
  1416.  
  1417. When Visual Builder generates make files for other parts that use this part, 
  1418. the .lib file is specified in the make file as a dependency. 
  1419.  
  1420.  
  1421. ΓòÉΓòÉΓòÉ 15.8. ...Specify a starting resource ID ΓòÉΓòÉΓòÉ
  1422.  
  1423. Use the Starting resource id field in the Class Editor to specify the number 
  1424. that Visual Builder is to use as a starting point for generating resource IDs 
  1425. for your part. The resource IDs that Visual Builder generates are written into 
  1426. a file named partname.h, which Visual Builder creates when you generate code 
  1427. for your part. 
  1428.  
  1429. The check box next to the field enables the starting resource ID. The first 
  1430. time you select this check box, Visual Builder inserts a default starting 
  1431. resource ID. You can change this number. 
  1432.  
  1433. If you deselect the check box, the field is disabled. The number in the field 
  1434. is included in the partname.h file when you generate your code, but it is not 
  1435. referenced. 
  1436.  
  1437. Generating resource IDs is useful if the text in your application is being 
  1438. translated into another language. See Enabling National Language Support for an 
  1439. Application for more information about using starting resource IDs. 
  1440.  
  1441.  
  1442. ΓòÉΓòÉΓòÉ 15.9. ...Specify a unique icon for my part ΓòÉΓòÉΓòÉ
  1443.  
  1444. Fill in the fields in the Icon group box in the Class Editor before you add 
  1445. your part to the parts palette so that you can use an icon other than the 
  1446. default icon provided by Visual Builder to represent your part. The default 
  1447. icon is . 
  1448.  
  1449. The Icon group box contains the following fields: 
  1450.  
  1451.  DLL name An entry field in which you enter the name of the resource DLL that 
  1452.    contains the icon you want to use. Enter just the file name, not the 
  1453.    extension. 
  1454.  
  1455.  Resource Id The resource ID number of the icon in the DLL whose name you 
  1456.    entered in the DLL name field. 
  1457.  
  1458.  When you enter both the DLL name and a valid resource ID number, Visual 
  1459.  Builder displays the icon that matches the resource ID number in the area 
  1460.  below the Resource Id field. This occurs when you click on another field. This 
  1461.  allows you to verify that you entered the correct resource ID number. 
  1462.  
  1463.  
  1464. ΓòÉΓòÉΓòÉ 15.10. ...Specify the names of my code generation files ΓòÉΓòÉΓòÉ
  1465.  
  1466. The Code generation files group box in the Class Editor contains the following 
  1467. fields: 
  1468.  
  1469.      A C++ header file (.hpp) field 
  1470.      A C++ code file (.cpp) field 
  1471.  
  1472.  The file names displayed in these fields are the files into which your C++ 
  1473.  header file code and source code are written. This occurs when you generate 
  1474.  default code from the Visual Builder window or from any of the editors by 
  1475.  selecting FileSave and GeneratePart source. 
  1476.  
  1477.  For complete information about generating default source code, see Generating 
  1478.  Source Code for Parts and Applications. 
  1479.  
  1480.  The fields in the group box initially contain .hpp and .cpp file names that 
  1481.  are based on the name of the part you are editing. To change the file names in 
  1482.  these fields, select FileSave so that Visual Builder uses the new file names. 
  1483.  
  1484.  Warning: If the files already exist, Visual Builder replaces their contents 
  1485.  with the code currently being generated. 
  1486.  
  1487.  Visual Builder writes both files to the current directory. 
  1488.  
  1489.  
  1490. ΓòÉΓòÉΓòÉ 15.11. ...Specify files to include when I build my application ΓòÉΓòÉΓòÉ
  1491.  
  1492. The User files included in generation group box in the Class Editor allows you 
  1493. to specify files that you want to be included when you build your application. 
  1494. These fields are typically used to contain the names of the files that hold 
  1495. user code that Visual Builder is to use when you generate default feature code 
  1496. for your part's features. 
  1497.  
  1498. The .hpv and .cpv file extensions are used because the WorkFrame Build tool 
  1499. tries to compile every .cpp file that it finds into an object module (.obj 
  1500. file). Since these files are not meant to be compiled by themselves, we 
  1501. selected a different file extension for you to use to prevent this from 
  1502. happening. 
  1503.  
  1504.  
  1505. ΓòÉΓòÉΓòÉ 16. ...Add an attribute ΓòÉΓòÉΓòÉ
  1506.  
  1507. To add an attribute in the Part Interface Editor, do one of the following: 
  1508.  
  1509.      If you want to add the attribute using the default attribute type, get 
  1510.       member function, set member function, and event identification that 
  1511.       Visual Builder provides, enter a name in the Attribute name field and 
  1512.       select the Add with defaults push button. 
  1513.  
  1514.       Visual Builder adds the attribute to the part interface. 
  1515.  
  1516.      If you want to see the default attribute type, get member function, set 
  1517.       member function, and event identification that Visual Builder provides 
  1518.       before you add the attribute, select the Defaults push button. 
  1519.  
  1520.      If you want to add the attribute after seeing or modifying its default 
  1521.       information or after entering your own information, select the Add push 
  1522.       button. 
  1523.  
  1524.       Visual Builder adds the attribute to the part interface. 
  1525.  
  1526.  
  1527. ΓòÉΓòÉΓòÉ 17. ...Change an attribute ΓòÉΓòÉΓòÉ
  1528.  
  1529. To change, or update, an attribute in the Part Interface Editor, do the 
  1530. following. 
  1531.  
  1532. Note:  You can change anything about an attribute except its name. To change an 
  1533.        attribute's name, you must create a new attribute with the name you want 
  1534.        to use. 
  1535.  
  1536.    1. Select the attribute that you want to change or type its name in the 
  1537.       Attribute name field. 
  1538.  
  1539.    2. Make the changes that you want to make in the fields on the right side of 
  1540.       the Attribute page. 
  1541.  
  1542.    3. Select the Update push button. 
  1543.  
  1544.       Visual Builder saves the changes you made. 
  1545.  
  1546.  
  1547. ΓòÉΓòÉΓòÉ 18. ...Delete an attribute ΓòÉΓòÉΓòÉ
  1548.  
  1549. To delete an attribute in the Part Interface Editor, do the following: 
  1550.  
  1551.    1. Select the attribute that you want to delete or type its name in the 
  1552.       Attribute name field. 
  1553.  
  1554.    2. Select the Delete push button. 
  1555.  
  1556.       Visual Builder deletes the attribute. 
  1557.  
  1558.       Note:  If you added the attribute that you just deleted to the preferred 
  1559.              features list, you must go to the Preferred page and delete it 
  1560.              there, too. 
  1561.  
  1562.  
  1563. ΓòÉΓòÉΓòÉ 19. ...Set defaults for an attribute ΓòÉΓòÉΓòÉ
  1564.  
  1565. To set defaults for an attribute in the Part Interface Editor, do the 
  1566. following: 
  1567.  
  1568.    1. Select the attribute that you want to set defaults for or type its name 
  1569.       in the Attribute name field. 
  1570.  
  1571.    2. Change the attribute type in the Attribute type field. 
  1572.  
  1573.    3. Select the Defaults push button. 
  1574.  
  1575.       Visual Builder changes all occurrences of the former attribute type to 
  1576.       the new attribute type in the fields on the right side of the Attribute 
  1577.       page. 
  1578.  
  1579.  
  1580. ΓòÉΓòÉΓòÉ 20. ...Clear the Attribute page fields ΓòÉΓòÉΓòÉ
  1581.  
  1582. To clear the fields on the Attribute page, select the Clear push button. 
  1583.  
  1584. Visual Builder clears all of the fields on the Attribute page. 
  1585.  
  1586.  
  1587. ΓòÉΓòÉΓòÉ 21. ...Add an event ΓòÉΓòÉΓòÉ
  1588.  
  1589. To add an event in the Part Interface Editor, do one of the following: 
  1590.  
  1591.      If you want to add the event using the default event identification that 
  1592.       Visual Builder provides, enter a name in the Event name field and select 
  1593.       the Add with defaults push button. 
  1594.  
  1595.       Visual Builder adds the event to the part interface. 
  1596.  
  1597.      If you want to see the default event identification that Visual Builder 
  1598.       provides before you add the event, select the Defaults push button. 
  1599.  
  1600.  To add a parameter and its type to this table, do the following. 
  1601.  
  1602.  Note:  You can add only one parameter and type for each event. 
  1603.  
  1604.    1. Move the mouse pointer over the table and click mouse button 2. 
  1605.  
  1606.       Visual Builder displays a pop-up menu. 
  1607.  
  1608.    2. Select either Add before or Add after. 
  1609.  
  1610.       Visual Builder adds a row to the table with a default parameter name and 
  1611.       type. 
  1612.  
  1613.    3. If you want to change the defaults, do the following: 
  1614.  
  1615.         a. Click on the parameter name with mouse button 1. 
  1616.  
  1617.         b. Type the parameter name you want to use. 
  1618.  
  1619.         c. Click on the parameter type with mouse button 1. 
  1620.  
  1621.         d. Type the parameter type you want to use. 
  1622.  
  1623.         e. Select the Update push button. 
  1624.  
  1625.  
  1626. ΓòÉΓòÉΓòÉ 22. ...Change an event ΓòÉΓòÉΓòÉ
  1627.  
  1628. To change, or update, an event, do the following. 
  1629.  
  1630. Note:  You can change anything about an event except its name. To change an 
  1631.        event's name, you must create a new event with the name you want to use. 
  1632.  
  1633.    1. Select the event that you want to change or type its name in the Event 
  1634.       name field. 
  1635.  
  1636.    2. Make the changes that you want to make in the fields on the right side of 
  1637.       the Event page. 
  1638.  
  1639.    3. Select the Update push button. 
  1640.  
  1641.       Visual Builder saves the changes you made. 
  1642.  
  1643.  
  1644. ΓòÉΓòÉΓòÉ 23. ...Delete an event ΓòÉΓòÉΓòÉ
  1645.  
  1646. To delete an event, do the following: 
  1647.  
  1648.    1. Select the event that you want to delete or type its name in the Event 
  1649.       name field. 
  1650.  
  1651.    2. Select the Delete push button. 
  1652.  
  1653.       Visual Builder deletes the event. 
  1654.  
  1655.       Note:  If you added the event that you just deleted to the preferred 
  1656.              features list, you must go to the Preferred page and delete it 
  1657.              there, too. 
  1658.  
  1659.  
  1660. ΓòÉΓòÉΓòÉ 24. ...Set defaults for an event ΓòÉΓòÉΓòÉ
  1661.  
  1662. To set defaults for an event, do the following: 
  1663.  
  1664.    1. Select the event that you want to set defaults for or type its name in 
  1665.       the Event name field. 
  1666.  
  1667.    2. Select the Defaults push button. 
  1668.  
  1669.       Visual Builder changes the former event identification to the default 
  1670.       event identification in the Event identification field. 
  1671.  
  1672.  
  1673. ΓòÉΓòÉΓòÉ 25. ...Clear the Event page fields ΓòÉΓòÉΓòÉ
  1674.  
  1675. To clear the fields on the Event page, select the Clear push button. 
  1676.  
  1677. Visual Builder clears all of the fields on the Event page. 
  1678.  
  1679.  
  1680. ΓòÉΓòÉΓòÉ 26. ...Add an action ΓòÉΓòÉΓòÉ
  1681.  
  1682. To add an action in the Part Interface Editor, do one of the following: 
  1683.  
  1684.      If you want to add the action using the part you are editing as the 
  1685.       default return type, enter a name in the Action name field and select the 
  1686.       Add with defaults push button. 
  1687.  
  1688.       Visual Builder adds the action to the part interface. 
  1689.  
  1690.      If you want to see the default return type before you add the action, 
  1691.       select the Defaults push button. 
  1692.  
  1693.  
  1694. ΓòÉΓòÉΓòÉ 27. ...Change an action ΓòÉΓòÉΓòÉ
  1695.  
  1696. To change, or update, an action in the Part Interface Editor, do the following. 
  1697.  
  1698. Note:  You can change anything about an action except its name. To change an 
  1699.        action's name, you must create a new action with the name you want to 
  1700.        use. 
  1701.  
  1702.    1. Select the action that you want to change or type its name in the Action 
  1703.       name field. 
  1704.  
  1705.    2. Make the changes that you want to make in the fields on the right side of 
  1706.       the Action page. 
  1707.  
  1708.    3. Select the Update push button. 
  1709.  
  1710.       Visual Builder saves the changes you made. 
  1711.  
  1712.  
  1713. ΓòÉΓòÉΓòÉ 28. ...Delete an action ΓòÉΓòÉΓòÉ
  1714.  
  1715. To delete an action in the Part Interface Editor, do the following: 
  1716.  
  1717.    1. Select the action that you want to delete or type its name in the Action 
  1718.       name field. 
  1719.  
  1720.    2. Select the Delete push button. 
  1721.  
  1722.       Visual Builder deletes the action. 
  1723.  
  1724.       Note:  If you added the action that you just deleted to the preferred 
  1725.              features list, you must go to the Preferred page and delete it 
  1726.              there, too. 
  1727.  
  1728.  
  1729. ΓòÉΓòÉΓòÉ 29. ...Set defaults for an action ΓòÉΓòÉΓòÉ
  1730.  
  1731. To set defaults for an action in the Part Interface Editor, do the following: 
  1732.  
  1733.    1. Select the action that you want to set defaults for or type its name in 
  1734.       the Action name field. 
  1735.  
  1736.    2. Select the Defaults push button. 
  1737.  
  1738.       Visual Builder changes the former return type to the default return type 
  1739.       in both the Action member function and the Return type fields. 
  1740.  
  1741.  
  1742. ΓòÉΓòÉΓòÉ 30. ...Clear the Action page fields ΓòÉΓòÉΓòÉ
  1743.  
  1744. To clear the fields on the Action page, select the Clear push button. 
  1745.  
  1746. Visual Builder clears all of the fields on the Action page. 
  1747.  
  1748.  
  1749. ΓòÉΓòÉΓòÉ 31. ...Promote a feature ΓòÉΓòÉΓòÉ
  1750.  
  1751. To promote a feature in the Part Interface Editor for a subpart, do the 
  1752. following: 
  1753.  
  1754.    1. Select a subpart name from the list box beneath the Subpart name field or 
  1755.       type the name in the field. 
  1756.  
  1757.       Visual Builder displays the name of the subpart that you select in the 
  1758.       Subpart name field. 
  1759.  
  1760.    2. Select a feature type from the list box beneath the Feature type field or 
  1761.       type the name in the field. 
  1762.  
  1763.       Visual Builder displays the type that you select (attribute, event, or 
  1764.       action) in the the Feature type field. 
  1765.  
  1766.    3. Select the feature that you want to promote from the list box beneath the 
  1767.       Promotable feature field or type the name in the field. 
  1768.  
  1769.       Visual Builder displays the feature that you select in the Promotable 
  1770.       feature field. 
  1771.  
  1772.    4. Do one of the following: 
  1773.  
  1774.           If you want to promote the feature using the default name that 
  1775.            Visual Builder provides, select the Add with defaults push button. 
  1776.  
  1777.            Visual Builder promotes the feature and displays the feature name in 
  1778.            both the Promote feature name field and in the list box below this 
  1779.            field. 
  1780.  
  1781.           If you want to see the default feature name that Visual Builder 
  1782.            provides before you promote the feature, select the Defaults push 
  1783.            button. 
  1784.  
  1785.            Visual Builder displays the default name for the feature in the 
  1786.            Promote feature name field. 
  1787.  
  1788.           If you want to promote a feature after seeing its default name or 
  1789.            typing another name that you prefer, select the Add push button. 
  1790.  
  1791.            Visual Builder promotes the feature using the name in the Promote 
  1792.            feature name field and displays the name in the list box below this 
  1793.            field. 
  1794.  
  1795.  
  1796. ΓòÉΓòÉΓòÉ 32. ...Change a promoted feature ΓòÉΓòÉΓòÉ
  1797.  
  1798. To update a feature that you have already promoted, do the following: 
  1799.  
  1800.    1. Select the promoted feature that you want to update. 
  1801.  
  1802.    2. Select those aspects of the promoted feature that you want to update in 
  1803.       the fields on the right side of the Promote page. You can select any or 
  1804.       all of the following: 
  1805.  
  1806.           Subpart name 
  1807.           Feature type 
  1808.           Promotable feature 
  1809.  
  1810.    3. Select the Update push button. 
  1811.  
  1812.       Visual Builder updates those aspects of the feature that you selected. 
  1813.  
  1814.  
  1815. ΓòÉΓòÉΓòÉ 33. ...Delete a promoted feature ΓòÉΓòÉΓòÉ
  1816.  
  1817. To delete a promoted feature, do the following: 
  1818.  
  1819.    1. Select the promoted feature that you want to delete. 
  1820.  
  1821.    2. Select the Delete push button. 
  1822.  
  1823.       Visual Builder deletes the promoted feature from the list box beneath the 
  1824.       Promote feature name field. 
  1825.  
  1826.       Note:  If you added the promoted feature that you just deleted to the 
  1827.              preferred features list, you must go to the Preferred page and 
  1828.              delete it there, too. 
  1829.  
  1830.  
  1831. ΓòÉΓòÉΓòÉ 34. ...Clearing the Promote Page Fields ΓòÉΓòÉΓòÉ
  1832.  
  1833. To clear the fields on the Promote page, select the Clear push button. Visual 
  1834. Builder removes the information from all of the fields on the page. 
  1835.  
  1836.  
  1837. ΓòÉΓòÉΓòÉ 35. ...Add a preferred feature ΓòÉΓòÉΓòÉ
  1838.  
  1839. To add a preferred feature to the connection menu for a part, do the following: 
  1840.  
  1841.    1. Select a feature name from one of the list boxes on the left side of the 
  1842.       page. 
  1843.  
  1844.    2. Do either of the following: 
  1845.  
  1846.           Select the Add push button at the bottom of the page. 
  1847.  
  1848.           With the mouse pointer still over the list box in which you selected 
  1849.            the feature name, do the following: 
  1850.  
  1851.              a. Click mouse button 2. 
  1852.  
  1853.                 A pop-up menu with the Add choice appears. 
  1854.  
  1855.              b. Select Add to add the feature. 
  1856.  
  1857.       The feature name that you selected is inserted into the Preferred 
  1858.       Features list box in alphabetical order. 
  1859.  
  1860.  
  1861. ΓòÉΓòÉΓòÉ 36. ...Remove a preferred feature ΓòÉΓòÉΓòÉ
  1862.  
  1863. You can remove a preferred feature name from the connection menu for a part. 
  1864. Doing this removes the feature from the menu only; it does not delete the 
  1865. feature. 
  1866.  
  1867. To remove a preferred feature from the connection menu for a part, do the 
  1868. following: 
  1869.  
  1870.    1. Select the name that you want to remove from the Preferred Features list 
  1871.       box. 
  1872.  
  1873.    2. Do either of the following: 
  1874.  
  1875.           Select the Remove push button at the bottom of the page. 
  1876.  
  1877.           With the mouse pointer still over the feature name in the Preferred 
  1878.            Features list box, do the following: 
  1879.  
  1880.              a. Click mouse button 2. 
  1881.  
  1882.                 A pop-up menu appears. 
  1883.  
  1884.              b. Select Remove to remove the selected feature. 
  1885.  
  1886.       A message box is displayed to make sure you want to remove the name of 
  1887.       this preferred feature. 
  1888.  
  1889.    3. Select Yes to remove the feature name from the list. 
  1890.  
  1891.       The feature name that you selected is removed from the list. 
  1892.  
  1893.  
  1894. ΓòÉΓòÉΓòÉ 37. ...Remove all preferred features ΓòÉΓòÉΓòÉ
  1895.  
  1896. You can remove all of the feature names from the connection menu for a part. 
  1897. Doing this removes the features from the menu only; it does not delete the 
  1898. features. Once you remove all preferred features from the connection menu, you 
  1899. must select More to use the features in a connection. 
  1900.  
  1901. To remove all of the preferred features from the connection menu for a part, do 
  1902. either of the following: 
  1903.  
  1904.      Select the Remove all push button at the bottom of the page. 
  1905.  
  1906.      With the mouse pointer over the Preferred Features list box, do the 
  1907.       following: 
  1908.  
  1909.         1. Click mouse button 2. 
  1910.  
  1911.            A pop-up menu appears. 
  1912.  
  1913.         2. Select Remove all to remove all of the selected features. 
  1914.  
  1915.  A message box is displayed to make sure you want to remove all of the 
  1916.  preferred features. 
  1917.  
  1918.  Select Yes to remove all of the feature names from the list. All of the 
  1919.  feature names are removed from the list. 
  1920.  
  1921.  
  1922. ΓòÉΓòÉΓòÉ 38. ...Show inherited preferred features only ΓòÉΓòÉΓòÉ
  1923.  
  1924. To show only the preferred features that your part inherits from other parts, 
  1925. select the Default push button. 
  1926.  
  1927. A message box is displayed. Select Yes to display only the inherited preferred 
  1928. features. 
  1929.  
  1930.  
  1931. ΓòÉΓòÉΓòÉ 39. ...Create nonvisual parts ΓòÉΓòÉΓòÉ
  1932.  
  1933.      Defining the part interface 
  1934.  
  1935.      Adding code to your part 
  1936.  
  1937.  
  1938. ΓòÉΓòÉΓòÉ 39.1. Steps for creating nonvisual parts ΓòÉΓòÉΓòÉ
  1939.  
  1940. You create a part by doing the following: 
  1941.  
  1942.    1. Design the part. 
  1943.  
  1944.    2. Define the part interface, either through the Part Interface Editor or by 
  1945.       importing a part information file. 
  1946.  
  1947.    3. Add code to your part. You can use C++ code written outside of Visual 
  1948.       Builder, or you can generate default feature code in Visual Builder and 
  1949.       modify it. 
  1950.  
  1951.  
  1952. ΓòÉΓòÉΓòÉ 39.2. Define the part interface ΓòÉΓòÉΓòÉ
  1953.  
  1954. When you are satisfied with your part's design, you are ready to define the 
  1955. part interface to Visual Builder. 
  1956.  
  1957.    1. Define the attributes of your part. 
  1958.  
  1959.       A part's attributes typically correlate to the class' data members and 
  1960.       can additionally include derived attributes, or attributes that are 
  1961.       determined based on the value of other attributes. 
  1962.  
  1963.    2. Define the member functions that get or set the value of those 
  1964.       attributes. 
  1965.  
  1966.    3. Define any actions that you want the part to be able to do. 
  1967.  
  1968.       A part's actions correlate to the class' public member functions. 
  1969.  
  1970.    4. Specify the event notification identifier used to signal a change in the 
  1971.       value of each attribute. 
  1972.  
  1973.  You can define the part interface in either of the following ways: 
  1974.  
  1975.      Use the Part Interface Editor. With this method, you create the part from 
  1976.       the Visual Builder window and then enter each feature of the part 
  1977.       interface individually using the pages of the Part Interface Editor. 
  1978.  
  1979.      Use a part information file. With this method, you encode part 
  1980.       information in a file and then create the part and its interface by 
  1981.       importing the information into Visual Builder. This method might be more 
  1982.       efficient if C++ code already exists for your part. See and refer to 
  1983.       Building VisualAge C++ Parts for Fun and Profit for information about 
  1984.       creating part information files. 
  1985.  
  1986.  
  1987. ΓòÉΓòÉΓòÉ 39.2.1. Define the part interface using the Part Interface Editor ΓòÉΓòÉΓòÉ
  1988.  
  1989. Open a new nonvisual part called OAContractor. The Part Interface Editor 
  1990. appears. 
  1991.  
  1992. On the Attribute page, do the following: 
  1993.  
  1994.    1. Type lastName in the Attribute name text-entry field and select the Add 
  1995.       with defaults push button. 
  1996.  
  1997.    2. Change any of the default values, if needed. For this example, change the 
  1998.       default attribute type to IString. You can do this by typing the value 
  1999.       directly into the entry field or by selecting the drop-down list box 
  2000.       arrow to the right of the entry field and selecting IString from the 
  2001.       list. 
  2002.  
  2003.       Also, edit the Get member function and Set member function fields, 
  2004.       changing IStandardNotifier to IString. This causes these member functions 
  2005.       to accept IString as a parameter instead of IStandardNotifier. 
  2006.  
  2007.    3. Select the Update push button to save the changes you just made. 
  2008.  
  2009.    4. Select the Clear push button to clear the fields before adding the next 
  2010.       attribute. 
  2011.  
  2012.    5. Repeat the previous steps for the contractor's firstName, middleInitial, 
  2013.       homeStreet, homeCity, homeState, homeZip, startDate, endDate, 
  2014.       currentContract, and phoneNumber attributes. For these attributes, 
  2015.       specify the IString attribute type before selecting the Add with defaults 
  2016.       push button in the first step. This prevents you from having to change 
  2017.       IStandardNotifier* to IString as you did previously. 
  2018.  
  2019.    6. Define the contractorID attribute as IString, with the following get 
  2020.       member function: 
  2021.  
  2022.             OAContractor & getContractorID ();
  2023.  
  2024.       This attribute is derived from other attributes; we will add the code for 
  2025.       this later. You do not want users to set this attribute directly, so do 
  2026.       not include a setContractorID member function. 
  2027.  
  2028.    7. Define the activeStatus attribute as Boolean. Note that the default get 
  2029.       member function and set member function follow a different format than 
  2030.       the ones for IString attributes. 
  2031.  
  2032.    8. To define the actions for OAContractor, select the Action page. 
  2033.  
  2034.    9. Type putContractor in the Action name field and the following into the 
  2035.       Action member function field: 
  2036.  
  2037.             OAContractor & putContractor();
  2038.  
  2039.   10. Select the Add push button; then select Clear. 
  2040.  
  2041.   11. Repeat for the getContractor and parseName actions. At this point, the 
  2042.       Action page appears as shown in the following figure: 
  2043.  
  2044.   12. Select Save from the File pull-down menu to save your work. 
  2045.  
  2046.  
  2047. ΓòÉΓòÉΓòÉ 39.3. Add code to my part ΓòÉΓòÉΓòÉ
  2048.  
  2049. Once you have specified the part interface for your part, you are ready to add 
  2050. the code to make the part work. Adding code involves the following tasks: 
  2051.  
  2052.    1. Generating default feature code. If you already have C++ code for your 
  2053.       part and have imported the part information, this step is not necessary. 
  2054.    2. Modifying the feature code. 
  2055.    3. Adding code created outside Visual Builder if it already exists. 
  2056.  
  2057.  
  2058. ΓòÉΓòÉΓòÉ 39.3.1. Generate default feature code ΓòÉΓòÉΓòÉ
  2059.  
  2060. To generate default feature code for the OAContractor part, follow these steps. 
  2061.  
  2062. Note:  This example is a continuation of the example in the preceding section 
  2063.        using the OAContractor part, which should be open in the Part Interface 
  2064.        Editor. 
  2065.  
  2066.    1. Switch to the Class Editor by selecting the icon in the lower-right 
  2067.       corner of the window. 
  2068.  
  2069.    2. Specify the .hpv and .cpv files for Visual Builder to use for the default 
  2070.       feature code for the OAContractor part's attributes and actions by 
  2071.       filling in the following fields: 
  2072.  
  2073.       User .hpv file        contrctr.hpv 
  2074.  
  2075.       User .cpv file        contrctr.cpv 
  2076.  
  2077.    3. Select FileSave and GenerateFeature source. 
  2078.  
  2079.    4. Generate the default feature code using one of the following methods: 
  2080.  
  2081.           Select the Generate all push button to generate default feature code 
  2082.            for member functions and data members. 
  2083.  
  2084.           Select the appropriate member functions and data members from the 
  2085.            Member functions, Attribute data members, or Event data members list 
  2086.            boxes. Then, select the Generate selected push button. 
  2087.  
  2088.       For this example, select the Generate all push button. 
  2089.  
  2090.       The default feature code is stored in the files you specified in the 
  2091.       Class Editor, contrctr.hpv and contrctr.cpv. If these files already 
  2092.       exist, the code you just generated is appended to the ends of these 
  2093.       files. 
  2094.  
  2095.       For most parts, you must modify the default code to make your part fully 
  2096.       functional. 
  2097.  
  2098.  
  2099. ΓòÉΓòÉΓòÉ 39.4. Modify the generated feature code ΓòÉΓòÉΓòÉ
  2100.  
  2101. After you have Visual Builder generate the feature code, review it. Does it do 
  2102. what you need it to do? If not, modify the code. The OAContractor part needs 
  2103. the following changes: 
  2104.  
  2105.      Modified code for the getContractor action 
  2106.      Modified code for the putContractor action 
  2107.      Modified code for the parseName action 
  2108.      Added code to set the activeStatus attribute 
  2109.      Added code to set the contractorID attribute 
  2110.  
  2111.  
  2112. ΓòÉΓòÉΓòÉ 39.4.1. Modify code for the getContractor action ΓòÉΓòÉΓòÉ
  2113.  
  2114. This version of our contractor application uses an IProfile-based database to 
  2115. store information about the contractors. For our OAContractor part to use this 
  2116. database, we must complete the getContractor and putContractor actions and 
  2117. modify the activeStatus attribute. The following example shows the default code 
  2118. generated for the two actions: 
  2119.  
  2120. OAContractor & OAContractor::getContractor()
  2121. {
  2122.   return *this;
  2123. }
  2124.  
  2125. OAContractor & OAContractor::putContractor()
  2126. {
  2127.   return *this;
  2128. }
  2129.  
  2130. To modify default feature code, edit the code files using the syntax text 
  2131. editor provided by VisualAge C++ or your favorite editor. Code for our 
  2132. getContractor action follows: 
  2133.  
  2134. OAContractor & OAContractor::getContractor()
  2135. {
  2136. // Start data access code
  2137.  
  2138.   IProfile *p = new IProfile("contrctr.ini");
  2139.  
  2140. // Test for missing name information
  2141. // Necessary for proper derivation of the contractorID attribute
  2142.  
  2143.   if ((!iLastName) || (!iFirstName) || (!iMiddleInitial))
  2144.   {
  2145.   throw IException("The contractor's name is incomplete. Complete all name fields and try again.");
  2146.   return *this;
  2147.   }
  2148.  
  2149. // Refresh the value of contractor ID
  2150.  
  2151.    setContractorID();
  2152.  
  2153. // Check for this contractor ID in the profile collection
  2154.  
  2155.   if (!p->containsKeyName("contractorID", iContractorID))
  2156.   {
  2157.   throw IException("A record was not found for this contractor.");
  2158.   return *this;
  2159.   }
  2160.  
  2161. // If other data exists for this contractor,
  2162. // set the corresponding contractor attributes
  2163.  
  2164.   if (p->containsKeyName("lastName", iContractorID))
  2165.     setLastName(p->elementWithKey("lastName", iContractorID));
  2166.   if (p->containsKeyName("firstName", iContractorID))
  2167.     setFirstName(p->elementWithKey("firstName", iContractorID));
  2168.   if (p->containsKeyName("middleInitial", iContractorID))
  2169.     setMiddleInitial(p->elementWithKey("middleInitial", iContractorID));
  2170.   if (p->containsKeyName("homeStreet", iContractorID))
  2171.     setHomeStreet(p->elementWithKey("homeStreet", iContractorID));
  2172.   if (p->containsKeyName("homeCity", iContractorID))
  2173.     setHomeCity(p->elementWithKey("homeCity", iContractorID));
  2174.   if (p->containsKeyName("homeState", iContractorID))
  2175.     setHomeState(p->elementWithKey("homeState", iContractorID));
  2176.   if (p->containsKeyName("homeZip", iContractorID))
  2177.     setHomeZip(p->elementWithKey("homeZip", iContractorID));
  2178.   if (p->containsKeyName("phoneNumber", iContractorID))
  2179.     setPhoneNumber(p->elementWithKey("phoneNumber", iContractorID));
  2180.   if (p->containsKeyName("startDate", iContractorID))
  2181.     setStartDate(p->elementWithKey("startDate", iContractorID));
  2182.   if (p->containsKeyName("endDate", iContractorID))
  2183.     setEndDate(p->elementWithKey("endDate", iContractorID));
  2184.   if (p->containsKeyName("currentContract", iContractorID))
  2185.     setCurrentContract(p->elementWithKey("currentContract", iContractorID));
  2186.  
  2187. // Call overloaded set member function using string parameter
  2188.  
  2189.   if (p->containsKeyName("activeStatus", iContractorID))
  2190.     enableActiveStatus(p->elementWithKey("activeStatus", iContractorID));
  2191.  
  2192.   delete p;
  2193.  
  2194. // End data access code
  2195.  
  2196.   return *this;
  2197. }
  2198.  
  2199. The getContractor action checks for one possible error condition. If it occurs, 
  2200. the action throws an exception. Otherwise, the action retrieves data by 
  2201. contractor identifier from the contrctr.ini file. 
  2202.  
  2203. In response to these exceptions, the OAContractorView part shows a message box. 
  2204. Constructing the User Interface. Passing Exceptions to Message Boxes. 
  2205.  
  2206.  
  2207. ΓòÉΓòÉΓòÉ 39.4.2. Modify code for the putContractor action ΓòÉΓòÉΓòÉ
  2208.  
  2209. Code the putContractor action as follows: 
  2210.  
  2211. OAContractor & OAContractor::putContractor()
  2212. {
  2213. // Start data entry code
  2214.  
  2215.   IProfile *p = new IProfile("contrctr.ini");
  2216.  
  2217. // Test for missing name information
  2218. // Necessary for proper derivation of the contractorID attribute
  2219.  
  2220.   if ((!iLastName) || (!iFirstName) || (!iMiddleInitial))
  2221.   {
  2222.   throw IException("The contractor's name is incomplete. Complete all name fields and try again.");
  2223.   return *this;
  2224.   }
  2225.  
  2226. // Refresh the value of contractor ID
  2227.  
  2228.   setContractorID();
  2229.   p->addOrReplaceElementWithKey("contractorID", contractorID(), iContractorID));
  2230.  
  2231. // If other data about this contractor exists, update it in the database
  2232.  
  2233.   if (lastName)
  2234.     p->addOrReplaceElementWithKey("lastName", lastName(), iContractorID));
  2235.   if (firstName)
  2236.     p->addOrReplaceElementWithKey("firstName", firstName(), iContractorID));
  2237.   if (middleInitial)
  2238.     p->addOrReplaceElementWithKey("middleInitial", middleInitial(), iContractorID));
  2239.   if (homeStreet)
  2240.     p->addOrReplaceElementWithKey("homeStreet", homeStreet(), iContractorID));
  2241.   if (homeCity)
  2242.     p->addOrReplaceElementWithKey("homeCity", homeCity(), iContractorID));
  2243.   if (homeState)
  2244.     p->addOrReplaceElementWithKey("homeState", homeState(), iContractorID));
  2245.   if (homeZip)
  2246.     p->addOrReplaceElementWithKey("homeZip", homeZip(), iContractorID));
  2247.   if (telephoneNumber)
  2248.     p->addOrReplaceElementWithKey("telephoneNumber", telephoneNumber(), iContractorID));
  2249.   if (startDate)
  2250.     p->addOrReplaceElementWithKey("startDate", startDate(), iContractorID));
  2251.   if (endDate)
  2252.     p->addOrReplaceElementWithKey("endDate", endDate(), iContractorID));
  2253.   if (currentContract)
  2254.     p->addOrReplaceElementWithKey("currentContract", currentContract(), iContractorID));
  2255.   if (iActiveStatus)
  2256.   {
  2257.     p->addOrReplaceElementWithKey("activeStatus", "yes", iContractorID));
  2258.   }
  2259.   else
  2260.   {
  2261.     p->addOrReplaceElementWithKey("activeStatus", "no", iContractorID));
  2262.   }
  2263.  
  2264.   delete p;
  2265.  
  2266. // End data entry code
  2267.  
  2268.   return *this;
  2269. }
  2270.  
  2271. The putContractor action checks for one possible error condition. If it occurs, 
  2272. the action throws an exception. Otherwise, the action stores data by contractor 
  2273. identifier in the contrctr.ini file. 
  2274.  
  2275. In response to these exceptions, the OAContractorView part shows a message box. 
  2276. Constructing Containers and Notebooks. Passing Exceptions to Message Boxes. 
  2277.  
  2278.  
  2279. ΓòÉΓòÉΓòÉ 39.4.3. Modify code for the parseName action ΓòÉΓòÉΓòÉ
  2280.  
  2281. The parseName action parses input text from the Request for Contractor 
  2282. Information window and sets the contractor's firstName, middleInitial, and 
  2283. lastName attributes. Add code as follows: 
  2284.  
  2285. OAContractor & OAContractor::parseName(const IString & aName)
  2286. {
  2287.  
  2288. // aName is supplied by user in OAQueryContractor
  2289. // Test for missing information in newly entered name
  2290.  
  2291.   if (aName.numWords()!= 3)
  2292.   {
  2293.   throw IException("The name you entered is incomplete.
  2294.                     Enter first name, middle initial, and last name.");
  2295.   return *this;
  2296.   }
  2297.  
  2298. // Set name attributes and derive contractorID attribute
  2299.  
  2300.   setFirstName(aName.word(1));
  2301.   setMiddleInitial(aName.word(2));
  2302.   setLastName(aName.word(3));
  2303.   setContractorID;
  2304.  
  2305. // End added code
  2306.  
  2307.   return *this;
  2308. }
  2309.  
  2310.  
  2311. ΓòÉΓòÉΓòÉ 39.4.4. Add code to set the activeStatus attribute ΓòÉΓòÉΓòÉ
  2312.  
  2313. You must add a member function to pass string data to the one Boolean 
  2314. attribute, activeStatus. All data in our simple database is stored as strings, 
  2315. but the set member function for the activeStatus attribute takes a Boolean as a 
  2316. parameter. Because only OAContractor's two actions use this member function, it 
  2317. is not necessary to add this to the part interface for OAContractor. However, 
  2318. you must add the member function prototype to the contrctr.hpv file. 
  2319.  
  2320. The following example shows both the default feature code and the added code in 
  2321. contrctr.cpv: 
  2322.  
  2323. Boolean OAContractor::isActiveStatus() const
  2324. {
  2325.   return iActiveStatus;
  2326. }
  2327.  
  2328. OAContractor & OAContractor::enableActiveStatus(const Boolean enable)
  2329. {
  2330.   if (iActiveStatus != enable)
  2331.   {
  2332.     iActiveStatus = enable;
  2333.     notifyObservers(INotificationEvent(OAContractor::activeStatusId, *this));
  2334.   } // endif
  2335.   return *this;
  2336. }
  2337.  
  2338. // Start Boolean string enabler
  2339.  
  2340. OAContractor & OAContractor::enableActiveStatus(const IString & status)
  2341. {
  2342.   Boolean tempBoolean = iActiveStatus;
  2343.   if (status = "yes") iActiveStatus = true;
  2344.   if (status = "no") iActiveStatus = false;
  2345.   if (tempBoolean != iActiveStatus)
  2346.   {
  2347.     notifyObservers(INotificationEvent(OAContractor::activeStatusId, *this));
  2348.   }
  2349.   return *this;
  2350. }
  2351.  
  2352. // End Boolean string enabler
  2353.  
  2354. iActiveStatus is the private data member that corresponds to the activeStatus 
  2355. attribute. 
  2356.  
  2357. The notifyObservers function signals that the value of the activeStatus 
  2358. attribute has changed. For more information about notification, see Building 
  2359. VisualAge C++ Parts for Fun and Profit. 
  2360.  
  2361.  
  2362. ΓòÉΓòÉΓòÉ 39.4.5. Add code to set the contractorID attribute ΓòÉΓòÉΓòÉ
  2363.  
  2364. Now, add code to derive the value of the contractorID attribute. The following 
  2365. example shows the code as modified in contrctr.cpv: 
  2366.  
  2367. OAContractor & OAContractor::setContractorID()
  2368. {
  2369.   IString tempString = iFirstName+iMiddleInitial+iLastName;
  2370.   if (iContractorID != tempString)
  2371.   {
  2372.     iContractorID = tempString;
  2373.     notifyObservers(INotificationEvent(OAContractor::contractorIDId, *this));
  2374.   } // endif
  2375.   return *this;
  2376. }
  2377.  
  2378.  
  2379. ΓòÉΓòÉΓòÉ 39.5. Add code created outside Visual Builder ΓòÉΓòÉΓòÉ
  2380.  
  2381. To include previously existing member function code with generated class 
  2382. declarations, do the following: 
  2383.  
  2384.    1. Change the file extension of .cpp files to .cpv. 
  2385.    2. Change the file extension of .hpp files to .hpv. 
  2386.    3. Change the file extension of any .rc files to .rcv. 
  2387.    4. Add these files to the Class Editor for the appropriate part. 
  2388.  
  2389.  If you prefer not to use Visual Builder to develop the code for a nonvisual 
  2390.  part but you want to be able to use it in the Composition Editor, you can do 
  2391.  the following: 
  2392.  
  2393.      Write the code. 
  2394.      Compile it into a .lib file. 
  2395.      Define the part interface using a part information file. 
  2396.      Import the part information file. 
  2397.  
  2398.  
  2399. ΓòÉΓòÉΓòÉ 40. ...Work with parts in the Visual Builder window ΓòÉΓòÉΓòÉ
  2400.  
  2401.      Displaying part names 
  2402.  
  2403.      Selecting all parts 
  2404.  
  2405.      Deselecting all parts 
  2406.  
  2407.      Importing part information 
  2408.  
  2409.      Exporting part information 
  2410.  
  2411.      Creating a new part 
  2412.  
  2413.      Opening parts 
  2414.  
  2415.      Copying parts from one .vbb file to another 
  2416.  
  2417.      Moving parts to a different .vbb file 
  2418.  
  2419.      Deleting parts from a .vbb file 
  2420.  
  2421.      Renaming parts in .vbb files 
  2422.  
  2423.  
  2424. ΓòÉΓòÉΓòÉ 40.1. Display part names ΓòÉΓòÉΓòÉ
  2425.  
  2426. To display the names of the parts in a .vbb file, in the Loaded Files list box 
  2427. in the Visual Builder window select the .vbb file whose parts you want to see. 
  2428. The names of the parts contained in the .vbb file that you selected are 
  2429. displayed in the Visual Builder window. Visual parts are displayed in the 
  2430. Visual Parts list box; nonvisual parts and class interface parts are displayed 
  2431. in the Nonvisual Parts list box. 
  2432.  
  2433.  
  2434. ΓòÉΓòÉΓòÉ 40.2. Select all parts ΓòÉΓòÉΓòÉ
  2435.  
  2436. To select all of the parts in the selected .vbb files, select EditSelect all 
  2437. parts. 
  2438.  
  2439. At this point, you can review the list to see if you want to deselect any of 
  2440. the parts. You can do so by pressing the Ctrl key and clicking on the part name 
  2441. with mouse button 1. 
  2442.  
  2443.  
  2444. ΓòÉΓòÉΓòÉ 40.3. Deselect all parts ΓòÉΓòÉΓòÉ
  2445.  
  2446. To deselect all of the parts in the selected .vbb files, select EditDeselect 
  2447. all parts. 
  2448.  
  2449.  
  2450. ΓòÉΓòÉΓòÉ 40.4. Import part information ΓòÉΓòÉΓòÉ
  2451.  
  2452. To import part information, do the following: 
  2453.  
  2454.    1. Select FileImport part information. 
  2455.  
  2456.    2. Select the part information file that you want to import. 
  2457.  
  2458.    3. Select the OK push button. 
  2459.  
  2460.       The part information in the part information file is imported. Any visual 
  2461.       parts that the part information file contains are displayed in the Visual 
  2462.       Parts list box, and any nonvisual parts and class interface parts it 
  2463.       contains are displayed in the Nonvisual Parts list box. In addition, one 
  2464.       or more .vbb files may be created. 
  2465.  
  2466.  
  2467. ΓòÉΓòÉΓòÉ 40.5. Export part information ΓòÉΓòÉΓòÉ
  2468.  
  2469. To export part information, do the following: 
  2470.  
  2471.    1. Select the part or parts whose information you want to export in either 
  2472.       the Visual Parts list box, the Nonvisual Parts list box, or both. 
  2473.  
  2474.    2. Select PartExport interface. 
  2475.  
  2476.    3. Type the name of the .vbe file in which you want the part information to 
  2477.       be stored in the Open filename field. 
  2478.  
  2479.       If you do not enter a file name, Visual Builder uses exported.vbe as the 
  2480.       default file name. 
  2481.  
  2482.    4. Select the OK push button. 
  2483.  
  2484.       The part information maintained by Visual Builder is exported to the file 
  2485.       name you specified in the Open filename field. 
  2486.  
  2487.  
  2488. ΓòÉΓòÉΓòÉ 40.6. Create a new part ΓòÉΓòÉΓòÉ
  2489.  
  2490. To create a new part, do the following: 
  2491.  
  2492.    1. Select PartNew. 
  2493.  
  2494.    2. Enter the name that you want to give to your part in the Class name 
  2495.       field. 
  2496.  
  2497.    3. Enter a description of your part in the Description field. 
  2498.  
  2499.    4. Enter the name of the .vbb file in which you want Visual Builder to store 
  2500.       the part in the File name field. 
  2501.  
  2502.    5. Select the type of part that you want to create in the Part type field. 
  2503.       You can select one of the following: 
  2504.  
  2505.           Visual part 
  2506.           Nonvisual part 
  2507.           Class interface 
  2508.  
  2509.    6. Either keep the default class name provided by Visual Builder in the Base 
  2510.       class field, change it, or delete it. 
  2511.  
  2512.    7. Select Open. 
  2513.  
  2514.       One of the following occurs: 
  2515.  
  2516.           If you are creating a visual part, the Composition Editor is 
  2517.            displayed. 
  2518.  
  2519.           If you are creating a nonvisual part or a class interface part, the 
  2520.            Part Interface Editor is displayed. 
  2521.  
  2522.    8. Use the displayed editor to create your part. 
  2523.  
  2524.  
  2525. ΓòÉΓòÉΓòÉ 40.7. Open parts ΓòÉΓòÉΓòÉ
  2526.  
  2527. The following instructions tell you how to open one part at a time or multiple 
  2528. parts simultaneously. 
  2529.  
  2530. Opening one part 
  2531.  
  2532. To open one part, do the following: 
  2533.  
  2534.    1. Find the name of the part that you want to open by scrolling through the 
  2535.       appropriate list box in the Visual Builder window. 
  2536.  
  2537.       Note:  If the list boxes in the Visual Builder window are empty or if you 
  2538.              cannot find the part, the .vbb file that contains the part you 
  2539.              want to open is not selected or not loaded. See Loading .vbb Files 
  2540.              if you need help loading .vbb files. 
  2541.  
  2542.    2. Select the part you want to open. 
  2543.  
  2544.    3. Select Part on the menu bar. 
  2545.  
  2546.    4. Select Open in the pull-down menu. 
  2547.  
  2548.       One of the following occurs: 
  2549.  
  2550.           If you are opening a visual part, Visual Builder displays the 
  2551.            Composition Editor. 
  2552.  
  2553.           If you are opening a nonvisual part, Visual Builder displays the 
  2554.            Part Interface Editor. 
  2555.  
  2556.            A quicker way to open an existing part is to double-click on the 
  2557.            part name within the Visual Parts or Nonvisual Parts list box. 
  2558.  
  2559.  Opening multiple parts 
  2560.  
  2561.  To open multiple parts, do the following: 
  2562.  
  2563.    1. Find the name of the first part that you want to open by scrolling 
  2564.       through the Nonvisual Parts and Visual Parts list boxes shown in the 
  2565.       Visual Builder window. 
  2566.  
  2567.       Note:  If the list boxes in the Visual Builder window are empty, see 
  2568.              Loading .vbb Files if you need help loading .vbb files. 
  2569.  
  2570.    2. Select the first part you want to open. 
  2571.  
  2572.    3. Find the next part you want to open and press the Ctrl key while 
  2573.       selecting that part. 
  2574.  
  2575.    4. Continue finding and selecting parts in this manner, pressing the Ctrl 
  2576.       key while selecting each part, until you have selected all the parts you 
  2577.       want to open. 
  2578.  
  2579.    5. Select Part on the menu bar. 
  2580.  
  2581.    6. Select Open in the pull-down menu. 
  2582.  
  2583.       Visual Builder displays a separate window for each part that you 
  2584.       selected. The window displayed is the Composition Editor for visual parts 
  2585.       or the Part Interface Editor for nonvisual parts. 
  2586.  
  2587.  
  2588. ΓòÉΓòÉΓòÉ 40.8. Copy parts from one .vbb file to another ΓòÉΓòÉΓòÉ
  2589.  
  2590. To copy a part, do the following: 
  2591.  
  2592.    1. Select the part that you want to copy in the Visual Parts or Nonvisual 
  2593.       Parts list box. 
  2594.  
  2595.       If you select more than one part or if you do not select a part, the Copy 
  2596.       function is not available. 
  2597.  
  2598.    2. Select PartCopy. 
  2599.  
  2600.       The Source part name field shows the name of the part that you selected 
  2601.       to copy. 
  2602.  
  2603.    3. In the Target part name field, enter the name you want the part to have 
  2604.       when you copy it. 
  2605.  
  2606.    4. In the Target file name field, enter the name of the .vbb file to which 
  2607.       you want to copy the part. If you leave this field blank, the part's 
  2608.       current file name is used. 
  2609.  
  2610.    5. Select the Copy push button. 
  2611.  
  2612.       The part is copied under the new name and stored in the designated .vbb 
  2613.       file. 
  2614.  
  2615.  
  2616. ΓòÉΓòÉΓòÉ 40.9. Move parts to different .vbb files ΓòÉΓòÉΓòÉ
  2617.  
  2618. To move one or more parts from one .vbb file to another, do the following: 
  2619.  
  2620.    1. Select the part or parts that you want to move. 
  2621.  
  2622.       If you do not select at least one part, the Move function is not 
  2623.       available. 
  2624.  
  2625.    2. Select PartMove. 
  2626.  
  2627.    3. Use the following instructions for moving one part or multiple parts: 
  2628.  
  2629.       Moving one part 
  2630.  
  2631.       If you selected one part, the following window is displayed: 
  2632.  
  2633.       The Part name field of this window shows the name of the part that you 
  2634.       selected to move. The File name field displays the complete path of the 
  2635.       .vbb file that contains the part you want to move. 
  2636.  
  2637.       Do the following: 
  2638.  
  2639.         a. In the New file name field, enter the path and name of the .vbb file 
  2640.            to which you want to move the part. 
  2641.  
  2642.         b. Select the Move push button. 
  2643.  
  2644.            The part is moved to the .vbb file specified in the New file name 
  2645.            field. 
  2646.  
  2647.       Moving multiple parts 
  2648.  
  2649.       If you selected more than one part, the following window is displayed: 
  2650.  
  2651.       The text in the window specifies the names of the parts you selected. 
  2652.  
  2653.       Do the following: 
  2654.  
  2655.         a. In the entry field, enter the name of the .vbb file to which you 
  2656.            want to move the parts. If the .vbb file is not in your current 
  2657.            directory, specify the complete path for the .vbb file. 
  2658.  
  2659.         b. Select the OK push button. 
  2660.  
  2661.            The parts are moved to the .vbb file specified in the entry field. 
  2662.  
  2663.  
  2664. ΓòÉΓòÉΓòÉ 40.10. Delete parts from a .vbb file ΓòÉΓòÉΓòÉ
  2665.  
  2666. To delete a part, do the following: 
  2667.  
  2668.    1. Select the part or parts that you want to delete in the Visual Parts list 
  2669.       box, Nonvisual Parts list box, or both. 
  2670.  
  2671.       If you do not select at least one part, the Delete function is not 
  2672.       available. 
  2673.  
  2674.    2. Select PartDelete. 
  2675.  
  2676.       Deselect any parts that you do not want to delete. Once you delete a part 
  2677.       from a .vbb file, you cannot recover it unless you have another copy 
  2678.       stored in another .vbb file. 
  2679.  
  2680.    3. Select the Delete push button. 
  2681.  
  2682.       The selected parts are deleted. 
  2683.  
  2684.  
  2685. ΓòÉΓòÉΓòÉ 40.11. Rename parts in .vbb files ΓòÉΓòÉΓòÉ
  2686.  
  2687. To rename a part in a .vbb file, do the following: 
  2688.  
  2689.    1. Select the part that you want to rename in the Visual Parts or Nonvisual 
  2690.       Parts list box. 
  2691.  
  2692.       If you select more than one part or if you do not select a part, the 
  2693.       Rename function is not available. 
  2694.  
  2695.    2. Select PartRename. 
  2696.  
  2697.       The Part name field shows the name of the part that you selected to 
  2698.       rename. 
  2699.  
  2700.    3. In the New part name field, enter the new name that you want to give the 
  2701.       part. 
  2702.  
  2703.    4. Select the Rename push button. 
  2704.  
  2705.       The part is renamed under the new name. 
  2706.  
  2707.  
  2708. ΓòÉΓòÉΓòÉ 41. ...Work with parts on the free-form surface ΓòÉΓòÉΓòÉ
  2709.  
  2710.      Placing parts on the free-form surface 
  2711.  
  2712.      Selecting and deselecting parts 
  2713.  
  2714.      Manipulating parts, which includes: 
  2715.  
  2716.         -  Displaying pop-up menus 
  2717.         -  Copying parts 
  2718.         -  Deleting parts 
  2719.         -  Editing text strings 
  2720.         -  Renaming parts 
  2721.  
  2722.      Arranging parts, which includes: 
  2723.  
  2724.         -  Moving parts 
  2725.         -  Positioning parts on the grid 
  2726.         -  Sizing parts 
  2727.         -  Matching part sizes 
  2728.         -  Aligning parts 
  2729.         -  Spacing parts within Composer parts 
  2730.         -  Spacing parts within a bounding box 
  2731.  
  2732.      Changing settings for a part 
  2733.  
  2734.      Tearing off an attribute 
  2735.  
  2736.  
  2737. ΓòÉΓòÉΓòÉ 41.1. Place parts on the free-form surface ΓòÉΓòÉΓòÉ
  2738.  
  2739. In the Composition Editor, you place visual, nonvisual, and class interface 
  2740. parts on the free-form surface. This section explains how to place parts there 
  2741. that appear on the parts palette, as well as parts that do not appear on the 
  2742. parts palette. 
  2743.  
  2744. Placing a part that appears on the parts palette 
  2745.  
  2746.    1. From the left column of the parts palette, select the appropriate 
  2747.       category. Then, from the right column, select the part you want to add. 
  2748.  
  2749.       When the mouse pointer is moved over a place where the part can be 
  2750.       placed, it changes to a crosshair, indicating that it is loaded with the 
  2751.       part. 
  2752.  
  2753.    2. Move the mouse pointer to where you want to add the part. 
  2754.  
  2755.    3. Click mouse button 1. 
  2756.  
  2757.       If you hold down mouse button 1 instead of clicking it, an outline of the 
  2758.       part is displayed under the pointer to help you position the part. After 
  2759.       the part is in position, release mouse button 1. 
  2760.  
  2761.  To unload the mouse pointer at any time, do either of the following: 
  2762.  
  2763.      Select , the Selection tool, on the tool bar. 
  2764.  
  2765.      Select ToolsSelection Tool on the menu bar. 
  2766.  
  2767.            To add several copies of the same part, select Sticky on the parts 
  2768.            palette. When Sticky is selected, the mouse pointer remains loaded 
  2769.            with the part you last selected. When Sticky is not selected, the 
  2770.            mouse pointer becomes unloaded after you add a part. 
  2771.  
  2772.  Placing a part that is not on the parts palette 
  2773.  
  2774.  You can place on the free-form surface any part whose .vbb file is loaded by 
  2775.  doing the following: 
  2776.  
  2777.    1. Select Add part from the Options pull-down menu. 
  2778.  
  2779.    2. Type the part's class name in the Part class field. 
  2780.  
  2781.    3. Type a name for the part in the Name field. 
  2782.  
  2783.    4. Select the Add push button to add the part. 
  2784.  
  2785.    5. Move the crosshairs to the place where you want to add the part and click 
  2786.       mouse button 1. 
  2787.  
  2788.  
  2789. ΓòÉΓòÉΓòÉ 41.2. Select and deselect parts ΓòÉΓòÉΓòÉ
  2790.  
  2791. The following sections describe how to select and deselect a single part and 
  2792. multiple parts. 
  2793.  
  2794. Selecting a single part 
  2795.  
  2796. To select a part that you have placed on the free-form surface, click on the 
  2797. part with mouse button 1. If other parts are already selected, they are 
  2798. deselected automatically. 
  2799.  
  2800. Selecting multiple parts 
  2801.  
  2802. Selecting multiple parts enables you to perform the same operation on several 
  2803. parts at once. To select multiple parts, do one of the following: 
  2804.  
  2805.      Hold down the Ctrl key and click mouse button 1 on each additional part 
  2806.       you want to select. 
  2807.  
  2808.      Hold down mouse button 1 instead of clicking it; then move the mouse 
  2809.       pointer over each additional part you want to select. After you select 
  2810.       the parts, release mouse button 1. 
  2811.  
  2812.  Note:  Depending on the operation you want to perform, remember to consider 
  2813.         which part you want to be the anchor part because that is the part you 
  2814.         want to select last. For example, if you select two parts because you 
  2815.         want to match the width of one part to the width of the other, the part 
  2816.         you select last is the anchor part, the part whose width is used for 
  2817.         the operation. 
  2818.  
  2819.  Deselecting parts 
  2820.  
  2821.  To deselect a part after you have selected it, do the following: 
  2822.  
  2823.    1. Hold down the Ctrl key. 
  2824.  
  2825.    2. Click on the selected part with mouse button 1. 
  2826.  
  2827.  To deselect multiple parts, do the following: 
  2828.  
  2829.    1. Hold down the Ctrl key. 
  2830.  
  2831.    2. Click on a selected part with mouse button 1. 
  2832.  
  2833.    3. Without releasing either the Ctrl key or mouse button 1, move the mouse 
  2834.       pointer to another selected part. 
  2835.  
  2836.    4. Repeat the previous step until all parts that you want to deselect have 
  2837.       been deselected. 
  2838.  
  2839.  
  2840. ΓòÉΓòÉΓòÉ 41.3. Manipulate parts ΓòÉΓòÉΓòÉ
  2841.  
  2842. Once a part is added to the free-form surface, you can manipulate it in a 
  2843. number of different ways. The following sections explain each of those ways. 
  2844.  
  2845.      Displaying pop-up menus 
  2846.  
  2847.      Copying parts 
  2848.  
  2849.      Deleting parts 
  2850.  
  2851.      Editing text strings 
  2852.  
  2853.      Renaming parts on the free-form surface 
  2854.  
  2855.  
  2856. ΓòÉΓòÉΓòÉ 41.3.1. Display pop-up menus ΓòÉΓòÉΓòÉ
  2857.  
  2858. To display the pop-up menu of a part, click on the part with mouse button 2. 
  2859. The pop-up menu displays the operations you can perform on that part. 
  2860.  
  2861. A part does not have to be selected for you to display its pop-up menu. The 
  2862. pop-up menu that is displayed is for the part the mouse pointer is over when 
  2863. mouse button 2 is clicked, even if another part is selected. 
  2864.  
  2865.  
  2866. ΓòÉΓòÉΓòÉ 41.3.2. Copy parts ΓòÉΓòÉΓòÉ
  2867.  
  2868. To copy parts by dragging them, do the following: 
  2869.  
  2870.    1. Select all the parts you want to copy. 
  2871.  
  2872.       If you only want to copy one part, you do not have to select it. 
  2873.  
  2874.    2. Move the mouse pointer over the part you want to copy or one of the 
  2875.       selected parts. 
  2876.  
  2877.    3. Hold down the Ctrl key and mouse button 2. 
  2878.  
  2879.    4. Drag a copy of the part or parts by moving the mouse pointer to a new 
  2880.       position. 
  2881.  
  2882.       An outline of the part or parts is displayed to help you with 
  2883.       positioning. When you are copying multiple parts, the outlines of each 
  2884.       part move together as a group. 
  2885.  
  2886.    5. Release the Ctrl key and mouse button 2 when the part or parts are where 
  2887.       you want them to be. 
  2888.  
  2889.       A copy of the part or parts appears where you positioned the outline or 
  2890.       outlines. 
  2891.  
  2892.  Copying parts using the clipboard 
  2893.  
  2894.  To copy parts by using the clipboard, do the following: 
  2895.  
  2896.    1. Select all the parts you want to copy. 
  2897.  
  2898.    2. From the Edit pull-down menu, select Copy. 
  2899.  
  2900.       A copy of each selected part is placed on the clipboard. 
  2901.  
  2902.    3. Select Paste from the Edit pull-down menu when you are ready to use the 
  2903.       parts. 
  2904.  
  2905.       The mouse pointer turns to crosshairs to show that it is loaded with the 
  2906.       copied parts. 
  2907.  
  2908.    4. Position the mouse pointer where you want the parts to be copied. 
  2909.  
  2910.    5. Click mouse button 1. 
  2911.  
  2912.       Copies of the parts are pasted at the position of the mouse pointer. 
  2913.  
  2914.            Parts that you copy remain on the clipboard until you copy something 
  2915.            else. Therefore, you can continue to paste copies of those parts by 
  2916.            selecting Paste, positioning the mouse pointer, and clicking mouse 
  2917.            button 1. 
  2918.  
  2919.            If you select Paste and then decide against pasting the parts, you 
  2920.            can unload the mouse pointer by either selecting the Selection Tool 
  2921.            on the tool bar or by selecting ToolsSelection Tool on the menu 
  2922.            bar. 
  2923.  
  2924.  
  2925. ΓòÉΓòÉΓòÉ 41.3.3. Delete parts ΓòÉΓòÉΓòÉ
  2926.  
  2927. To delete one or more parts, do the following: 
  2928.  
  2929.    1. Select all of the parts you want to delete. 
  2930.  
  2931.       If you are deleting just one part, you do not have to select it. 
  2932.  
  2933.    2. Position the mouse pointer over the part you want to delete or one of the 
  2934.       selected parts. 
  2935.  
  2936.    3. Click mouse button 2. 
  2937.  
  2938.    4. From the part pop-up menu, select Delete. 
  2939.  
  2940.       The part or parts are deleted. 
  2941.  
  2942.            Any connections between the part that you are deleting and other 
  2943.            parts are also deleted. Visual Builder displays a message to alert 
  2944.            you to this. However, the EditUndo function also restores any 
  2945.            connections that were removed when you deleted the part. 
  2946.  
  2947.  
  2948. ΓòÉΓòÉΓòÉ 41.3.4. Edit text strings ΓòÉΓòÉΓòÉ
  2949.  
  2950. Some visual parts, such as push buttons and menus, have text strings. To 
  2951. directly edit a part's text string, do the following: 
  2952.  
  2953.    1. Hold down the Alt key. 
  2954.  
  2955.    2. Click mouse button 1 on the text string. 
  2956.  
  2957.    3. Edit the text string. 
  2958.  
  2959.    4. When you have finished, do either of the following: 
  2960.  
  2961.           Click mouse button 1 anywhere outside of the text string. 
  2962.  
  2963.           Press Shift+Enter. 
  2964.  
  2965.            You can also use this direct editing technique to edit the names of 
  2966.            nonvisual parts. The name of a nonvisual part is displayed directly 
  2967.            below its icon. 
  2968.  
  2969.  
  2970. ΓòÉΓòÉΓòÉ 41.3.5. Rename parts on the free-form surface ΓòÉΓòÉΓòÉ
  2971.  
  2972. If you want to give parts names that are more descriptive or meaningful to your 
  2973. application, you can do so as follows: 
  2974.  
  2975.    1. Move the mouse pointer over the part whose name you want to change. 
  2976.  
  2977.    2. Click mouse button 2 to display the pop-up menu for the part. 
  2978.  
  2979.    3. Select Change Name. 
  2980.  
  2981.       A Name Change Request window is displayed. 
  2982.  
  2983.    4. Type a new name in the entry field. 
  2984.  
  2985.    5. Select OK. 
  2986.  
  2987.       Visual Builder changes the name of the part to the name that you typed in 
  2988.       the entry field. 
  2989.  
  2990.  You can also change a part's name by opening the part's settings notebook and 
  2991.  changing the name in the Subpart name field. 
  2992.  
  2993.  
  2994. ΓòÉΓòÉΓòÉ 41.4. Arrange parts ΓòÉΓòÉΓòÉ
  2995.  
  2996. You can arrange parts on the free-form surface in a number of different ways. 
  2997. The following sections explain each of those ways. 
  2998.  
  2999.      Moving parts 
  3000.  
  3001.      Positioning parts on the grid 
  3002.  
  3003.      Specifying grid spacing 
  3004.  
  3005.      Showing and hiding the grid 
  3006.  
  3007.      Sizing parts 
  3008.  
  3009.      Matching part sizes 
  3010.  
  3011.      Aligning parts 
  3012.  
  3013.      Spacing subparts within Composers parts 
  3014.  
  3015.  
  3016. ΓòÉΓòÉΓòÉ 41.4.1. Move parts ΓòÉΓòÉΓòÉ
  3017.  
  3018. To move a part, move the mouse pointer over the part, hold down mouse button 2, 
  3019. and move the mouse pointer to drag the part to the new position. 
  3020.  
  3021.            You can move several parts at once by first selecting all the parts 
  3022.            you want to move and then dragging one of the parts as described. 
  3023.            All of the selected parts will move together, maintaining their 
  3024.            position relative to each other. 
  3025.  
  3026.  
  3027. ΓòÉΓòÉΓòÉ 41.4.2. Position parts on the grid ΓòÉΓòÉΓòÉ
  3028.  
  3029. To position the top-left corner of parts to the nearest grid coordinate, do the 
  3030. following: 
  3031.  
  3032.    1. Select all the parts you want to position to the grid. 
  3033.  
  3034.       Note:  If the parts you select are subparts, they are positioned to the 
  3035.              grid set up inside the Composers part, not the grid for the 
  3036.              free-form surface. 
  3037.  
  3038.    2. Select , the Snap To Grid tool. 
  3039.  
  3040.            You can automatically position a part to the nearest grid coordinate 
  3041.            when it is added to the free-form surface or a Composers part by 
  3042.            selecting Snap On Drop from the Options pull-down menu. 
  3043.  
  3044.  
  3045. ΓòÉΓòÉΓòÉ 41.4.3. Specify grid spacing ΓòÉΓòÉΓòÉ
  3046.  
  3047. To specify the grid spacing, do the following: 
  3048.  
  3049.    1. From the pop-up menu of a Composers part or the free-form surface, select 
  3050.       Set Grid Spacing. 
  3051.  
  3052.    2. Specify the horizontal and vertical distance between the lines of the 
  3053.       grid in pixels. 
  3054.  
  3055.  
  3056. ΓòÉΓòÉΓòÉ 41.4.4. Show and hide the grid ΓòÉΓòÉΓòÉ
  3057.  
  3058. To toggle between showing and hiding the grid for the free-form surface, do one 
  3059. of the following: 
  3060.  
  3061.      If no parts are selected, you can select , the Toggle Grid tool to toggle 
  3062.       the grid for the free-form surface. 
  3063.  
  3064.      If a Composers part is selected, selecting the Toggle Grid tool toggles 
  3065.       the grid for the Composers part instead of the free-form surface. 
  3066.  
  3067.  Toggling between showing and hiding the grid for a Composers part 
  3068.  
  3069.  To toggle between showing and hiding the grid for a Composers part, do one of 
  3070.  the following: 
  3071.  
  3072.      Select the Composers part and the select , the Toggle Grid tool. 
  3073.  
  3074.      From the Composers part's pop-up menu, select Toggle Grid. 
  3075.  
  3076.  
  3077. ΓòÉΓòÉΓòÉ 41.4.5. Size parts ΓòÉΓòÉΓòÉ
  3078.  
  3079. To change the size of a part, select it and use mouse button 1 to drag one of 
  3080. the selection handles to the new position. An outline of the part is displayed 
  3081. under the mouse pointer to show you the new size of the part. 
  3082.  
  3083.            You can size several parts at once by first selecting all the parts 
  3084.            you want to size. 
  3085.  
  3086.            To size a part in only one direction, press and hold the Shift key 
  3087.            while using mouse button 1 to size the part. Holding down the Shift 
  3088.            key prevents one dimension of the part from changing while you 
  3089.            resize the other dimension. For example, to change the width of a 
  3090.            part but prevent its height from changing, hold down the Shift key 
  3091.            while changing the width. 
  3092.  
  3093.            You can also size a part to the grid coordinates by selecting Snap 
  3094.            On Size from the Options pull-down menu. 
  3095.  
  3096.  
  3097. ΓòÉΓòÉΓòÉ 41.4.6. Match part sizes ΓòÉΓòÉΓòÉ
  3098.  
  3099. To size parts to the same width or height of another part, do the following: 
  3100.  
  3101.    1. Select all the parts you want to size, making sure the last part you 
  3102.       select is the part whose size you want the others to match. 
  3103.  
  3104.    2. Select one of the following sizing tools from the tool bar: 
  3105.  
  3106.         Match Width                        Match Height 
  3107.  
  3108.       The size of all the parts you selected, with the exception of the last 
  3109.       part, changes to match the size of the last part selected. 
  3110.  
  3111.  
  3112. ΓòÉΓòÉΓòÉ 41.4.7. Align parts ΓòÉΓòÉΓòÉ
  3113.  
  3114. To align parts to the same position as another part, do the following: 
  3115.  
  3116.    1. Select all the parts you want to align, and then select the part you want 
  3117.       the others to be aligned with. 
  3118.  
  3119.    2. Select one of the following alignment tools from the tool bar: 
  3120.  
  3121.         Align Left                         Align Top 
  3122.         Align Center                       Align Middle 
  3123.         Align Right                        Align Bottom 
  3124.  
  3125.  
  3126. ΓòÉΓòÉΓòÉ 41.4.8. Space subparts within Composers parts ΓòÉΓòÉΓòÉ
  3127.  
  3128. To evenly space subparts within their Composers part, do the following: 
  3129.  
  3130.    1. Select all the parts you want to evenly space. 
  3131.  
  3132.    2. Select one the following spacing tools from the tool bar: 
  3133.  
  3134.         Distribute Horizontally 
  3135.         Distribute Vertically 
  3136.  
  3137.  
  3138. ΓòÉΓòÉΓòÉ 41.4.9. Space parts within a bounding box ΓòÉΓòÉΓòÉ
  3139.  
  3140. To evenly space parts within the unseen bounding box that contains the selected 
  3141. parts, do the following: 
  3142.  
  3143.    1. Select all the parts you want to evenly space. You must select a minimum 
  3144.       of three parts. 
  3145.  
  3146.    2. From the pop-up menu of one of the selected parts, select 
  3147.       LayoutDistribute, and then one of the following: 
  3148.  
  3149.       Horizontally In Bounding Box Evenly distributes the selected parts within 
  3150.              the region bounded by the leftmost edge and rightmost edge of the 
  3151.              selected parts. 
  3152.  
  3153.       Vertically In Bounding Box Evenly distributes the selected parts within 
  3154.              the region bounded by the topmost edge and bottommost edge of the 
  3155.              selected parts. 
  3156.  
  3157.  
  3158. ΓòÉΓòÉΓòÉ 41.5. Change settings for a part ΓòÉΓòÉΓòÉ
  3159.  
  3160. The settings notebook of a part provides a way to display and set attributes 
  3161. and options for the part. 
  3162.  
  3163. Opening the settings notebook for one part 
  3164.  
  3165. To open the settings notebook for a part, move the mouse pointer over the part 
  3166. and do one of the following: 
  3167.  
  3168.      Double-click mouse button 1. 
  3169.  
  3170.      Click mouse button 2 and select Open settings from the part's pop-up 
  3171.       menu. 
  3172.  
  3173.  Opening settings notebooks for multiple parts 
  3174.  
  3175.  You can open the settings notebooks for multiple parts by doing the following: 
  3176.  
  3177.    1. Select the parts whose settings you want to change. 
  3178.    2. Move the mouse pointer over one of the selected parts. 
  3179.    3. Click mouse button 2. 
  3180.    4. Select Open settings from the pop-up menu. 
  3181.  
  3182.       Visual Builder opens a settings notebook for each of the selected parts. 
  3183.  
  3184.  Navigating through a settings notebook 
  3185.  
  3186.  You can navigate through the notebook pages in the following ways: 
  3187.  
  3188.      To turn the pages of a notebook, use the small left- and right-arrow push 
  3189.       buttons at the bottom right corner of each page. 
  3190.  
  3191.      To move to a different settings category, select one of the tabs to the 
  3192.       right of the pages. 
  3193.  
  3194.       Note:  When a category has more than one page, the page number and total 
  3195.              number of pages within the category are displayed at the bottom of 
  3196.              the page. 
  3197.  
  3198.      If all the category tabs cannot fit below the pages of the notebook, 
  3199.       small double left- and right-arrow push buttons are displayed to the left 
  3200.       and right of the category tabs. Use these buttons to move through the 
  3201.       available category tabs. 
  3202.  
  3203.  Adding a handler 
  3204.  
  3205.  To add a handler, do the following: 
  3206.  
  3207.    1. Enter the name of the handler class in the Handler Name field, along with 
  3208.       the list of parameters that you want to send to the handler's 
  3209.       constructor. If you use any part names as parameters, be sure to use the 
  3210.       default name that Visual Builder has assigned unless you have changed the 
  3211.       name. Also, put a lower case "i" before those parameters because Visual 
  3212.       Builder prefixes the part name with an "i" when it generates the code 
  3213.       files. For example, if you are using the first entry field that you 
  3214.       placed in a frame window as a parameter and have not changed the default 
  3215.       name that Visual Builder assigns, the parameter name would be 
  3216.       iEntryField1. 
  3217.  
  3218.    2. If the Handler List list box contains other handlers, select the handler 
  3219.       that you want your new handler to either precede or follow. 
  3220.  
  3221.    3. Select either the Add after or Add before push button. 
  3222.  
  3223.       If you did not import the handler class from a .vbe file, Visual Builder 
  3224.       displays a message saying that the name you entered is not a valid part 
  3225.       and asks if you want to continue. 
  3226.  
  3227.    4. Select the Yes push button. 
  3228.  
  3229.       The message disappears and the handler is added either after or before 
  3230.       the handler that is selected in the Handler List list box, depending on 
  3231.       which push button you select. 
  3232.  
  3233.    5. Select the OK push button to save the new handler in the handler list and 
  3234.       close the settings notebook. 
  3235.  
  3236.            We recommend that you put your handler class declaration and code in 
  3237.            separate user .hpv and .cpv files rather than modifying the files 
  3238.            that Visual Builder generates. This way, if you need to regenerate 
  3239.            the files, you do not have to recreate your handler code. 
  3240.  
  3241.            Be sure to include the names of the files that contain the handler 
  3242.            code in the User .hpv file and User .cpv file fields in the Class 
  3243.            Editor. 
  3244.  
  3245.            For information about implementing handlers, refer to the IBM Open 
  3246.            Class Library User's Guide and the IBM Open Class Library Reference. 
  3247.  
  3248.  Moving a handler 
  3249.  
  3250.  To move a handler to a different position in the list, do the following: 
  3251.  
  3252.    1. Select the handler that you want to move. 
  3253.  
  3254.    2. Select the Move push button. 
  3255.  
  3256.    3. In the dialog that is displayed, select the handler that is to precede or 
  3257.       follow the handler being moved. 
  3258.  
  3259.    4. Select the Move after push button to move the handler after the selected 
  3260.       handler, or select the Move before push button to move the handler before 
  3261.       the selected handler. 
  3262.  
  3263.       The dialog disappears and the handler is moved. 
  3264.  
  3265.  Removing a handler 
  3266.  
  3267.  To remove a handler from the list, do the following: 
  3268.  
  3269.    1. Select the handler you want to remove from the list. 
  3270.  
  3271.    2. Select the Remove push button. 
  3272.  
  3273.       The selected handler is removed from the list. 
  3274.  
  3275.  Changing the color 
  3276.  
  3277.  To change the color, do the following: 
  3278.  
  3279.    1. In the Color Area group box, select the area, such as foreground or 
  3280.       background, whose color you want to change. 
  3281.  
  3282.    2. Do one of the following: 
  3283.  
  3284.           If you want to specify red-green-blue values, select the RGB check 
  3285.            box and specify values in the fields in the RGB Values group box. 
  3286.  
  3287.           If you want to select a color by its name, deselect the RGB check 
  3288.            box and select a color from the Colors drop-down list box. 
  3289.  
  3290.    3. Select either the Apply push button to see how this color looks for your 
  3291.       part without saving the change or the OK push button to close the 
  3292.       settings notebook and save the color change. 
  3293.  
  3294.  Specifying the size and position of a part 
  3295.  
  3296.  To specify the size and position of a part, do the following: 
  3297.  
  3298.    1. In the x and y fields, specify the initial x/y coordinates for the part. 
  3299.       These coordinates determine the position of the part's upper left corner. 
  3300.  
  3301.    2. In the width and height fields, specify the number of pixels for the 
  3302.       width and height of the part. 
  3303.  
  3304.    3. Optionally, you can also specify the smallest size the part can have by 
  3305.       using the Minimum Size group box to do either of the following: 
  3306.  
  3307.           If you want the minimum size to be calculated for you, select the 
  3308.            Calculate at execution time radio button. 
  3309.  
  3310.           If you want to specify the minimum size for the part, select the Set 
  3311.            value here radio button and then enter the width and height in 
  3312.            pixels in the corresponding fields. 
  3313.  
  3314.  Changing the font for a part 
  3315.  
  3316.  To change the font for a part, do one of the following: 
  3317.  
  3318.      If you know the name and size of the font you want to use, you can enter 
  3319.       them in their respective fields. 
  3320.  
  3321.      If you do not know the name and size of the font you want to use or if 
  3322.       you want to change the style or emphasis, select the Edit push button. 
  3323.       Visual Builder displays a standard font dialog on which you can select 
  3324.       the name, size, style, and emphasis you want to use for the part's font. 
  3325.  
  3326.  Using code strings to supply initial field values 
  3327.  
  3328.  Many settings pages provide fields in which you can specify initial values for 
  3329.  part settings. For example, the General page of the IEntryField* settings 
  3330.  notebook contains a Text field and a Limit field. In the Text field, you can 
  3331.  enter a text string that you want Visual Builder to initially display in the 
  3332.  entry field. The Limit field contains a default value of 32, which represents 
  3333.  the maximum number of characters a user can type in the entry field, and you 
  3334.  can change this number. 
  3335.  
  3336.  To facilitate National Language Support (NLS) translation and code changes in 
  3337.  providing settings values, you can enter a code string to provide those 
  3338.  values. You must precede the code string with a number sign (#). If the first 
  3339.  character of your code string is a #, be sure to enter two #s-the first one to 
  3340.  signify that a code string follows and the second one to begin your code 
  3341.  string. 
  3342.  
  3343.  For example, suppose you want the initial text in an entry field to be Enter a 
  3344.  name here. Further, suppose that you want the limit for this entry field to be 
  3345.  18 characters. In a user header file (.hpv or .h), you could insert the 
  3346.  following #define statements: 
  3347.  
  3348.   #define NAME_PROMPT  "Enter a name here"
  3349.   #define NAME_LENGTH 18
  3350.  
  3351.            Be sure to enter the name of the file that contains these #define 
  3352.            statements in the Required include files field in the Class Editor. 
  3353.            Otherwise, this file is not included when you generate the code for 
  3354.            this part. 
  3355.  
  3356.  Then, on the General page of the IEntryField* settings notebook you could 
  3357.  enter the following in the Text and Limit fields, respectively: 
  3358.  
  3359.   #NAME_PROMPT
  3360.   #NAME_LENGTH
  3361.  
  3362.  By doing this, the values that you defined for NAME_PROMPT and NAME_LENGTH are 
  3363.  used when you generate the source code for the part being edited. 
  3364.  
  3365.  For an example that uses a code string to specify an icon to represent items 
  3366.  in a container, see the subsection titled "Specifying the container type and 
  3367.  layout" in Adding Container Parts. 
  3368.  
  3369.  Activating settings changes 
  3370.  
  3371.  After you make changes to the settings, you can activate them in the following 
  3372.  ways: 
  3373.  
  3374.      Select the OK push button to immediately activate and save the settings 
  3375.       changes you have made, and close the settings notebook. 
  3376.  
  3377.      Select the Apply push button to apply the settings changes you have made 
  3378.       and keep the settings notebook open. 
  3379.  
  3380.       This allows you to see whether you need to modify any of the changes you 
  3381.       have made. The changes remain applied until you change them again. 
  3382.  
  3383.  Select the Cancel push button to remove the settings notebook. If you made 
  3384.  changes and selected the Apply push button, the changes are saved. 
  3385.  
  3386.  Select the Help push button for more help with using the settings notebook. 
  3387.  
  3388.  For information about the settings of a particular part, refer to the settings 
  3389.  section of the part in the Visual Builder Parts Reference. 
  3390.  
  3391.  
  3392. ΓòÉΓòÉΓòÉ 41.6. Use the generic settings notebook ΓòÉΓòÉΓòÉ
  3393.  
  3394. To view the settings notebook for your part, do one of the following: 
  3395.  
  3396.      To set values for an instance of your part that you are using in a 
  3397.       composite part, do the following: 
  3398.  
  3399.         1. Place the part in the Composition Editor. 
  3400.  
  3401.         2. Move the mouse pointer over the part and click mouse button 2. 
  3402.  
  3403.         3. Select Open settings from the pop-up menu. 
  3404.  
  3405.            Visual Builder displays the settings notebook for the part. 
  3406.  
  3407.      To set attribute values for your part that will be available each time 
  3408.       your part is used, do the following: 
  3409.  
  3410.         1. Open the part. 
  3411.  
  3412.         2. If the part is a nonvisual or class interface part, switch to the 
  3413.            Composition Editor. You will already be in the Composition Editor if 
  3414.            your part is a visual part. 
  3415.  
  3416.         3. Move the mouse pointer over the free-form surface and click mouse 
  3417.            button 2. 
  3418.  
  3419.         4. Select Open settings from the pop-up menu. 
  3420.  
  3421.                           A quicker way to open the generic settings notebook 
  3422.                           is to double-click on the part. 
  3423.  
  3424.            Visual Builder displays the settings notebook for the part. 
  3425.  
  3426.  
  3427. ΓòÉΓòÉΓòÉ 41.7. Set the tabbing order ΓòÉΓòÉΓòÉ
  3428.  
  3429. Displaying the tabbing order list 
  3430.  
  3431. To display the tabbing order list, do the following: 
  3432.  
  3433.    1. Move the mouse pointer to the Composers part whose tab order you want to 
  3434.       change. 
  3435.  
  3436.    2. Click mouse button 2. 
  3437.  
  3438.       Visual Builder displays the pop-up menu for the Composers part. 
  3439.  
  3440.    3. Select Tabbing And Depth Order. 
  3441.  
  3442.       A list of the current tabbing order is displayed. 
  3443.  
  3444.  When the tabbing order is displayed, you can do the following: 
  3445.  
  3446.      Change the positions of parts in the tabbing order list. 
  3447.  
  3448.      Set groups and tab stops. 
  3449.  
  3450.      Perform operations on parts in the tabbing order list. 
  3451.  
  3452.  
  3453. ΓòÉΓòÉΓòÉ 41.7.1. Change the positions of parts in the tabbing order ΓòÉΓòÉΓòÉ
  3454.  
  3455. To change the position of a part within the tabbing order list, do the 
  3456. following: 
  3457.  
  3458.    1. Move the mouse pointer to the part whose position you want to change. 
  3459.  
  3460.    2. Press and hold mouse button 2. 
  3461.  
  3462.    3. Drag the part to a new position in the list. 
  3463.  
  3464.    4. Release mouse button 2. 
  3465.  
  3466.            You can change the position of several parts within the tabbing 
  3467.            order at the same time by first selecting all the parts you want to 
  3468.            move. You select multiple parts by holding down the Ctrl key and 
  3469.            clicking on the parts with mouse button 1. 
  3470.  
  3471.            You cannot move a subpart to a new Composers part by changing the 
  3472.            tabbing order. You must do this in the Composition Editor. 
  3473.  
  3474.  
  3475. ΓòÉΓòÉΓòÉ 41.7.2. Set groups and tab stops ΓòÉΓòÉΓòÉ
  3476.  
  3477. If you want the user to be able to move the input focus to a part using the Tab 
  3478. and Backtab keys, select the Tab stop check box to the left of the part in the 
  3479. tabbing order list. 
  3480.  
  3481. If you want the user to be able to move the input focus to a part with the 
  3482. keyboard arrow keys, select the Group check box to the left of the first part 
  3483. in the group. All other parts listed below the part that has Group selected are 
  3484. included in the group. 
  3485.  
  3486. To start another group, select the Group check box for the part that you want 
  3487. to be the first part in that group. If a part has both Group and Tab stop 
  3488. selected, a user can tab to the first part in the group and then use the arrow 
  3489. keys to move to the other parts in the group. 
  3490.  
  3491.  
  3492. ΓòÉΓòÉΓòÉ 41.7.3. Perform operations on parts in the tabbing order list ΓòÉΓòÉΓòÉ
  3493.  
  3494. To perform an operation on a part in the tabbing order list, do the following: 
  3495.  
  3496.    1. Move the mouse pointer over the part. 
  3497.  
  3498.    2. Click mouse button 2. 
  3499.  
  3500.       Visual Builder displays the pop-up menu for the part. 
  3501.  
  3502.    3. Select the operation you want to perform. 
  3503.  
  3504.  
  3505. ΓòÉΓòÉΓòÉ 41.8. Edit parts placed on the free-form surface ΓòÉΓòÉΓòÉ
  3506.  
  3507. If you need to edit a part that was added to the part you are currently 
  3508. editing, do the following: 
  3509.  
  3510.    1. If you have not already done so, load the .vbb file that contains the 
  3511.       part you want to edit. 
  3512.  
  3513.    2. Move the mouse pointer over the part you want to edit. 
  3514.  
  3515.    3. Click mouse button 2. 
  3516.  
  3517.       The part's pop-up menu appears. 
  3518.  
  3519.    4. Select Edit Part. 
  3520.  
  3521.       Visual Builder displays the appropriate editor for the part, as follows: 
  3522.  
  3523.           If you are editing a visual part, Visual Builder displays the 
  3524.            Composition Editor 
  3525.  
  3526.           If you are editing a nonvisual or class interface part, Visual 
  3527.            Builder displays the Part Interface Editor. 
  3528.  
  3529.    5. Edit the part. 
  3530.  
  3531.                      If you want to promote any of the features of the parts 
  3532.                      used to create the composite part you are editing, doing 
  3533.                      so now keeps you from having to edit this part again 
  3534.                      later. See Promoting a Part's Features if you need more 
  3535.                      information about doing this. 
  3536.  
  3537.    6. Select FileSave to save the part. 
  3538.  
  3539.    7. Close the editor by doing one of the following: 
  3540.  
  3541.           Double-click on the system menu icon. 
  3542.           Select FileExit. 
  3543.  
  3544.       The editor you are using disappears and you are returned to the 
  3545.       Composition Editor you were using previously. However, Visual Builder has 
  3546.       not applied the changes you made to the part you just edited, so those 
  3547.       changes are not visible yet. 
  3548.  
  3549.    8. Select FileSave to save the original part. 
  3550.  
  3551.    9. Close the Composition Editor for the original part that you were editing, 
  3552.       as described above. 
  3553.  
  3554.   10. Reopen the original part you were editing by double-clicking on the 
  3555.       part's name in the Visual Builder window. 
  3556.  
  3557.       You should now be able to see the changes you made to the part that you 
  3558.       edited. 
  3559.  
  3560.  
  3561. ΓòÉΓòÉΓòÉ 41.9. Promote a part's features ΓòÉΓòÉΓòÉ
  3562.  
  3563. The following steps show you how to promote a part's features from the 
  3564. Composition Editor. 
  3565.  
  3566.            To promote features of several subparts, we recommend using Promote 
  3567.            page of the Part Interface Editor. 
  3568.  
  3569.    1. If you have not already done so, load the .vbb file that contains the 
  3570.       composite part whose features you want to promote. 
  3571.  
  3572.    2. If you have not already done so, open the composite part or edit the 
  3573.       subpart, whichever is necessary. 
  3574.  
  3575.       Visual Builder displays the Composition Editor with the part that you are 
  3576.       opening or the subpart that you are editing on the free-form surface. 
  3577.  
  3578.    3. Move the mouse pointer over a part whose features you want to promote. 
  3579.  
  3580.    4. Click mouse button 2 to display the part's pop-up menu. 
  3581.  
  3582.    5. Select Promote Part Feature. 
  3583.  
  3584.    6. Select a feature. 
  3585.  
  3586.       The name of the feature you selected is displayed in the Promote feature 
  3587.       name entry field prefixed with the name of the part. This is how the 
  3588.       feature name will appear in the connections menu unless you change it 
  3589.       before performing the next step. 
  3590.  
  3591.    7. Select the Promote push button. 
  3592.  
  3593.       The feature name is added to the Previously promoted list box, as shown 
  3594.       inthe following figure: 
  3595.  
  3596.    8. Repeat the previous two steps until you have promoted all of the features 
  3597.       you need to make the necessary connections. 
  3598.  
  3599.    9. Close the window for promoting features. 
  3600.  
  3601.   10. Select FileSave to save the features you just promoted. 
  3602.  
  3603.   11. Close the Composition Editor. 
  3604.  
  3605.       You can now use the feature or features that you promoted to make 
  3606.       connections. 
  3607.  
  3608.  
  3609. ΓòÉΓòÉΓòÉ 41.10. Tear off an attribute ΓòÉΓòÉΓòÉ
  3610.  
  3611. Select Tear-Off Attribute from a part's pop-up menu to work with an attribute 
  3612. as if it were a standalone part. The torn-off attribute is not actually a 
  3613. separate part but a variable that either represents the attribute itself or 
  3614. points to it. 
  3615.  
  3616. When you select Tear-Off Attribute, Visual Builder displays the list of 
  3617. attributes for the part that you are tearing from. After you select an 
  3618. attribute from the list, you can drop the torn-off attribute on the free-form 
  3619. surface. Visual Builder creates an 
  3620.  
  3621.  
  3622. ΓòÉΓòÉΓòÉ 41.11. Undo changes in the Composition Editor ΓòÉΓòÉΓòÉ
  3623.  
  3624. If you change something in the Composition Editor and then decide that you 
  3625. should have left things as they were, select Undo from the Edit pull-down menu 
  3626. to restore the part to its previous state. You can undo as many operations as 
  3627. you want, all the way back to when you opened the Composition Editor. 
  3628.  
  3629. If you undo an operation and then decide that you did the right thing in the 
  3630. first place, select Redo from the Edit pull-down menu. Redo restores the part 
  3631. to the state it was in before the last Undo, including any connections that 
  3632. were deleted. 
  3633.  
  3634. If you are not sure which operations you want to undo or redo, select Undo/Redo 
  3635. list from the Edit pull-down menu to display two lists of operations, one for 
  3636. undoing and one for redoing. From these lists, you can select an operation and 
  3637. then select the Undo or Redo push button. The operation that you select and all 
  3638. of the operations listed below it are undone or redone. 
  3639.  
  3640. Note:  Undo, Redo, and Undo/Redo list only affect operations you perform on the 
  3641.        free-form surface and parts palette in the Composition Editor. They have 
  3642.        no affect on any of the functions in the File pull-down menu, such as 
  3643.        Save, Save As, and Save and Generate, which you cannot undo. 
  3644.  
  3645.  
  3646. ΓòÉΓòÉΓòÉ 42. ...Construct a GUI using the OASearch application ΓòÉΓòÉΓòÉ
  3647.  
  3648.      Adding basic visual parts 
  3649.  
  3650.         -  Adding the parts 
  3651.  
  3652.         -  Changing the settings 
  3653.  
  3654.      Adding a variable to a composite part 
  3655.  
  3656.         -  Changing the variable's type 
  3657.  
  3658.         -  Adding the variable to the part interface 
  3659.  
  3660.  
  3661. ΓòÉΓòÉΓòÉ 42.1. Add basic visual parts ΓòÉΓòÉΓòÉ
  3662.  
  3663. The purpose of this section is to guide you through constructing a version of 
  3664. the Opportunities Abound Contract Information window for the OASearch sample 
  3665. application. You construct this part (ContractView) in the Composition Editor 
  3666. using the basic visual parts. When finished, the Opportunities Abound Contract 
  3667. Information window looks like the following figure: 
  3668.  
  3669. To see the finished part, open contract.vbb. Begin with adding the parts. 
  3670.  
  3671.  
  3672. ΓòÉΓòÉΓòÉ 42.1.1. Add the parts ΓòÉΓòÉΓòÉ
  3673.  
  3674. Before starting this new visual part, make sure that oanonvis.vbb is loaded 
  3675. into Visual Builder. 
  3676.  
  3677. Adding the parts 
  3678.  
  3679.    1. Because you are constructing a new user interface, begin by creating a 
  3680.       visual part. Call it ContractView. 
  3681.  
  3682.       When you create a visual part, the Composition Editor opens a part that 
  3683.       inherits from IFrameWindow*. By default, the client area of the 
  3684.       IFrameWindow* appears as a canvas. 
  3685.  
  3686.    2. Change the title of the window. 
  3687.  
  3688.    3. Add the following parts to the window part: 
  3689.  
  3690.           Static text and entry field parts for Account Number, Company Name, 
  3691.            Project Manager, and Department. 
  3692.  
  3693.           A group-box part for the Position Details group. Resize the group 
  3694.            box. 
  3695.  
  3696.           Static-text and entry-field parts for the items inside the group 
  3697.            box. 
  3698.  
  3699.           Push-button parts. 
  3700.  
  3701.       See the figure below to see how the window should look after the parts 
  3702.       are added. 
  3703.  
  3704.  Changing the Labels 
  3705.  
  3706.  Directly edit the static text so that the text matches the previous figure. 
  3707.  
  3708.  Arranging the Parts 
  3709.  
  3710.  Arrange the parts on the frame window part so they are aligned and positioned 
  3711.  as shown the previous figure. 
  3712.  
  3713.  Now that all the parts have been added, continue on with changing the 
  3714.  settings. 
  3715.  
  3716.  
  3717. ΓòÉΓòÉΓòÉ 42.1.2. Change the settings ΓòÉΓòÉΓòÉ
  3718.  
  3719. Now that the parts have been added for the user interface, customize the parts 
  3720. by modifying their settings. 
  3721.  
  3722. Specifying a push button label with mnemonic 
  3723.  
  3724. On the General settings page for the middle push button, type ~Save in the Text 
  3725. field. Select the OK push button. 
  3726.  
  3727. The middle push button of your window now reads Save, with a mnemonic of S. 
  3728. This means the user can select the push button by pressing Alt+S. 
  3729.  
  3730. Repeat this procedure for the push button to the right of the Save push button, 
  3731. specifying Cl~ear as the push button label. This push button now reads Clear, 
  3732. with a mnemonic of E. 
  3733.  
  3734. For the rightmost push button, specify ~Cancel as the label. This push button 
  3735. now reads Cancel, with a mnemonic of C. 
  3736.  
  3737. Specifying the default push button 
  3738.  
  3739. On the General settings page for the leftmost push button, type ~Refresh in the 
  3740. Text field. Select the Apply push button. The leftmost push button of your 
  3741. window now reads Refresh, with a mnemonic of R. 
  3742.  
  3743. On the Styles settings page, select the On radio button for the defaultButton 
  3744. style. Select the OK push button. The Refresh push button is now the default 
  3745. button for the window. This means the user can select the push button by 
  3746. pressing the Enter key. 
  3747.  
  3748. For details on the settings of a particular part, refer to the Visual Builder 
  3749. Parts Reference. For more information on how to perform these operations, see 
  3750. Changing Settings. 
  3751.  
  3752. Now that the settings have been specified, the next step is making connections 
  3753. between the parts. 
  3754.  
  3755.  
  3756. ΓòÉΓòÉΓòÉ 42.2. Add a variable to a composite part ΓòÉΓòÉΓòÉ
  3757.  
  3758. Begin by opening the ContractView part (found in contract.vbb) in the 
  3759. Composition Editor. If you prefer to use the OAContractView part, you can find 
  3760. this part in oawin.vbb. At this point, the ContractView part appears as shown 
  3761. in the following figure: 
  3762.  
  3763. We are using a variable instead of an OAContract* part because the contract 
  3764. data varies with the information entered from the OAQueryContract* part. 
  3765.  
  3766. To add a variable to the free-form surface, select , the Models category, from 
  3767. the parts palette; then add , an IVBVariable* part, to the free-form surface. 
  3768. Change its name to Contract. The ContractView with a variable added appears as 
  3769. shown in the following figure: 
  3770.  
  3771.            Notice the square bracket symbols around the variable part. You can 
  3772.            always identify a variable by these symbols. Also note that tear-off 
  3773.            attributes also have square brackets and are in fact variables with 
  3774.            a special connection. 
  3775.  
  3776.  The next step is changing the variable's type. 
  3777.  
  3778.  
  3779. ΓòÉΓòÉΓòÉ 42.2.1. Change the variable's type ΓòÉΓòÉΓòÉ
  3780.  
  3781.    1. First, make sure the the .vbb file holding the OAContract part 
  3782.       (oanonvis.vbb) is loaded into Visual Builder. 
  3783.  
  3784.    2. Select Change Type on the variable's pop-up menu; then type OAContract* 
  3785.  
  3786.  The next step is adding the variable to the part interface. 
  3787.  
  3788.  
  3789. ΓòÉΓòÉΓòÉ 42.2.2. Add the variable to the Part Interface ΓòÉΓòÉΓòÉ
  3790.  
  3791. So far, the Contract variable is empty. To make the variable available for 
  3792. passing values from the main view (or any part outside ContractView), we must 
  3793. add the variable to the part interface of ContractView), Do this by selecting 
  3794. Promote Part Feature from the variable's pop-up menu. See Promoting a Part's 
  3795. Features if you need information about doing this. 
  3796.  
  3797. The next step is connecting the variable. 
  3798.  
  3799.  
  3800. ΓòÉΓòÉΓòÉ 43. ...Learn to use connections ΓòÉΓòÉΓòÉ
  3801.  
  3802.      Making the connections 
  3803.  
  3804.      Connecting features to member functions 
  3805.  
  3806.      Connecting exception events to actions and member functions 
  3807.  
  3808.      Manipulating connections 
  3809.  
  3810.      Rearranging connections 
  3811.  
  3812.      Making connections for the OASearch application 
  3813.  shows the results of connecting attributes that have different behavior types. 
  3814.  See 
  3815.  
  3816.  
  3817. ΓòÉΓòÉΓòÉ 43.1. Make the connections ΓòÉΓòÉΓòÉ
  3818.  
  3819. In this section, you learn how to make attribute-to-attribute, 
  3820. event-to-attribute, event-to-action, and attribute-to-action connections. This 
  3821. section provides the following information: 
  3822.  
  3823.      Determining the source and target 
  3824.  
  3825.      Browsing a part's features 
  3826.  
  3827.      Connecting features to features 
  3828.  
  3829.      Satisfying parameters for incomplete connections 
  3830.  
  3831.  Member function connections are discussed in Connecting Features to Member 
  3832.  Functions. Custom logic connections are discussed in Adding a Custom Logic 
  3833.  Connection. 
  3834.  
  3835.  
  3836. ΓòÉΓòÉΓòÉ 43.1.1. Determine the source and target ΓòÉΓòÉΓòÉ
  3837.  
  3838. Here are the source and target rules: 
  3839.  
  3840.      With an attribute-to-action, event-to-action, or event-to-attribute 
  3841.       connection, the event is always the source and the action or attribute is 
  3842.       always the target. If you try to make an action-to-attribute, 
  3843.       action-to-event, or attribute-to-event connection, Visual Builder 
  3844.       automatically reverses it for you. 
  3845.  
  3846.      For attribute-to-attribute connections, if only one of the attributes has 
  3847.       a set member function Visual Builder makes that attribute the target. 
  3848.       This is done so that the attribute that has the set member function can 
  3849.       be initialized when the application starts. 
  3850.  
  3851.      When you make attribute-to-attribute connections, the order in which you 
  3852.       choose the source and target is important. The source and target 
  3853.       attribute values are probably different when your view is first 
  3854.       initialized. If they are, Visual Builder resolves the difference by 
  3855.       changing the target end of the connection to match the source. 
  3856.       Thereafter, if both attributes have set member functions, the connection 
  3857.       updates either attribute if the other changes. 
  3858.  
  3859.  Refer to the attributes, actions, and events sections of the particular part 
  3860.  in the Visual Builder Parts Reference for information that is specific to a 
  3861.  part's features. 
  3862.  
  3863.  
  3864. ΓòÉΓòÉΓòÉ 43.1.2. Browse a part's features ΓòÉΓòÉΓòÉ
  3865.  
  3866. To browse the features of a part, do the following: 
  3867.  
  3868.    1. Move the mouse pointer over the part and click mouse button 2. 
  3869.  
  3870.       Visual Builder displays the part's pop-up menu. 
  3871.  
  3872.    2. Select Browse Part Features. 
  3873.  
  3874.       Visual Builder displays a browse window that contains three columns: one 
  3875.       for actions, one for attributes, and one for events. 
  3876.  
  3877.    3. Select the feature you want to browse. 
  3878.  
  3879.       Visual Builder displays information about the feature that you select in 
  3880.       the entry fields below the feature columns. 
  3881.  
  3882.    4. If the information about a part's features should change, you can select 
  3883.       the Refresh push button to see those changes reflected in the browse 
  3884.       window. 
  3885.  
  3886.    5. When you have finished browsing the features, select the Close push 
  3887.       button to close the browse window. 
  3888.  
  3889.  
  3890. ΓòÉΓòÉΓòÉ 43.1.3. Connect features to features ΓòÉΓòÉΓòÉ
  3891.  
  3892. When you connect features to features, you can use any of the following 
  3893. source-target combinations: 
  3894.  
  3895. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3896. ΓöéIf source is a...  ΓöéThe target can be a...  Γöé
  3897. Γöépart               Γöépart or connection      Γöé
  3898. Γöéconnection         Γöépart                    Γöé
  3899. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3900.  
  3901. Follow these steps to connect features: 
  3902.  
  3903.    1. Position the mouse pointer over the source, the part or connection that 
  3904.       you want to connect from, click mouse button 2, and select Connect from 
  3905.       its pop-up menu. 
  3906.  
  3907.                      To display the connection pop-up menu more quickly, hold 
  3908.                      down the Alt key while clicking mouse button 2. 
  3909.  
  3910.       A menu appears showing the names of the most commonly used attributes, 
  3911.       actions, and events, called the preferred features. If the source is a 
  3912.       part, there is usually a More selection at the bottom of the list. 
  3913.  
  3914.       If the More selection is not there, this means the list contains all of 
  3915.       the available features, not just the preferred ones, and there are no 
  3916.       more from which to select. 
  3917.  
  3918.    2. Do one of the following: 
  3919.  
  3920.           If the feature you want appears in the list, select it. 
  3921.  
  3922.           If the feature you want does not appear in the list, but the More 
  3923.            selection is available, select More and then select the feature you 
  3924.            want from the complete list of features. 
  3925.  
  3926.           If the feature you want does not appear in either the preferred list 
  3927.            or the expanded list that is displayed when you select More, you can 
  3928.            edit the part to add the feature you need. For more information 
  3929.            about this, see Editing Parts Placed on the Free-form Surface. 
  3930.  
  3931.                           If, at this point, you decide not to complete the 
  3932.                           connection, do one of the following: 
  3933.                             -  If a pop-up menu is displayed, move the mouse 
  3934.                                pointer away from the connection menu and click 
  3935.                                mouse button 1. 
  3936.  
  3937.                             -  If a window showing all of the features is 
  3938.                                displayed, select the Cancel push button at the 
  3939.                                bottom of the window. 
  3940.  
  3941.                           The menu or window disappears and the connection is 
  3942.                           not completed. 
  3943.  
  3944.    3. Position the mouse pointer over the part or connection that you want to 
  3945.       connect to. 
  3946.  
  3947.       While moving the mouse, notice that a dashed line trails from the mouse 
  3948.       pointer to the source of the connection. 
  3949.  
  3950.    4. Click mouse button 1 and a pop-up menu appears, again showing a list of 
  3951.       features. 
  3952.  
  3953.    5. Select a name from the pop-up menu or from the More list. 
  3954.  
  3955.       The same instructions regarding the presence of More apply as described 
  3956.       previously. 
  3957.  
  3958.  
  3959. ΓòÉΓòÉΓòÉ 43.1.4. Satisfy parameters for incomplete connections ΓòÉΓòÉΓòÉ
  3960.  
  3961. Satisfying a parameter using a connection 
  3962.  
  3963. To supply a parameter value, do the following: 
  3964.  
  3965.    1. Start a new connection using the dashed connection line that requires the 
  3966.       parameter as the source. 
  3967.  
  3968.    2. For the target, select the attribute, action, member function, or custom 
  3969.       logic that is to provide the value that the parameter needs. 
  3970.  
  3971.            While making a connection, when the mouse pointer is directly over 
  3972.            the connection line, you see a small box as a visual cue that the 
  3973.            pointer is positioned correctly. 
  3974.  
  3975.  Satisfying a parameter using a constant value 
  3976.  
  3977.  When connections need parameters whose input values are constant, you provide 
  3978.  these values by using the settings window of the incomplete connection, as 
  3979.  follows: 
  3980.  
  3981.    1. Select Open settings from the incomplete (dashed) connection's pop-up 
  3982.       menu. 
  3983.  
  3984.                      A quicker way to open the settings window is to 
  3985.                      double-click on the connection line. 
  3986.  
  3987.       The settings window of the incomplete connection is displayed. 
  3988.  
  3989.    2. Select the Set parameters push button. 
  3990.  
  3991.       The Constant Parameter Value Settings notebook is displayed showing the 
  3992.       parameters for which you can set constant values. 
  3993.  
  3994.    3. Enter the constant parameter values you want to use. 
  3995.  
  3996.    4. Do one of the following: 
  3997.  
  3998.           Select the OK push button to apply the values and save them. 
  3999.  
  4000.           Select the Apply push button if you want to see what effect these 
  4001.            values have before saving them. 
  4002.  
  4003.           Select the Cancel push button to remove the notebook without saving 
  4004.            any of the parameter values you entered. 
  4005.  
  4006.       You can select Help for additional information about entering parameter 
  4007.       values. 
  4008.  
  4009.  Specifying defaults for parameters 
  4010.  
  4011.  There are two places in Visual Builder in which you can specify defaults for 
  4012.  the parameters of actions in the declaration of the action's member function: 
  4013.  
  4014.      In the part's .vbe file 
  4015.      On the Action page of the Part Interface Editor 
  4016.  
  4017.  Either of these allows a default value to be passed in an event-to-action 
  4018.  connection, thus avoiding the need to satisfy a parameter. 
  4019.  
  4020.  For example, suppose you want to connect the buttonClickEvent feature of a 
  4021.  Remove push button to a removeSelected action that you created for an 
  4022.  IListBox* part. Normally, you would also need to connect the selection 
  4023.  attribute of the subclassed IListBox* part to the index attribute of the 
  4024.  connection between buttonClickEvent and removeSelected. This connection would 
  4025.  be required to get the index of the selected item in the list box. 
  4026.  
  4027.  However, in the .vbe file of the IListBox* part, you can specify the following 
  4028.  default parameter value for the removeSelected action: //VBAction: 
  4029.  removeSelected, "removeSelected",, //VB:       removeSelected(unsigned long 
  4030.  index=selection()) 
  4031.  
  4032.  This means that if no attribute of the IListBox* part is connected to the 
  4033.  index attribute, the selection member function (the get member function of the 
  4034.  selection attribute) is called by default to provide the index of the selected 
  4035.  item. 
  4036.  
  4037.  You could do the same thing by creating a removeSelected action on the Action 
  4038.  page of the Part Interface Editor for the IListBox* part. You would specify 
  4039.  the default parameter in the declaration of the removeSelected member function 
  4040.  in the Action member function field, as follows: virtual unsigned long 
  4041.  removeSelected(unsigned long index=selection()) 
  4042.  
  4043.  Missing or invalid parameters 
  4044.  
  4045.  When an action connection requires arguments, be sure that you make the 
  4046.  correct number of parameter connections. Also be sure that you make the 
  4047.  parameter connections before you generate the default code for your part. See 
  4048.  Manipulating Connections to learn how to re-order connections. 
  4049.  
  4050.  
  4051. ΓòÉΓòÉΓòÉ 43.2. Connect features to member function connections ΓòÉΓòÉΓòÉ
  4052.  
  4053.      Adding an event-to-member function connection 
  4054.  
  4055.      Using Browser information 
  4056.  
  4057.  
  4058. ΓòÉΓòÉΓòÉ 43.2.1. Add an event-to-member function connection ΓòÉΓòÉΓòÉ
  4059.  
  4060. The following figure shows the OAContractorView part used in the OASearch 
  4061. sample application in this book. The steps for adding an event-to-member 
  4062. function connection, which follow the figure, are based on this part. For 
  4063. information about how to construct this part, see Adding Notebook Parts. 
  4064.  
  4065.    1. With the mouse pointer over the Clear push button, hold down the Alt key 
  4066.       and click mouse button 2. 
  4067.  
  4068.       Visual Builder displays the connection menu for the Clear push button. 
  4069.  
  4070.    2. From this menu, select the buttonClickEvent choice, an event. 
  4071.  
  4072.    3. Move the mouse pointer to a point on the free-form surface outside the 
  4073.       OAContractorView notebook part and click mouse button 1. 
  4074.  
  4075.    4. Select More. 
  4076.  
  4077.       Visual Builder displays a window that contains three list boxes. 
  4078.  
  4079.       For this example, the For class field should contain OAContractorView, 
  4080.       the part that you are editing. 
  4081.  
  4082.       For this example, the Access field should contain public. 
  4083.  
  4084.    5. Type the member function to which the buttonClickEvent feature is to be 
  4085.       connected in the entry field below the Access field. Be sure to type the 
  4086.       full declaration of the member function, including return type and 
  4087.       parameters. 
  4088.  
  4089.       For this example, enter the following member function to clear all of the 
  4090.       fields in OAContractorView: void resetFields(); 
  4091.  
  4092.       You must also create an .hpv file that contains this member function 
  4093.       declaration and a .cpv file that contains the code for this member 
  4094.       function. The member function declaration that you enter in this field 
  4095.       must be identical to the declaration that you put in the .hpv file. For 
  4096.       information about .hpv and .cpv files, see Specifying Files for Visual 
  4097.       Builder to Include When You Build Your Application 
  4098.  
  4099.       In addition, before you generate the code for your part, you must switch 
  4100.       to the Class Editor and enter the names of these files so that Visual 
  4101.       Builder will include them in the code for your part. For more information 
  4102.       about including these files, see Specifying Files for Visual Builder to 
  4103.       Include When You Build Your Application. 
  4104.  
  4105.    6. Select the OK push button. 
  4106.  
  4107.       The connection window disappears and a light green connection arrow is 
  4108.       drawn from the Clear push button toward the edge of the free-form 
  4109.       surface. It looks like this: 
  4110.  
  4111.  
  4112. ΓòÉΓòÉΓòÉ 43.2.2. Use Browser information ΓòÉΓòÉΓòÉ
  4113.  
  4114. The cascaded menu that Visual Builder displays when you select FileBrowser 
  4115. contains the following selections: 
  4116.  
  4117.  Quick browse 
  4118.    Causes Visual Builder to retrieve a list of the classes that the part you 
  4119.    are editing inherits from, as well as a list of the member functions that 
  4120.    your part and the part it inherits from contains. If you select one of the 
  4121.    classes in the list, Visual Builder retrieves a list of the member functions 
  4122.    that the class contains. 
  4123.  
  4124.    This function is available only if you start Visual Builder from a WorkFrame 
  4125.    project. It gives you access to browser information before you compile your 
  4126.    application. 
  4127.  
  4128.  Open browser data 
  4129.    Works the same as Quick browse except you must compile your application with 
  4130.    the -Fb+ option before using this function. Also, you do not have to start 
  4131.    Visual Builder from a WorkFrame project to use this function. 
  4132.  
  4133.  Refresh browser data 
  4134.    Refreshes the list of the classes that the part you are editing inherits 
  4135.    from, as well as the list that is displayed in the member function list box 
  4136.    for the current class. If you reparse a part or recompile your application, 
  4137.    use this function afterwards to ensure the data in the list boxes is 
  4138.    current. 
  4139.  
  4140.  Close browser data 
  4141.    Removes the list of the classes that the part you are editing inherits from, 
  4142.    as well as the member functions those classes contain. 
  4143.  
  4144.  
  4145. ΓòÉΓòÉΓòÉ 43.3. Add a custom logic connection ΓòÉΓòÉΓòÉ
  4146.  
  4147. The requirements for connecting an event or attribute to custom logic are a 
  4148. visual part that has at least one event or attribute specified for it. 
  4149. Following are the steps to follow for adding a custom logic connection. The 
  4150. following figure shows the History page of the OAContractorView part used in 
  4151. the OASearch sample application in this book. The example used in the following 
  4152. steps is based on this part. 
  4153.  
  4154.    1. Select the right arrow in the lower right corner of the notebook to 
  4155.       display the History page. 
  4156.  
  4157.    2. With the mouse pointer over the Clear push button, hold down the Alt key 
  4158.       and click mouse button 2. 
  4159.  
  4160.       Visual Builder displays the connection menu for the Clear push button. 
  4161.  
  4162.    3. From this menu, select the buttonClickEvent choice, an event. 
  4163.  
  4164.    4. Move the mouse pointer to a point on the free-form surface outside the 
  4165.       OAContractorView part and click mouse button 1. Doing this indicates to 
  4166.       Visual Builder that you want to connect the event to the OAContractorView 
  4167.       part instead of one of its subparts. 
  4168.  
  4169.       Visual Builder displays the connection menu with the preferred features 
  4170.       that have been defined for the OAContractorView part. 
  4171.  
  4172.    5. Select Custom logic. 
  4173.  
  4174.       Visual Builder displays the following window: 
  4175.  
  4176.    6. Enter the following in the Description field: 
  4177.  
  4178.             Custom logic code to clear all entry fields
  4179.  
  4180.    7. The buttonClickEvent feature is the event you want to connect to your 
  4181.       custom logic, so do not change the Event name field for this example. 
  4182.  
  4183.    8. The default return type of void is the return type you want to use, so do 
  4184.       not change the Return type field for this example. 
  4185.  
  4186.    9. Select the Target push button. 
  4187.  
  4188.       Visual Builder inserts target-> in the Custom logic field. 
  4189.  
  4190.       In the generated code, the entry fields that we want to clear are created 
  4191.       using the new operator. For the StartEF part, the resulting pointer is 
  4192.       called iStartEF. 
  4193.  
  4194.   10. Type the following to the right of target->: 
  4195.  
  4196.             iStartEF->removeAll();
  4197.  
  4198.       This code calls the removeAll member function for the StartEF part, the 
  4199.       entry field labeled OA Start Date. 
  4200.  
  4201.   11. Press the Enter key to move the cursor to a new line. 
  4202.  
  4203.   12. Select the Target push button again. 
  4204.  
  4205.   13. Type the following to the right of target->: 
  4206.  
  4207.             iEndEF->removeAll();
  4208.  
  4209.       This code calls the removeAll member function for the EndEF part, the 
  4210.       entry field labeled OA End Date. 
  4211.  
  4212.   14. Press the Enter key to move the cursor to a new line. 
  4213.  
  4214.   15. Select the Target push button again. 
  4215.  
  4216.   16. Type the following to the right of target->: 
  4217.  
  4218.             iContractEF->removeAll();
  4219.       and put the following line beneath it: 
  4220.  
  4221.             return;
  4222.  
  4223.       This code calls the removeAll member function for the ContractEF part, 
  4224.       the entry field labeled Current Contract. 
  4225.  
  4226.       The connection window should now look like the following figure: 
  4227.  
  4228.   17. Select the Add push button. 
  4229.  
  4230.       The connection window disappears and a blue connection arrow is drawn 
  4231.       from the Clear push button toward the edge of the free-form surface. It 
  4232.       should look like this: 
  4233.  
  4234.  
  4235. ΓòÉΓòÉΓòÉ 43.4. Connect exception events to actions and member functions ΓòÉΓòÉΓòÉ
  4236.  
  4237. To connect an exception event, do the following: 
  4238.  
  4239.    1. Use your favorite text editor to create an action or member function that 
  4240.       throws an exception. 
  4241.  
  4242.       The easiest way to do this is to include the following in your action or 
  4243.       member function source code: 
  4244.  
  4245.                   throw IException("Error message.");
  4246.  
  4247.       where the text of the error message that you want to display in the 
  4248.       message box is the only parameter given for the IException constructor. 
  4249.  
  4250.    2. Connect an event to the action or member function you just created. 
  4251.  
  4252.    3. Drop an IMessageBox* part on the free-form surface. 
  4253.  
  4254.       This message box is used to display the error message. 
  4255.  
  4256.    4. Move the mouse pointer to the connection you just made. 
  4257.  
  4258.    5. While holding down the Alt key, press mouse button 2. 
  4259.  
  4260.    6. Select the exceptionOccurred event from the connection menu. 
  4261.  
  4262.    7. Move the mouse pointer to the IMessageBox* part. 
  4263.  
  4264.    8. Click mouse button 1. 
  4265.  
  4266.    9. Select the show action from the connection menu. 
  4267.  
  4268.       This connection causes the application to show a message box that 
  4269.       contains the exception error message whenever the exception is thrown. 
  4270.  
  4271.  For an example using the OAContractorView part from the OASearch application, 
  4272.  see Passing Exceptions to Message Boxes. 
  4273.  
  4274.  
  4275. ΓòÉΓòÉΓòÉ 43.5. Manipulate connections ΓòÉΓòÉΓòÉ
  4276.  
  4277. Once a connection is made, you can manipulate it by doing the following: 
  4278.  
  4279.      Changing settings for a connection 
  4280.  
  4281.      Reordering connections 
  4282.  
  4283.      Deleting connections 
  4284.  
  4285.      Showing and hiding connections 
  4286.  
  4287.  
  4288. ΓòÉΓòÉΓòÉ 43.5.1. Change settings for a connection ΓòÉΓòÉΓòÉ
  4289.  
  4290. To open the settings window for a connection, move the mouse pointer over the 
  4291. connection and do one of the following: 
  4292.  
  4293.      Double-click mouse button 1. 
  4294.  
  4295.      Click mouse button 2 and select Open settings from the connection's 
  4296.       pop-up menu. 
  4297.  
  4298.  
  4299. ΓòÉΓòÉΓòÉ 43.5.2. Reorder connections ΓòÉΓòÉΓòÉ
  4300.  
  4301. If you make several connections from the same part, they run in the order in 
  4302. which you made the connections. To ensure the correct flow of control when you 
  4303. generate the source code, you may need to reorder the connections. If so, do 
  4304. the following: 
  4305.  
  4306.    1. Select the source part. 
  4307.  
  4308.    2. From the source part's pop-up menu, select Reorder Connections From. 
  4309.  
  4310.       Visual Builder displays the Reorder Connections window showing a list of 
  4311.       your connections. 
  4312.  
  4313.    3. With the mouse pointer over the connection you want to reorder, press and 
  4314.       hold mouse button 2. 
  4315.  
  4316.    4. Drag the connection to the place in the list where you want the 
  4317.       connection to occur. 
  4318.  
  4319.    5. Release mouse button 2. 
  4320.  
  4321.    6. Repeat these steps until the connections are listed in the order in which 
  4322.       you want them to occur. 
  4323.  
  4324.    7. Close the window. 
  4325.  
  4326.  
  4327. ΓòÉΓòÉΓòÉ 43.5.3. Delete connections ΓòÉΓòÉΓòÉ
  4328.  
  4329. You can delete a connection in either of the following ways: 
  4330.  
  4331.      From the connection's pop-up menu. 
  4332.  
  4333.       Note:  You do not have to select a connection to delete it using this 
  4334.              method. 
  4335.  
  4336.       To delete a connection from its pop-up menu, do the following: 
  4337.  
  4338.         1. Click on the connection with mouse button 2 to display its pop-up 
  4339.            menu. 
  4340.  
  4341.         2. Select Delete. 
  4342.  
  4343.      From the connection's settings window 
  4344.  
  4345.       To delete a connection from its settings window, do the following: 
  4346.  
  4347.         1. Open the settings window for the connection by doing one of the 
  4348.            following: 
  4349.  
  4350.              -  Double-clicking on the connection 
  4351.  
  4352.              -  Clicking on the connection with mouse button 2 to display its 
  4353.                 pop-up menu and selecting Open Settings 
  4354.  
  4355.         2. Select the Delete push button. 
  4356.  
  4357.  
  4358. ΓòÉΓòÉΓòÉ 43.5.4. Show and hide connections ΓòÉΓòÉΓòÉ
  4359.  
  4360. You can show and hide connections by using , the Hide Connections tool, and , 
  4361. the Show Connections tool on the Tool bar. These tools show or hide all 
  4362. connections that have the selected part or parts as their source or target. If 
  4363. no parts are selected, these tools show or hide all of the connections. 
  4364.  
  4365.            If you hide connections, the Composition Editor free-form surface is 
  4366.            drawn faster and is less cluttered, making it easier for you to 
  4367.            work. 
  4368.  
  4369.  If no parts are selected, these tools show and hide all of the connections in 
  4370.  the view. If a part or parts are selected, these tools show and hide the 
  4371.  connections between the selected part or parts. 
  4372.  
  4373.  Another way to show and hide connections is to move the mouse pointer over a 
  4374.  part, click mouse button 2, and select the Browse Connections choice from the 
  4375.  part's pop-up menu, which displays a cascaded menu. The choices in the menu 
  4376.  affect only connections going to and from the part the mouse pointer was over 
  4377.  when you displayed the pop-up menu. 
  4378.  
  4379.  
  4380. ΓòÉΓòÉΓòÉ 43.6. Rearrange connections ΓòÉΓòÉΓòÉ
  4381.  
  4382. You can rearrange a connection by doing the following: 
  4383.  
  4384.      Selecting connections 
  4385.  
  4386.      Deselecting connections 
  4387.  
  4388.      Changing the source and target of connections 
  4389.  
  4390.  
  4391. ΓòÉΓòÉΓòÉ 43.6.1. Select connections ΓòÉΓòÉΓòÉ
  4392.  
  4393. You select connections in the same way that you select parts. When you select a 
  4394. connection, three boxes called selection handles appear on it to show that it 
  4395. is selected: one at each end and one in the middle. You can use these boxes to 
  4396. change either of the following: 
  4397.  
  4398.      The end points of the connection, as described in Changing the Source and 
  4399.       Target of Connections. 
  4400.  
  4401.      The shape of the connection arrow by dragging the middle box to another 
  4402.       location. This helps you distinguish among several connection lines that 
  4403.       are close together. 
  4404.  
  4405.  Selecting a single connection 
  4406.  
  4407.    1. Move the mouse pointer over the connection you want to select. 
  4408.  
  4409.    2. Click mouse button 1 to select the connection. 
  4410.  
  4411.       The connection is selected. 
  4412.  
  4413.  Selecting multiple connections 
  4414.  
  4415.  If you want to select several connections, do one of the following: 
  4416.  
  4417.      To select multiple connections using just the mouse, do the following: 
  4418.  
  4419.         1. Move the mouse pointer over one of the connections you want to 
  4420.            select. 
  4421.  
  4422.         2. Hold down mouse button 1 instead of clicking it. 
  4423.  
  4424.         3. Move the mouse pointer over each connection that you want to select. 
  4425.  
  4426.            The selection boxes appear on each connection that the mouse pointer 
  4427.            passes over to show they are selected. 
  4428.  
  4429.         4. After the connections are selected, release mouse button 1. 
  4430.  
  4431.      To select multiple connections using both the mouse and the keyboard, do 
  4432.       the following: 
  4433.  
  4434.         1. Hold down the Ctrl key. 
  4435.  
  4436.         2. Move the mouse pointer over a connection. 
  4437.  
  4438.         3. Click mouse button 1 while the mouse pointer is over the connection 
  4439.            line. 
  4440.  
  4441.         4. Without releasing the Ctrl key, repeat the preceding steps until all 
  4442.            connections that you want to select are selected. 
  4443.  
  4444.  
  4445. ΓòÉΓòÉΓòÉ 43.6.2. Deselect connections ΓòÉΓòÉΓòÉ
  4446.  
  4447. If you want to deselect a connection without selecting another part or 
  4448. connection, do the following: 
  4449.  
  4450.    1. Move the mouse pointer over the connection line. 
  4451.  
  4452.    2. Hold down the Ctrl key. 
  4453.  
  4454.    3. Click mouse button 1. 
  4455.  
  4456.  
  4457. ΓòÉΓòÉΓòÉ 43.6.3. Change the source and target of connections ΓòÉΓòÉΓòÉ
  4458.  
  4459. Visual Builder gives you the ability to change what a connection is pointing to 
  4460. (the target) or pointing from (the source). Of course, you could always just 
  4461. delete the connection and create a new one. However, the following steps show 
  4462. you a quicker way to do this. 
  4463.  
  4464. To move either end of a connection, do the following: 
  4465.  
  4466.    1. Select the connection. 
  4467.  
  4468.    2. Move the mouse pointer over either selection handle that appears on the 
  4469.       ends of the connection. 
  4470.  
  4471.    3. Press and hold mouse button 2. 
  4472.  
  4473.    4. Move the mouse pointer to the new part or connection. 
  4474.  
  4475.    5. Release the mouse button. 
  4476.  
  4477.  Depending on the connection type, you may get a pop-up menu asking you for new 
  4478.  information for the connection. 
  4479.  
  4480.  What you can change 
  4481.  
  4482.  You can change the source and target of either end of any connection. However, 
  4483.  depending on the feature that you connect to when you make the change, you 
  4484.  might get a different type of connection than the one you started with. 
  4485.  
  4486.  The following table gives you a closer look at the connection types and what 
  4487.  you can change without changing the connection type: 
  4488.  
  4489.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  4490.   ΓöéConnection type               ΓöéMove either end  ΓöéMove source end  ΓöéMove target end  Γöé
  4491.   Γöéattribute-to-attribute        Γöéx                Γöé                 Γöé                 Γöé
  4492.   Γöéattribute-to-member function  Γöé                 Γöéx                Γöé                 Γöé
  4493.   Γöéattribute-to-action           Γöéx                Γöé                 Γöé                 Γöé
  4494.   Γöéevent-to-action               Γöéx                Γöé                 Γöé                 Γöé
  4495.   Γöéevent-to-attribute            Γöéx                Γöé                 Γöé                 Γöé
  4496.   Γöéevent-to-member function      Γöé                 Γöéx                Γöé                 Γöé
  4497.   Γöécustom logic                  Γöéx                Γöé                 Γöé                 Γöé
  4498.   Γöéparameter connection          Γöéx                Γöé                 Γöé                 Γöé
  4499.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  4500.  
  4501.  
  4502. ΓòÉΓòÉΓòÉ 43.7. Make the connections for the OASearch application ΓòÉΓòÉΓòÉ
  4503.  
  4504. The following sections show you how to connect the parts that were used to 
  4505. create a GUI for the OAContractView part in Constructing a GUI: the OASearch 
  4506. Application 
  4507.  
  4508.      Enabling push buttons when an entry field contains a value 
  4509.  
  4510.      Enabling a window to be cleared of all entry values 
  4511.  
  4512.      Connecting the variable part 
  4513.  
  4514.      Passing exceptions to message boxes 
  4515.  
  4516.  
  4517. ΓòÉΓòÉΓòÉ 43.7.1. Enable push buttons when an entry field contains a value ΓòÉΓòÉΓòÉ
  4518.  
  4519. This section shows you how to make the connections that enable the Refresh and 
  4520. Save push buttons in the OAContractView window. When you have made these 
  4521. connections, the window appears as shown in the following figure: 
  4522.  
  4523. Follow these steps to enable the push buttons: 
  4524.  
  4525.    1. From the Account Number pop-up menu, select Connect. 
  4526.  
  4527.    2. Select text from the list. 
  4528.  
  4529.    3. Click on the Refresh push button. 
  4530.  
  4531.    4. Select enabled from the pop-up menu. 
  4532.  
  4533.    5. Follow the same procedure to connect the text attribute of the Account 
  4534.       Number text part to the enabled attribute of the Save push button part. 
  4535.  
  4536.  
  4537. ΓòÉΓòÉΓòÉ 43.7.2. Enable a window to be cleared of all entry values ΓòÉΓòÉΓòÉ
  4538.  
  4539. You can enable the Clear push button to empty all entry fields of their 
  4540. contents using more than one method. 
  4541.  
  4542. For this example, assume that the member function has been written. Make the 
  4543. connection as follows: 
  4544.  
  4545.    1. From the Composition Editor, use Alt-mouse button 2 to select the 
  4546.       buttonClickEvent of the Clear push button. 
  4547.  
  4548.       The connection spider appears. 
  4549.  
  4550.    2. Use Alt-mouse button 2 to select an empty section of the free-form 
  4551.       surface. 
  4552.  
  4553.    3. Select More from the pop-up menu. 
  4554.  
  4555.    4. Enter the member function declaration in the entry field as shown in the 
  4556.       following figure: 
  4557.  
  4558.    5. Select the OK push button. 
  4559.  
  4560.    6. Switch to the Class Editor. 
  4561.  
  4562.       Include the files containing the member function code. For this example, 
  4563.       the file names are oafwclr.cpv and oafwclr.hpv. 
  4564.  
  4565.         a. In the User .hpv file field, type the name of the header file, 
  4566.            oafwclr.hpv 
  4567.         b. In the User .cpv file field, type the name of the code file, 
  4568.            oafwclr.cpv 
  4569.  
  4570.  For details on the attributes, actions, or events of a particular part, refer 
  4571.  to the Visual Builder Parts Reference. For more information on how to perform 
  4572.  these operations, see Making the Connections. 
  4573.  
  4574.  
  4575. ΓòÉΓòÉΓòÉ 43.7.3. Connect the variable part ΓòÉΓòÉΓòÉ
  4576.  
  4577. Once you have added the variable to the free-form surface and set its name and 
  4578. type, you need to connect it to the OAContractView composite part. 
  4579.  
  4580. Making the attribute-to-attribute connections 
  4581.  
  4582. So that recruiters can display and update contract information held by the 
  4583. Contract variable, you must make attribute-to-attribute connections between the 
  4584. composite visual part and the Contract variable as follows: 
  4585.  
  4586.  From part, feature            To part, feature 
  4587.  
  4588.  Contract,#accountNum          EntryField1,#text 
  4589.  
  4590.  Contract,#companyName         EntryField2,#text 
  4591.  
  4592.  Contract,#projectMgr          EntryField3,#text 
  4593.  
  4594.  Contract,#deptName            EntryField4,#text 
  4595.  
  4596.  Contract,#positionTitle       EntryField5,#text 
  4597.  
  4598.  Contract,#startDate           EntryField6,#text 
  4599.  
  4600.  Contract,#endDate             EntryField7,#text 
  4601.  
  4602.  Contract,#currContractor      EntryField8,#text 
  4603.  
  4604.  So far, the connections appear as shown in the following figure: 
  4605.  
  4606.  Making the event-to-action connections 
  4607.  
  4608.  To enable push buttons on the composite visual part, you must make 
  4609.  event-to-action connections. This is a two-step process, because you specified 
  4610.  an input parameter for each of the data access actions. First, connect each 
  4611.  push button to the Contract variable. The connection line appears dashed, 
  4612.  indicating an incomplete connection. Next, connect the attribute that 
  4613.  represents the input parameter to the event-to-action connection itself. 
  4614.  
  4615.  For this example, make the following connections: 
  4616.  
  4617.  From part, feature                        To part, feature 
  4618.  
  4619.  PushButton1,#buttonClickEvent             Contract,#getContract 
  4620.  
  4621.  EntryField1,#text (Account Number text)   The anAccountNum parameter of the 
  4622.                                            PushButton1,#buttonClickEvent--> 
  4623.                                            Contract,#getContract connection. 
  4624.                                            Visual Builder draws the parameter 
  4625.                                            connection in the opposite 
  4626.                                            direction. 
  4627.  
  4628.  PushButton2,#buttonClickEvent             Contract,#putContract 
  4629.  
  4630.  EntryField1,#text (Account Number text)   The anAccountNum parameter of the 
  4631.                                            PushButton2,#buttonClickEvent--> 
  4632.                                            Contract,#putContract connection. 
  4633.                                            Visual Builder draws the parameter 
  4634.                                            connection in the opposite 
  4635.                                            direction. 
  4636.  
  4637.  The connections now appear as shown in the following figure: 
  4638.  
  4639.  The putContract and getContract actions throw exceptions when the account 
  4640.  number is not found in the database. 
  4641.  
  4642.  The next step is passing the exception to a message box. 
  4643.  
  4644.  
  4645. ΓòÉΓòÉΓòÉ 43.7.4. Pass exceptions to message boxes ΓòÉΓòÉΓòÉ
  4646.  
  4647. You can trigger the display of a message box when an exception is thrown. 
  4648. Although a message box is a user-interface element, Visual Builder treats 
  4649. message boxes as nonvisual parts. 
  4650.  
  4651. Adding the message box 
  4652.  
  4653. To add a message box to the free-form surface, select , the Other category, 
  4654. from the parts palette; then add , an IMessageBox* part, to the free-form 
  4655. surface. 
  4656.  
  4657. Making the connections 
  4658.  
  4659. Now, connect the exceptionOccurred event of each event-to-action connection to 
  4660. the showException action of the message box. 
  4661.  
  4662. The connections appear as shown in the following figure. Save and close your 
  4663. visual part. 
  4664.  
  4665.  
  4666. ΓòÉΓòÉΓòÉ 44. ...Display objects in a list box ΓòÉΓòÉΓòÉ
  4667.  
  4668. The following steps show you how to modify the original To-Do List application 
  4669. to use objects instead of text strings. If you have not already done so, please 
  4670. complete the original application, shown in Creating a Simple Visual Builder 
  4671. Application, before continuing with this example. 
  4672.  
  4673.      Copying the ToDoList part 
  4674.  
  4675.      Creating the ToDoItem nonvisual part 
  4676.  
  4677.      Replacing and modifying the list box 
  4678.  
  4679.      Placing and modifying an IVBFactory* part 
  4680.  
  4681.      Placing and modifying an IVSequence* part 
  4682.  
  4683.      Making the new connections 
  4684.  
  4685.      Generating the source code for your visual part and main() procedure 
  4686.  
  4687.      Building and running the modified application 
  4688.  
  4689.  
  4690. ΓòÉΓòÉΓòÉ 44.1. Copy the ToDoList part ΓòÉΓòÉΓòÉ
  4691.  
  4692. First, you must copy the ToDoList part, as follows: 
  4693.  
  4694.    1. Select todolist.vbb. 
  4695.  
  4696.       Visual Builder displays the name of the ToDoList part in the Visual Parts 
  4697.       list box. 
  4698.  
  4699.    2. Select the ToDoList part. 
  4700.  
  4701.    3. Select PartCopy. 
  4702.  
  4703.       Visual Builder displays the Copy Part window. 
  4704.  
  4705.    4. Enter ToDoLst2 in the Target part name field. 
  4706.  
  4707.    5. Enter todolst2.vbb in the Target file name field. 
  4708.  
  4709.    6. Select the Copy push button. 
  4710.  
  4711.       Visual Builder creates a copy of the ToDoList part, gives it the name 
  4712.       ToDoLst2, and stores it in the todolst2.vbb file. 
  4713.  
  4714.  
  4715. ΓòÉΓòÉΓòÉ 44.2. Create the ToDoItem nonvisual part ΓòÉΓòÉΓòÉ
  4716.  
  4717. The next step is to create a nonvisual part called ToDoItem, as follows: 
  4718.  
  4719.    1. Open a new nonvisual part by doing the following: 
  4720.  
  4721.         a. In the Visual Builder window, select PartNew. 
  4722.  
  4723.            Visual Builder displays the Part - New window. 
  4724.  
  4725.         b. Fill in the fields in this window as follows. 
  4726.  
  4727.            Class name         ToDoItem 
  4728.  
  4729.            Description        Type of objects in To-Do List 
  4730.  
  4731.            File name          ToDoLst2.vbb 
  4732.  
  4733.            Part type          Nonvisual part 
  4734.  
  4735.            Base class         IStandardNotifier 
  4736.  
  4737.         c. Select the Open push button. 
  4738.  
  4739.            Visual Builder displays the Part Interface Editor. 
  4740.  
  4741.    2. Create a new attribute called toDoItemName by doing the following: 
  4742.  
  4743.         a. On the Attribute page, fill in the following fields: 
  4744.  
  4745.            Attribute name        toDoItemName 
  4746.  
  4747.            Attribute type        IString 
  4748.  
  4749.         b. Select the Add with defaults push button. 
  4750.  
  4751.            Visual Builder adds the toDoItemName attribute to the ToDoItem part. 
  4752.  
  4753.                      You can add the toDoItemName attribute to the preferred 
  4754.                      features list so that it will be readily available for 
  4755.                      making connections by doing the following: 
  4756.                        a. Switch to the Part Interface Editor. 
  4757.  
  4758.                        b. Select the Preferred page. 
  4759.  
  4760.                        c. Scroll down the list of attributes until you find the 
  4761.                           toDoItemName attribute and select it. 
  4762.  
  4763.                        d. Select the Add>> push button. 
  4764.  
  4765.                           Visual Builder adds the toDoItemName attribute to the 
  4766.                           list of preferred features so that it will appear in 
  4767.                           the pop-up connection menu. 
  4768.  
  4769.    3. Specify the .hpv and .cpv files for Visual Builder to use for the default 
  4770.       feature code for the toDoItemName attribute by doing the following: 
  4771.  
  4772.         a. Switch to the Class Editor if you followed the steps in the 
  4773.            preceding hint. 
  4774.  
  4775.         b. Fill in the following fields: 
  4776.  
  4777.            User .hpv file        ToDoItem.hpv 
  4778.  
  4779.            User .cpv file        ToDoItem.cpv 
  4780.  
  4781.    4. Generate the default source and feature code for the ToDoItem part by 
  4782.       doing the following: 
  4783.  
  4784.         a. Select FileSave and generatePart source. 
  4785.  
  4786.            Visual Builder generates the code for the ToDoItem part and stores 
  4787.            it in files named ToDoItem.hpp and ToDoItem.cpp. These files contain 
  4788.            the appropriate include statements for the ToDoItem.hpv and 
  4789.            ToDoItem.cpv files. 
  4790.  
  4791.         b. Select FileSave and generateFeature source 
  4792.  
  4793.            Visual Builder generates the default code for the toDoItemName 
  4794.            attribute and stores it in the ToDoItem.hpv and ToDoItem.cpv files. 
  4795.  
  4796.    5. Override the asString member function in the IVBase* part by doing the 
  4797.       following: 
  4798.  
  4799.         a. Using your favorite text editor, edit the ToDoItem.hpv file and 
  4800.            insert the following at the bottom of the public section: 
  4801.  
  4802.                         IString ToDoItem :: asString () const;
  4803.  
  4804.         b. Save the file. 
  4805.  
  4806.         c. Edit the ToDoItem.cpv file and insert the following at the bottom of 
  4807.            the file: 
  4808.  
  4809.                       IString ToDoItem :: asString () const
  4810.                       {
  4811.                         return toDoItemName();
  4812.                       }
  4813.  
  4814.         d. Save the file and close the text editor. 
  4815.  
  4816.    6. Close the Part Interface Editor. 
  4817.  
  4818.  The ToDoItem part is now completed. 
  4819.  
  4820.  
  4821. ΓòÉΓòÉΓòÉ 44.3. Replace and modify the list box ΓòÉΓòÉΓòÉ
  4822.  
  4823. You need a list box that can display objects instead of just text strings, so 
  4824. next you must replace the IListBox* part with an ICollectionViewListBox* part, 
  4825. and then modify the ICollectionViewListBox* part to specify the type of objects 
  4826. it can display. 
  4827.  
  4828. Replacing IListBox* with ICollectionViewListBox* 
  4829.  
  4830.    1. Open the ToDoLst2 part. 
  4831.  
  4832.    2. Delete the IListBox* part. 
  4833.  
  4834.       The IListBox* part only accepts strings. You want a part that accepts 
  4835.       objects. 
  4836.  
  4837.       Visual Builder displays a message warning you that it will delete the 
  4838.       connections as well as the list box if you continue. You want to delete 
  4839.       the connections because you need different connections for this example. 
  4840.  
  4841.    3. Select the OK push button. 
  4842.  
  4843.       Visual Builder deletes the list box and the connections. 
  4844.  
  4845.    4. Select , the Lists category, from the row of icons on the left-hand side 
  4846.       of the parts palette. 
  4847.  
  4848.    5. Select , the ICollectionViewListBox* icon, from the row of icons that 
  4849.       Visual Builder displays on the right-hand side of the parts palette. 
  4850.  
  4851.    6. Place the crosshairs below the bottom left corner of the second static 
  4852.       text part and click mouse button 1. 
  4853.  
  4854.       A list box part that displays the items in a collection is placed beneath 
  4855.       the second static text part. 
  4856.  
  4857.  Specifying the type of items the list box can contain 
  4858.  
  4859.    1. Move the mouse pointer to the list box, click mouse button 2, and select 
  4860.       Open Settings. 
  4861.  
  4862.       Visual Builder displays the settings notebook for the list box. 
  4863.  
  4864.    2. Enter ToDoItem* in the Class name of items field. 
  4865.  
  4866.    3. Select the OK push button. 
  4867.  
  4868.       The list box can now accept only ToDoItem* objects. 
  4869.  
  4870.  
  4871. ΓòÉΓòÉΓòÉ 44.4. Place and modify an IVBFactory* part ΓòÉΓòÉΓòÉ
  4872.  
  4873. You need an IVBFactory* part to create the objects to be displayed in the list 
  4874. box. In addition, you must specify the type of objects the IVBFactory* part can 
  4875. create. 
  4876.  
  4877. Placing an IVBFactory* part on the free-form surface 
  4878.  
  4879.    1. Select , the Models category, from the row of icons on the left-hand side 
  4880.       of the parts palette. 
  4881.  
  4882.    2. Select , the IVBFactory* icon, from the row of icons that Visual Builder 
  4883.       displays on the right-hand side of the parts palette. 
  4884.  
  4885.    3. Place an object factory part on the free-form surface to the right of the 
  4886.       To-Do List window adjacent to the entry field. 
  4887.  
  4888.    4. Change the text beneath the object factory icon to ItemFactory. 
  4889.  
  4890.  Specifying the type of objects the object factory can create 
  4891.  
  4892.    1. Move the mouse pointer to the object factory, click mouse button 2, and 
  4893.       select Change Type. 
  4894.  
  4895.       Visual Builder displays a window in which you are to enter the type of 
  4896.       objects that the object factory is to create. 
  4897.  
  4898.    2. Enter ToDoItem* in the entry field in this window. 
  4899.  
  4900.    3. Select the OK push button. 
  4901.  
  4902.       The object factory can now create only ToDoItem objects. 
  4903.  
  4904.  
  4905. ΓòÉΓòÉΓòÉ 44.5. Place and modify an IVSequence* part ΓòÉΓòÉΓòÉ
  4906.  
  4907. You also need to place an IVSequence* part to put the objects that the 
  4908. IVBFactory* part creates into a sequence; you must also specify the type of 
  4909. objects the sequence can contain. 
  4910.  
  4911. Placing an IVSequence* part on the free-form surface 
  4912.  
  4913.    1. Select OptionsAdd part. 
  4914.  
  4915.       Visual Builder displays the Add part window. 
  4916.  
  4917.    2. Enter ItemSequence in the Name field. 
  4918.  
  4919.    3. Enter IVSequence* in the Part class field. 
  4920.  
  4921.    4. Select the Add push button. 
  4922.  
  4923.    5. Place an IVSequence* part on the free-form surface surface to the right 
  4924.       of the To-Do List window adjacent to the list box. 
  4925.  
  4926.  Specifying the type of objects in the sequence 
  4927.  
  4928.    1. Move the mouse pointer to the sequence, click mouse button 2, and select 
  4929.       Open Settings. 
  4930.  
  4931.       Visual Builder displays the settings notebook for the sequence. 
  4932.  
  4933.    2. Enter ToDoItem* in the Class name of items field. 
  4934.  
  4935.    3. Select the OK push button. 
  4936.  
  4937.       The sequence can now accept only ToDoItem objects. 
  4938.  
  4939.  
  4940. ΓòÉΓòÉΓòÉ 44.6. Make the new connections ΓòÉΓòÉΓòÉ
  4941.  
  4942. The following steps describe the connections that this example requires to add 
  4943. objects to and remove objects from the list box. To review the instructions for 
  4944. connecting features, see Making the Connections. 
  4945.  
  4946.    1. Connect the buttonClickEvent feature of the Add push button to the new 
  4947.       action of the object factory. 
  4948.  
  4949.       This connection causes the object factory to create a new ToDoItem object 
  4950.       whenever a user clicks the Add push button. 
  4951.  
  4952.    2. Connect the toDoItemName attribute of the object factory to the text 
  4953.       attribute of the entry field. 
  4954.  
  4955.       This connection causes text in the entry field to be used as the name of 
  4956.       ToDoItem objects that the object factory creates. Notice that the 
  4957.       connection line is violet, the color of a parameter connection, instead 
  4958.       of cyan, which is the color of an attribute-to-attribute connection. The 
  4959.       connection line is violet because the text attribute of the entry field 
  4960.       supplies a value for the toDoItemName attribute only when the object 
  4961.       factory creates a new object, just as if it were satisfying a parameter 
  4962.       of the new action. 
  4963.  
  4964.    3. Connect the newEvent attribute of the object factory to the addAsLast 
  4965.       action of the sequence. 
  4966.  
  4967.       This connection causes each new ToDoItem object to be added as the last 
  4968.       object in the sequence. 
  4969.  
  4970.    4. Connect the this attribute of the sequence to the items attribute of the 
  4971.       list box. 
  4972.  
  4973.       This connection causes the list box to display all of the ToDoItem 
  4974.       objects that the sequence contains. 
  4975.  
  4976.    5. Connect the buttonClickEvent feature of the Remove push button to the 
  4977.       removeAtPosition action of the sequence. 
  4978.  
  4979.       This connection causes the object at a specified position in the sequence 
  4980.       to be removed. This connection is incomplete because the removeAtPosition 
  4981.       action's position parameter must be satisfied. 
  4982.  
  4983.    6. Connect the position parameter of the previous connection to the 
  4984.       selectedCollectionPosition attribute of the list box. 
  4985.  
  4986.       This connection provides the position of the selected item in the 
  4987.       collection of objects, which is required by the previous connection in 
  4988.       order to remove an object. 
  4989.  
  4990.  
  4991. ΓòÉΓòÉΓòÉ 44.7. Generate the source code for my visual part and main() procedure ΓòÉΓòÉΓòÉ
  4992.  
  4993. To generate the C++ source code for your visual part, select FileSave and 
  4994. GeneratePart source. Visual Builder generates the following files in the 
  4995. working directory: 
  4996.  
  4997.  todolst2.cpp   The C++ code for your todolst2 part. 
  4998.  todolst2.hpp   The C++ header file for your todolst2 part. 
  4999.  todolst2.h     The resource header file for your todolst2.cpp file. 
  5000.  todolst2.rc    The resource file for your todolst2.cpp file. 
  5001.  
  5002.  Generating the source code for your main() procedure 
  5003.  
  5004.  To generate the source code for your main() procedure, select FileSave and 
  5005.  Generatemain() for part. Visual Builder generates the following files in the 
  5006.  working directory: 
  5007.  
  5008.  todolst2.app   The main function for your application. 
  5009.  
  5010.                 Note:  If you start Visual Builder from a WorkFrame project, 
  5011.                        the name of this file is vbmain.cpp. 
  5012.  todolst2.mak   The make file that you specify when you build your application. 
  5013.  
  5014.                 Note:  You must select OptionsGenerate make files in the 
  5015.                        Visual Builder window to generate this file. 
  5016.  
  5017.  
  5018. ΓòÉΓòÉΓòÉ 44.8. Build and run the modified application ΓòÉΓòÉΓòÉ
  5019.  
  5020. You should now be ready to build and run your modified To-Do List application, 
  5021. as follows: 
  5022.  
  5023. Building the new To-Do List application 
  5024.  
  5025.    1. Open an OS/2 window. 
  5026.  
  5027.    2. Change to your Visual Builder working directory. 
  5028.  
  5029.    3. Enter the following command: 
  5030.  
  5031.             nmake todolst2.mak
  5032.  
  5033.       This command produces the following files: 
  5034.  
  5035.       todolst2.exe        The executable file for your application. 
  5036.       todolst2.map        The application configuration map. 
  5037.       todolst2.o          The object file for your application. 
  5038.  
  5039.                           Note:  If you start Visual Builder from a WorkFrame 
  5040.                                  project, the name of this file is vbmain.obj. 
  5041.       todolst2.obj        The object file for your part. Visual Builder 
  5042.                           provides a separate object module for your part that 
  5043.                           is used when compiling this part with other parts. 
  5044.       todolst2.res        The binary resource file that is bound to 
  5045.                           todolst2.exe. 
  5046.  
  5047.  Running the new To-Do List application 
  5048.  
  5049.  To run your application from the same OS/2 command prompt from which you 
  5050.  entered the nmake command, enter the following: 
  5051.  
  5052.   todolst2
  5053.  
  5054.  Once your application is running, experiment with it to make sure it works as 
  5055.  you designed it. That is all there is to it! 
  5056.  
  5057.  You can add a finishing touch to your application by creating an OS/2 program 
  5058.  object. Create a program object from the OS/2 Templates folder, specifying the 
  5059.  name todolst2.exe as the program name and the directory that contains 
  5060.  todolst2.exe as the working directory. Once you have done this, you can run 
  5061.  your application by simply double-clicking on the program object you just 
  5062.  created. 
  5063.  
  5064.  
  5065. ΓòÉΓòÉΓòÉ 45. ...Create resizable windows ΓòÉΓòÉΓòÉ
  5066.  
  5067.      Adding a multicell canvas 
  5068.  
  5069.      Adding parts to the multicell canvas 
  5070.  
  5071.      Changing the multicell canvas grid 
  5072.  
  5073.      Extending a part to span more than one cell 
  5074.  
  5075.      Adding a group box 
  5076.  
  5077.      Changing the settings for a multicell canvas 
  5078.  
  5079.  
  5080. ΓòÉΓòÉΓòÉ 45.1. Add a multicell canvas ΓòÉΓòÉΓòÉ
  5081.  
  5082. This example is based on OAContractView, found in oawin.vbb. 
  5083.  
  5084.    1. Because you are constructing a new user interface, begin by creating a 
  5085.       visual part. Call it contractView. 
  5086.  
  5087.       When you create a visual part, the Composition Editor opens and an 
  5088.       IFrameWindow* part is automatically added for you. By default, the client 
  5089.       area of the IFrameWindow* part appears as a canvas. 
  5090.  
  5091.    2. Delete the default canvas client. 
  5092.  
  5093.    3. Select , the Composers category, from the left side of the parts palette. 
  5094.  
  5095.    4. Select , the IMultiCellCanvas* part, from the right side of the parts 
  5096.       palette and drop it on the IFrameWindow* part. 
  5097.  
  5098.  Your visual part now looks like the following figure: 
  5099.  
  5100.  The next step is adding parts to the multicell canvas. 
  5101.  
  5102.  
  5103. ΓòÉΓòÉΓòÉ 45.2. Add parts to the multicell canvas ΓòÉΓòÉΓòÉ
  5104.  
  5105. When you first drop a multicell canvas, the cell grid appears at its default 
  5106. size in the upper-left corner of the client area. You can now drop parts into 
  5107. the canvas. For the contractView example, do the following: 
  5108.  
  5109.    1. Select , the Data Entry category, from the left side of the parts 
  5110.       palette. 
  5111.  
  5112.    2. Select , the IStaticText* part, from the right side of the parts palette. 
  5113.       When you move the mouse pointer over the free-form surface, the pointer 
  5114.       changes to crosshairs. 
  5115.  
  5116.    3. Drop the part at cell (2,2) of the multicell canvas. 
  5117.  
  5118.       Row 1 was left as a spacer between the top of the multicell canvas and 
  5119.       the window border. When you drop the IStaticText* part, cell (2,2) 
  5120.       expands to contain the dropped part. The multicell canvas now looks like 
  5121.       the following figure: 
  5122.  
  5123.    4. Drop another IStaticText* part at cell (4,2), leaving row 3 as a spacer. 
  5124.       The multicell canvas now looks like the following figure: 
  5125.  
  5126.    5. Drop two more IStaticText* parts into the expansion area below the 
  5127.       StaticText2 part. 
  5128.  
  5129.       Each time you drop a part into the expansion area, a new row is created 
  5130.       for you. 
  5131.  
  5132.    6. Drop three more IStaticText* parts in column 3 as shown in the following 
  5133.       figure: 
  5134.  
  5135.       No spacer rows exist yet between these new rows. We will add these in 
  5136.       Adding Rows or Columns. Now add some IEntryField* parts. 
  5137.  
  5138.    7. Select , the Data Entry category, from the left side of the parts 
  5139.       palette. 
  5140.  
  5141.    8. Select , the IEntryField* part, from the right side of the parts palette. 
  5142.  
  5143.    9. Drop IEntryField* parts in the expansion area to the right of the 
  5144.       IStaticText* parts, starting at row 2. A new column 6 is created, as 
  5145.       shown in the following figure: 
  5146.  
  5147.  
  5148. ΓòÉΓòÉΓòÉ 45.3. Change the multicell canvas grid ΓòÉΓòÉΓòÉ
  5149.  
  5150. You can add or delete rows or columns from a multicell canvas as follows: 
  5151.  
  5152.      To add rows or columns from the expansion area, you can just drop parts 
  5153.       into it, as discussed in Adding Parts to the Multicell Canvas. 
  5154.  
  5155.      To add several rows or columns at a time, you might find it easiest to 
  5156.       change the grid using the multicell canvas's settings notebook. This 
  5157.       method is discussed in Changing the Multicell Canvas Grid Using the 
  5158.       Settings Notebook. 
  5159.  
  5160.      With the multicell canvas selected, you can press mouse button 2 and use 
  5161.       the contextual menu. For more information on this method, see the 
  5162.       following: 
  5163.  
  5164.         -  Adding Rows or Columns Using the Contextual Menu 
  5165.  
  5166.         -  Deleting Rows or Columns Using the Contextual Menu 
  5167.  
  5168.  
  5169. ΓòÉΓòÉΓòÉ 45.3.1. Add rows or columns using the contextual menu ΓòÉΓòÉΓòÉ
  5170.  
  5171. You can add rows or columns anywhere on the multicell canvas as follows: 
  5172.  
  5173.    1. Select a cell next to where you want to add the row or column. 
  5174.  
  5175.       Note:  No selection handles are shown on the cell if it is empty. Also, 
  5176.              you can only open the contextual menu for an empty cell. 
  5177.  
  5178.    2. Press mouse button 2 to open the contextual menu. 
  5179.  
  5180.    3. To add a row, select Rows. To add a column, select Columns. 
  5181.  
  5182.       A cascade menu appears. 
  5183.  
  5184.    4. If you want to insert the row above the cell you selected, select Add row 
  5185.       before from the cascade menu. 
  5186.  
  5187.       If you want to insert the row below the cell you selected, select Add row 
  5188.       after from the cascade menu. 
  5189.  
  5190.       For columns, Add column before inserts a column to the right of the 
  5191.       selected cell. Add column after inserts a column to the left of the 
  5192.       selected cell. 
  5193.  
  5194.  For practice, add spacer rows to the contractView example as follows: 
  5195.  
  5196.    1. Select the empty cell to the left of StaticText3.  Add a row after it. 
  5197.  
  5198.    2. Add one row each after StaticText4 through StaticText7. 
  5199.  
  5200.  At this point, the contractView window looks like the following figure: 
  5201.  
  5202.  
  5203. ΓòÉΓòÉΓòÉ 45.3.2. Delete rows or columns using the contextual menu ΓòÉΓòÉΓòÉ
  5204.  
  5205. You can delete rows or columns from anywhere on the multicell canvas as 
  5206. follows: 
  5207.  
  5208.    1. Select a cell in the row or column you want to delete. 
  5209.  
  5210.    2. Press mouse button 2 to open the contextual menu. 
  5211.  
  5212.    3. To delete the row, select Rows. Then select Delete row. 
  5213.  
  5214.       To delete the column, select Columns. Then select Delete column. 
  5215.  
  5216.  
  5217. ΓòÉΓòÉΓòÉ 45.4. Extend a part to span more than one cell ΓòÉΓòÉΓòÉ
  5218.  
  5219. Build a deck of push buttons using an ISetCanvas* part as a base, as follows: 
  5220.  
  5221.    1. Drop an ISetCanvas* part in the bottom expansion area of column 2. 
  5222.  
  5223.    2. Extend the span of the ISetCanvas* as follows: 
  5224.  
  5225.         a. Select the ISetCanvas* part. 
  5226.  
  5227.         b. Holding the Alt key with one hand, drag either right-hand part 
  5228.            handle over to the column that contains the IEntryField* parts. 
  5229.  
  5230.         c. Release the mouse. 
  5231.  
  5232.    3. Add three IPushButton* parts to the ISetCanvas* part. 
  5233.  
  5234.       The ISetCanvas* and multicell canvas parts expand to contain the newly 
  5235.       dropped IPushButton* parts. 
  5236.  
  5237.                      To change the way minimum size is calculated for the 
  5238.                      IPushButton* parts, edit Pack Type settings for the 
  5239.                      ISetCanvas* part. 
  5240.  
  5241.    4. Edit the IStaticText* parts so that they appear as shown in the following 
  5242.       figure: Extend each column 2 IStaticText* part into column 3. 
  5243.  
  5244.  
  5245. ΓòÉΓòÉΓòÉ 45.5. Add a group box ΓòÉΓòÉΓòÉ
  5246.  
  5247. In the contractView sample, the column 3 IStaticText* parts and their entry 
  5248. fields belong to the Position Details group shown in the following figure: 
  5249.  
  5250. The group box will extend from cell (10,2) to cell (18,8). 
  5251.  
  5252. Adding the extra rows and columns to hold the group box 
  5253.  
  5254. Extra cells are necessary to hold the group box and provide space between the 
  5255. group box and the parts within it. 
  5256.  
  5257.    1. Add 2 rows above Title. 
  5258.  
  5259.    2. Add 2 rows after Contractor. 
  5260.  
  5261.    3. Add 2 columns after the corresponding IEntryField* parts. 
  5262.  
  5263.  The sample window now looks like the following figure: 
  5264.  
  5265.  Dropping and extending the group box 
  5266.  
  5267.    1. Select , the Data Entry category, from the left side of the parts 
  5268.       palette. 
  5269.  
  5270.    2. Select , the IGroupBox* part, from the right side of the parts palette. 
  5271.  
  5272.    3. Drop the IGroupBox* part into cell (10,2). 
  5273.  
  5274.       This temporarily distorts the multicell canvas. Resize the IFrameWindow* 
  5275.       part to see the extra columns on the right. 
  5276.  
  5277.    4. Select the IGroupBox* part. Holding the Alt key with 1 hand, drag the 
  5278.       lower right part handle to cell (18,8) as shown in the following figure: 
  5279.  
  5280.       If necessary, press Alt-Backspace to undo and retry. Edit the IGroupBox* 
  5281.       text to read Position Details. Remember to move the IGroupBox* part up in 
  5282.       the tabbing and depth order. 
  5283.  
  5284.  
  5285. ΓòÉΓòÉΓòÉ 45.6. Change the settings for a multicell canvas ΓòÉΓòÉΓòÉ
  5286.  
  5287. You can use the General page of the multicell canvas settings notebook to do 
  5288. the following: 
  5289.  
  5290.      Move a dropped part 
  5291.  
  5292.      Change the default minimum size for rows or columns 
  5293.  
  5294.      Add rows or columns 
  5295.  
  5296.      Delete rows or columns 
  5297.  
  5298.      Make fixed rows and columns expandable 
  5299.  
  5300.  This page consists of a series of directly editable tables. 
  5301.  
  5302.  
  5303. ΓòÉΓòÉΓòÉ 45.6.1. Move dropped parts ΓòÉΓòÉΓòÉ
  5304.  
  5305. From the free-form surface, you can move dropped parts by selecting and 
  5306. dragging them to their new locations. You can also move dropped parts between 
  5307. cells in a multicell canvas using the settings notebook as follows: 
  5308.  
  5309.    1. Open settings for the multicell canvas. 
  5310.  
  5311.    2. At the top of the General page is a scrollable list of all parts 
  5312.       contained in the multicell canvas as shown in the following figure: 
  5313.  
  5314.    3. Select the table entry you want to change and edit the highlighted value. 
  5315.       Row and column numbering starts from (1,1) in the upper-left corner of 
  5316.       the multicell canvas. 
  5317.  
  5318.    4. Select the OK push button to close settings. 
  5319.  
  5320.  Use this table for reference whenever you edit row and column settings. 
  5321.  
  5322.  
  5323. ΓòÉΓòÉΓòÉ 45.6.2. Change default minimum size for rows or columns ΓòÉΓòÉΓòÉ
  5324.  
  5325. You can change the minimum size of a row or column when it is empty. As stated 
  5326. previously, the default minimum size is 10 pixels wide (columns) and 10 pixels 
  5327. high (rows), but you can change the default minimum size for individual rows 
  5328. and columns as follows: 
  5329.  
  5330.    1. Open settings for the multicell canvas. 
  5331.  
  5332.    2. The second table on the General settings page is called Rows, as shown in 
  5333.       the following figure: 
  5334.  
  5335.    3. The default height appears as nil. To change the minimum height for row 
  5336.       1, select the Row 1 table entry under Height. Change this to the new 
  5337.       default value in pixels. For example, the minimum height of row 1 in most 
  5338.       views of the OASearch sample application is 20. 
  5339.  
  5340.    4. Scroll down the General page a little more to see the third table on the 
  5341.       page, called Columns. You can edit values in this table in the same way 
  5342.       you edited the Rows table. 
  5343.  
  5344.    5. Select the OK push button to close settings. 
  5345.  
  5346.  
  5347. ΓòÉΓòÉΓòÉ 45.6.3. Add rows or columns using the settings notebook ΓòÉΓòÉΓòÉ
  5348.  
  5349. To save time when adding more than one row or column at a time, use the 
  5350. settings notebook. The methods for adding rows and columns are similar, as 
  5351. follows: 
  5352.  
  5353.    1. Open settings for the multicell canvas. The tables on the General page 
  5354.       are described in Moving Dropped Parts and Changing Default Minimum Size 
  5355.       for Rows or Columns 
  5356.  
  5357.    2. If necessary, scroll down to the Rows table. For a complex layout, 
  5358.       consider resizing the window so that the Controls table is also 
  5359.       displayed. 
  5360.  
  5361.    3. Select the number of a row next to the insertion point. Select the Add 
  5362.       push button. 
  5363.  
  5364.    4. Select either Add before or Add after. 
  5365.  
  5366.           Add before inserts the new row above the selected row. 
  5367.           Add after inserts the new row below the selected row. 
  5368.  
  5369.    5. Select the OK push button to close settings. 
  5370.  
  5371.  
  5372. ΓòÉΓòÉΓòÉ 45.6.4. Delete rows or columns using the settings notebook ΓòÉΓòÉΓòÉ
  5373.  
  5374. To save time when deleting more than one row or column at a time, use the 
  5375. settings notebook. The methods for deleting rows and columns are similar, as 
  5376. follows: 
  5377.  
  5378.    1. Open settings for the multicell canvas. The tables on the General page 
  5379.       are described in Moving Dropped Parts and Changing Default Minimum Size 
  5380.       for Rows or Columns 
  5381.  
  5382.    2. If necessary, scroll down to the Rows table. For a complex layout, 
  5383.       consider resizing the window so that the Controls table is also 
  5384.       displayed. 
  5385.  
  5386.    3. Select the number of the row you want deleted. Select the Delete push 
  5387.       button. 
  5388.  
  5389.    4. Select the OK push button to close settings. 
  5390.  
  5391.  
  5392. ΓòÉΓòÉΓòÉ 45.6.5. Make rows or columns expandable ΓòÉΓòÉΓòÉ
  5393.  
  5394. The methods for making rows and columns expandable are similar, as follows: 
  5395.  
  5396.    1. Open settings for the multicell canvas. The tables on the General page 
  5397.       are described in Moving Dropped Parts and Changing Default Minimum Size 
  5398.       for Rows or Columns 
  5399.  
  5400.    2. If necessary, scroll down to the Rows table. For a complex layout, 
  5401.       consider resizing the window so that the Controls table is also 
  5402.       displayed. 
  5403.  
  5404.    3. The default expansion value appears as nil. Select the appropriate entry 
  5405.       from the Rows table under Expand. For the contractView example, select 
  5406.       the row 19 entry. 
  5407.  
  5408.    4. The value d is highlighted. Change it to y and select the Apply push 
  5409.       button. 
  5410.  
  5411.    5. Move the settings notebook window over so you can see the result of your 
  5412.       work, as shown in the following figure: 
  5413.  
  5414.       The expansion area is now hidden. All extra vertical space becomes part 
  5415.       of row 19. 
  5416.  
  5417.    6. When you are finished adjusting row and column expansion settings, select 
  5418.       the OK push button. 
  5419.  
  5420.  To make this row fixed later, enter n in the Expand column. 
  5421.  
  5422.  
  5423. ΓòÉΓòÉΓòÉ 46. ...Construct containers and notebooks ΓòÉΓòÉΓòÉ
  5424.  
  5425.      Adding container parts 
  5426.  
  5427.         -  Setting up the container 
  5428.  
  5429.         -  Adding container columns 
  5430.  
  5431.         -  Filling the container 
  5432.  
  5433.      Adding notebook parts 
  5434.  
  5435.         -  Adding the notebook 
  5436.  
  5437.         -  Adding notebook pages 
  5438.  
  5439.  
  5440. ΓòÉΓòÉΓòÉ 46.1. Add container parts ΓòÉΓòÉΓòÉ
  5441.  
  5442. In this section, you set up a container in the OASkillView part to hold the 
  5443. OASkill* objects returned as a result of a user's skill query. The completed 
  5444. window looks like the following figure: 
  5445.  
  5446. This example is based on the OASkillView* part, found in oawin.vbb. Before 
  5447. constructing this new visual part, make sure that oanonvis.vbb is loaded into 
  5448. Visual Builder. 
  5449.  
  5450.    1. Create a new visual part and name it OASkillView. 
  5451.  
  5452.       A frame window and default canvas appear. 
  5453.  
  5454.    2. Select , the Lists category, from the left side of the parts palette. 
  5455.  
  5456.    3. Select , the IVBContainerControl* part, from the right side of the parts 
  5457.       palette and drop the part onto the default canvas. 
  5458.  
  5459.    4. Change the container's name to SkillCnr. 
  5460.  
  5461.    5. Resize the container part as needed. 
  5462.  
  5463.  The next step is Setting Up the Container. 
  5464.  
  5465.  
  5466. ΓòÉΓòÉΓòÉ 46.1.1. Set up the container ΓòÉΓòÉΓòÉ
  5467.  
  5468. You set some container values in the container part and some in the container 
  5469. column part. Set the following values in the container part: 
  5470.  
  5471.      Title and title format 
  5472.      View style 
  5473.      Type of contained objects 
  5474.  
  5475.  Set the following values in the container column parts: 
  5476.  
  5477.      Column title and width 
  5478.      Attribute to appear in the column 
  5479.      Vertical and horizontal separators 
  5480.      Whether contents can be changed by the user 
  5481.  Adding Container Columns. 
  5482.  
  5483.  Setting the container titles 
  5484.  
  5485.    1. Open the settings notebook for SkillCnr. 
  5486.  
  5487.    2. Specify the general settings. In the Title Attributes group, type 
  5488.       Contractors Holding This Skill into the Title field. 
  5489.  
  5490.    3. Select both Show title and Show title separator. 
  5491.  
  5492.    4. Select the Left radio button for left title alignment. 
  5493.  
  5494.  Specifying the container type and layout 
  5495.  
  5496.    1. Select showDetailsView from the View type list box. 
  5497.  
  5498.    2. Scroll down on the General page. In the Container Item Attributes group, 
  5499.       type OASkill into the Part type field. 
  5500.  
  5501.    3. Select contractorID from the Text drop-down combination box. The Text 
  5502.       field specifies which OASkill attribute would appear as text in the 
  5503.       container's icon view. 
  5504.  
  5505.    4. The Icon field specifies the icon to be used for each item in the 
  5506.       container. Type the following into the Icon field: 
  5507.  
  5508.             #IDynamicLinkLibrary("cppov33r").loadIcon(803)
  5509.  
  5510.       cppov33r.dll is the resource DLL containing the icons for this 
  5511.       application, and 803 is the resource ID for the skill icon that would 
  5512.       appear in the container's icon view. 
  5513.  
  5514.    5. Select the Refresh container after changes check box. 
  5515.  
  5516.    6. Select the OK push button to save and close the settings notebook. 
  5517.  
  5518.  
  5519. ΓòÉΓòÉΓòÉ 46.1.2. Add container columns ΓòÉΓòÉΓòÉ
  5520.  
  5521. Once you have added a container, add container columns. This is a good idea 
  5522. even if you intend for the container to be used mainly as an icon view. 
  5523.  
  5524.    1. Select , the Lists category, from the parts palette. 
  5525.  
  5526.    2. Select the Sticky check box. 
  5527.  
  5528.    3. Select , the IContainerColumn* part, from the parts palette. 
  5529.  
  5530.    4. Drop two IContainerColumn* parts on the SkillCnr part. 
  5531.  
  5532.  Setting up the container columns 
  5533.  
  5534.    1. Open up the settings notebook for the first container column. 
  5535.  
  5536.    2. On the General settings page, type Contractor ID in the Heading text 
  5537.       field. 
  5538.  
  5539.    3. Specify the column's width (in pixels) in the Width field. For this 
  5540.       example, enter 200. 
  5541.  
  5542.    4. Specify the OASkill attribute to appear in this column. Select the Use 
  5543.       the Text attribute set in the container radio button because you want to 
  5544.       display the same information in this container column that the container 
  5545.       displays as text on the icon view. 
  5546.  
  5547.    5. Set the container so that its elements cannot be changed by the user. 
  5548.       Select the following from the Styles settings page: 
  5549.  
  5550.           For the readOnlyHeading style, select the On radio button. 
  5551.           For the readOnly style, select the On radio button. 
  5552.  
  5553.    6. Set a vertical separator for container column 1 only. For the 
  5554.       verticalSeparator style, select the On radio button. 
  5555.  
  5556.    7. Select the OK push button to close the settings notebook. 
  5557.  
  5558.  Repeat this procedure for the second container column, adjusting the width of 
  5559.  the column to fit. The second column is supposed to display the number of 
  5560.  years of experience each contractor has for a certain skill, so use the 
  5561.  following settings: 
  5562.  
  5563.      Select the Use an attribute from the part radio button 
  5564.      Choose yearsExp to populate the container column. 
  5565.      Do not add a vertical separator. 
  5566.  
  5567.  The next step is Filling the Container. 
  5568.  
  5569.  
  5570. ΓòÉΓòÉΓòÉ 46.1.3. Fill the container ΓòÉΓòÉΓòÉ
  5571.  
  5572. The easiest way to fill the container is to use a collection part. The 
  5573. OASkillView part uses an IVSequence* part named SkillList. 
  5574.  
  5575. Adding the nonvisual parts 
  5576.  
  5577. The OASearch application uses static parts that are actually found in OAMain 
  5578. part. All nonvisual parts in this view except SkillList are variables that will 
  5579. be connected later to the actual parts. 
  5580.  
  5581.    1. Add an OASkill* part as a variable. Name it Skill. 
  5582.  
  5583.       For help on how to do this, see Adding a Variable to a Composite Part. 
  5584.  
  5585.    2. Add an OASkillBase* part as a variable. Name it SkillBase. 
  5586.  
  5587.    3. Add an IVSequence* part. Name it SkillList. 
  5588.  
  5589.    4. Add an IMessageBox* part to handle exceptions. 
  5590.  
  5591.  Populating the collection 
  5592.  
  5593.  The SkillBase part contains the action (getSkills) needed to populate the 
  5594.  skill list. The getSkills action takes two parameters, a skill description and 
  5595.  a sequence. Make the following connections: 
  5596.  
  5597.  From                             To 
  5598.  
  5599.  Skill,#skillName                 EntryField1,#text 
  5600.  
  5601.  PushButton1,#buttonClickEvent    SkillBase,#getSkills 
  5602.  
  5603.  Skill,#skillName                 The aSkillName parameter of the 
  5604.                                   PushButton1,#buttonClickEvent--> 
  5605.                                   SkillBase#getSkills connection 
  5606.  
  5607.  SkillList,#this                  The aList parameter of the 
  5608.                                   PushButton1,#buttonClickEvent--> 
  5609.                                   SkillBase#getSkills connection 
  5610.  
  5611.  To handle exceptions, connect the exceptionOccurred feature of the getSkills 
  5612.  connection to the showException feature of the message box part. 
  5613.  
  5614.  Connecting parts to fill the container 
  5615.  
  5616.  To fill the container, connect the this attribute of the SkillList part to the 
  5617.  items attribute of the container. 
  5618.  
  5619.  
  5620. ΓòÉΓòÉΓòÉ 46.2. Add notebook parts ΓòÉΓòÉΓòÉ
  5621.  
  5622. The purpose of this section is to guide you through using a notebook part to 
  5623. create the OAContractorView part. The completed window looks like the following 
  5624. figure: 
  5625.  
  5626. The steps in creating a notebook are as follows: 
  5627.  
  5628.      Add the notebook and set it up. 
  5629.      Add notebook pages and set them up. 
  5630.  
  5631.  Begin by adding the notebook. 
  5632.  
  5633.  
  5634. ΓòÉΓòÉΓòÉ 46.2.1. Add the notebook ΓòÉΓòÉΓòÉ
  5635.  
  5636. Before constructing this new visual part, make sure that oanonvis.vbb is loaded 
  5637. into Visual Builder. 
  5638.  
  5639.    1. Create a new visual part. Call it OAContractorView. 
  5640.  
  5641.       A frame window and default canvas appear. 
  5642.  
  5643.    2. Delete the default canvas part from the frame window and resize the 
  5644.       window as necessary. 
  5645.  
  5646.    3. Select , the Composers category, from the left side of the parts palette. 
  5647.  
  5648.    4. Select , the INotebook* part, from the right side of the parts palette 
  5649.       and drop the part onto the frame window. 
  5650.  
  5651.  Specifying the notebook layout 
  5652.  
  5653.  You change the notebook's appearance using its settings notebook. As you make 
  5654.  selections, notice that the Preview area changes to reflect your choices. 
  5655.  
  5656.    1. Open the settings notebook for the notebook part. 
  5657.  
  5658.    2. On the General settings page, select the icon that represents the 
  5659.       orientation that you want for the notebook. For this example, select from 
  5660.       the Layout group. 
  5661.  
  5662.    3. From the Binding group, select the Spiral radio button. 
  5663.  
  5664.    4. From the Tab Shape group, select the Round radio button. 
  5665.  
  5666.    5. From the Justification group, select the two Center radio buttons. 
  5667.  
  5668.    6. Select the OK push button to close the settings notebook. 
  5669.  
  5670.  The next step is adding notebook pages. 
  5671.  
  5672.  
  5673. ΓòÉΓòÉΓòÉ 46.2.2. Add notebook pages ΓòÉΓòÉΓòÉ
  5674.  
  5675. You add notebook pages using the notebook part's Composition Editor contextual 
  5676. menu. 
  5677.  
  5678.    1. To add the first page of the notebook, select Add initial page. 
  5679.  
  5680.    2. To add each additional page, select Add page before or Add page after. 
  5681.  For this example, add one page after the initial page. 
  5682.  
  5683.  Setting up the notebook page and tab 
  5684.  
  5685.    1. Open the settings notebook for the first notebook page. 
  5686.  
  5687.                      To open the settings for the notebook page instead of the 
  5688.                      canvas that is on the notebook page, move the mouse 
  5689.                      pointer to the small area around the canvas before opening 
  5690.                      the settings. 
  5691.  
  5692.    2. On the General page, type ContactPage into the Subpart name field. 
  5693.  
  5694.    3. Type Contact into the Tab text field. This text is what appears on the 
  5695.       notebook tab. 
  5696.  
  5697.    4. Type Vital statistics into the Status text field. This text is what 
  5698.       appears in the status area at the bottom of the notebook page. 
  5699.  
  5700.    5. On the Style page, select the On radio button for the following styles: 
  5701.  
  5702.           The autoPageSize style, to enable automatic sizing of the notebook 
  5703.            page 
  5704.  
  5705.           The statusText style, to enable display of the status text that you 
  5706.            entered in the previous step to be displayed 
  5707.  
  5708.           The majorTab style, to give the notebook page a major tab 
  5709.  
  5710.  Adding parts to a notebook page 
  5711.  
  5712.  Each notebook page initially contains an ICanvas* part. If you want to use a 
  5713.  different part, delete the ICanvas* part and select another part from the 
  5714.  Composers category, such as IMultiCellCanvas*. 
  5715.  
  5716.  Note:  A notebook page allows only one subpart, which should be a part from 
  5717.         the Composers category. You can, of course, add other subparts to the 
  5718.         Composers part. 
  5719.  
  5720.  The ContactPage subpart contains the primitive parts shown in the following 
  5721.  figure: 
  5722.  
  5723.  To see the other notebook pages, open the OAContractView part in oawin.vbb. 
  5724.  
  5725.  
  5726. ΓòÉΓòÉΓòÉ 47. ...Add menus to my application ΓòÉΓòÉΓòÉ
  5727.  
  5728.      Adding a menu bar 
  5729.  
  5730.      Connecting the menu bar to the window 
  5731.  
  5732.      Adding menu choices 
  5733.  
  5734.      Adding menu separators 
  5735.  
  5736.      Connecting menu choices to actions 
  5737.  
  5738.  Begin with adding a menu bar to the window. 
  5739.  
  5740.  
  5741. ΓòÉΓòÉΓòÉ 47.1. Add a menu bar ΓòÉΓòÉΓòÉ
  5742.  
  5743. Begin by opening the visual part that contains the OASearch welcome window, the 
  5744. OAMain part. 
  5745.  
  5746.    1. Select , the Frame Extensions category, from the left side of the parts 
  5747.       palette. 
  5748.  
  5749.    2. Select , the IMenu* part, from the right side of the parts palette and 
  5750.       drop it on the free-form surface next to the window, as shown in the 
  5751.       following figure: 
  5752.  
  5753.    3. To add two of the menu choices to the menu bar, add two menu parts on top 
  5754.       of the menu part for the menu bar. 
  5755.  
  5756.       As you add each menu part, a cascade button part is added to the menu bar 
  5757.       and a connection is made between the cascade button part and the menu 
  5758.       part you added. This connection causes the menu part to be displayed when 
  5759.       the user selects the cascade button part. See the following figure: 
  5760.  
  5761.    4. Edit the text of the menu choices as shown in the following figure: To do 
  5762.       this, select each one and press Alt-mouse button 1. 
  5763.  
  5764.  
  5765. ΓòÉΓòÉΓòÉ 47.2. Connect the menu bar to the window ΓòÉΓòÉΓòÉ
  5766.  
  5767. To make the menu a menu bar, connect the this attribute of the IMenu* part to 
  5768. the menu attribute of the window part. Although the menu continues to appear 
  5769. vertically on the free-form surface, this connection defines the menu part as a 
  5770. menu bar. 
  5771.  
  5772.            Since the menu bar is shown outside the frame window, be sure to 
  5773.            leave enough space for it below the window title. 
  5774.  
  5775.  Making this same connection to a part other than a window part, such as a list 
  5776.  part, makes the menu part a pop-up menu instead of a menu bar. 
  5777.  
  5778.  Now that the menu bar has been added, the next step is adding the menu 
  5779.  choices. 
  5780.  
  5781.  
  5782. ΓòÉΓòÉΓòÉ 47.3. Add menu choices ΓòÉΓòÉΓòÉ
  5783.  
  5784. Once the menu structure is complete, you need to add menu choices that do 
  5785. something other than open other menus. 
  5786.  
  5787.    1. Select , the Frame Extensions category, from the left side of the parts 
  5788.       palette. 
  5789.  
  5790.    2. Select , the IMenuItem* part, from the right side of the parts palette. 
  5791.  
  5792.    3. The position at which you click the mouse is where the part is added 
  5793.       within the menu. Drop menu items as follows: 
  5794.  
  5795.           One part as the last item in the Menu1 part 
  5796.           Four items in the Menu2 part 
  5797.           Two items in the Menu3 part 
  5798.  
  5799.  You can change the position of a menu choice part within the menu part by 
  5800.  using mouse button 2 to drag each item to a new position. Position these parts 
  5801.  and change their text as shown in the following figure: The next step is 
  5802.  connecting menu choices to actions. 
  5803.  
  5804.  
  5805. ΓòÉΓòÉΓòÉ 47.4. Add menu separators ΓòÉΓòÉΓòÉ
  5806.  
  5807. Once you have added and edited the OAMain menu items, add a separator bar to 
  5808. Menu2 between Skill and General Information as follows: 
  5809.  
  5810.    1. Select , the Frame Extensions category, from the left side of the parts 
  5811.       palette. 
  5812.  
  5813.    2. Select , the IMenuSeparator* part, from the right side of the parts 
  5814.       palette. 
  5815.  
  5816.  
  5817. ΓòÉΓòÉΓòÉ 47.5. Connect menu choices to actions ΓòÉΓòÉΓòÉ
  5818.  
  5819. Once you have added menu choices, you can connect them to actions in this or 
  5820. other parts. As an example, connect the Exit menu bar item so that when the 
  5821. item is selected, the main window closes, as follows: 
  5822.  
  5823.  From part, feature            To part, feature 
  5824.  
  5825.  ExitMI,#commandEvent          FrameWindow,#close 
  5826.  
  5827.  Command events occur when a user selects a menu item, push button, or 
  5828.  accelerator key. In this case, the user' selection of Exit generates a command 
  5829.  event to perform the close action on the Frame Window. 
  5830.  
  5831.  Note:  You cannot promote menu item events to the part interface. 
  5832.  
  5833.  The other menu choices, shown in the following figure, connect to other parts 
  5834.  that are not on this free-form surface. These connections are completed in 
  5835.  Completing the Menu Bar. 
  5836.  
  5837.  
  5838. ΓòÉΓòÉΓòÉ 48. ...Add help to Visual Builder applications ΓòÉΓòÉΓòÉ
  5839.  
  5840.      Creating the help file 
  5841.  
  5842.      Providing context-sensitive help 
  5843.  
  5844.      Providing general help 
  5845.  
  5846.      Providing the application help window 
  5847.  
  5848.      Providing help for factory-generated frame windows 
  5849.  
  5850.      Providing a Help push button 
  5851.  
  5852.      Displaying fly-over help when the mouse pointer is over a part 
  5853.  
  5854.      Displaying help in an information area 
  5855.  
  5856.  
  5857. ΓòÉΓòÉΓòÉ 48.1. Create the help file ΓòÉΓòÉΓòÉ
  5858.  
  5859. Before we can connect the help, we must first create the help file. 
  5860.  
  5861. Writing the help 
  5862.  
  5863. For convenience sake, we have provided the help source so you do not have to 
  5864. retype it. Double-click here to see the help source and select Copy from the 
  5865. Services pull-down menu to copy the panel text to the system clipboard. Using 
  5866. your favorite editor, create a new file and paste this text into the file. 
  5867.  
  5868.            When creating your own help files, try using a Project Smarts IPF 
  5869.            template, which provides the basic tags for creating online help 
  5870.            using the OS/2 Information Presentation Facility. For more 
  5871.            information on writing online help, refer to the OS/2 Information 
  5872.            Presentation Facility Guide and Reference. 
  5873.  
  5874.  Save this file with a name similar to cppov33.ipf.ipf. 
  5875.  
  5876.  Building the help file 
  5877.  
  5878.  Ensure that you have the IPF compiler installed on your system and that your 
  5879.  environment variables are set up to run the IPF compiler. The IPF compiler 
  5880.  comes with the OS/2 2.1 Toolkit and the OS/2 Warp Toolkit. 
  5881.  
  5882.  To build the help file, simply run the Information Presentation Facility (IPF) 
  5883.  compiler. For example, if you saved your help file with the name cppov33.ipf, 
  5884.  you would enter the following command in the directory where you saved your 
  5885.  file: 
  5886.  
  5887.   ipfc cppov33.ipf
  5888.  
  5889.  This command generates a file called cppov33.hlp. 
  5890.  
  5891.  You have now built your help file. The next step is to provide 
  5892.  context-sensitive help in your application. 
  5893.  
  5894.  
  5895. ΓòÉΓòÉΓòÉ 48.2. Sample Help Source Code ΓòÉΓòÉΓòÉ
  5896.  
  5897. :userdoc.
  5898. :title.Opportunities Abound Databases Help
  5899. :docprof toc=1 ctrlarea=page.
  5900. :ctrl ctrlid=buttons controls='ESC SEARCH PRINT' page.
  5901. :h1 res=9998.
  5902. General Help for the Opportunities Abound Databases
  5903. :i1.general help
  5904. :p.Text goes here.
  5905. :h1 res=9999.
  5906. Request for Skill Information Help
  5907. :i1.requesting skill information, help for
  5908. :p.Text goes here.
  5909. :h1 id=10000.
  5910. Skill Information Help
  5911. :i1.skill information, help for
  5912. :p.Text goes here.
  5913. :h1 res=10001.
  5914. Request for Contract Information Help
  5915. :i1.requesting contract information, help for
  5916. :p.Text goes here.
  5917. :h1 res=10002.
  5918. Contract Information Help
  5919. :i1.contract information, help for
  5920. :p.Text goes here.
  5921. :h1 res=10003.
  5922. Request for Contractor Information Help
  5923. :i1.requesting contractor information, help for
  5924. :p.Text goes here.
  5925. :h1 res=10004.
  5926. Contractor Information Help
  5927. :i1.contractor information, help for
  5928. :p.Text goes here.
  5929. :euserdoc.
  5930.  
  5931.  
  5932. ΓòÉΓòÉΓòÉ 48.3. Provide context-sensitive help ΓòÉΓòÉΓòÉ
  5933.  
  5934. This section tells you how to provide context-sensitive help for subparts in 
  5935. your application. 
  5936.  
  5937. For this example, we use the graphic push buttons on the window. 
  5938.  
  5939. To provide context-sensitive help for a subpart, do the following: 
  5940.  
  5941.    1. Open the cppov33.ipf file in your text editor and find the "Request for 
  5942.       Skill Information Help" heading. 
  5943.  
  5944.       Above this heading is the heading tag, :h1, with a res attribute. This 
  5945.       attribute contains the resource number for the help panel for the Skills 
  5946.       push button. 
  5947.  
  5948.    2. Open the settings notebook for the subpart, in this case the Skill push 
  5949.       button. 
  5950.  
  5951.    3. Select the Control page. It looks like the following figure: 
  5952.  
  5953.    4. Enter the resource number for the Skills push button help panel in the 
  5954.       Help panel id field. 
  5955.  
  5956.       When you generate the code for your application, Visual Builder creates a 
  5957.       help table in the resource (.rc) file that it generates and inserts this 
  5958.       number into the help table. 
  5959.  
  5960.    5. If the Enable check box is not checked, select it. 
  5961.  
  5962.    6. Select the OK push button. 
  5963.  
  5964.    7. Repeat steps 2 through 6 for the Contract push button and the Contractor 
  5965.       push button. Use the resource numbers for the "Request for Contract 
  5966.       Information Help" and "Request for Contractor Information Help", 
  5967.       respectively. 
  5968.  
  5969.  You have now provided context-sensitive help for the push buttons. The next 
  5970.  step is to provide general help in your application. 
  5971.  
  5972.  
  5973. ΓòÉΓòÉΓòÉ 48.4. Provide general help ΓòÉΓòÉΓòÉ
  5974.  
  5975. This section tells you how to provide general help for your application. For 
  5976. this example, we use the frame window. 
  5977.  
  5978. To provide context-sensitive help for your application, do the following: 
  5979.  
  5980.    1. Open the cppov33.ipf file in your text editor and find the "General Help 
  5981.       for the Opportunities Abound Databases" heading. 
  5982.  
  5983.       Above this heading is the heading tag, :h1, with a res attribute. This 
  5984.       attribute contains the resource number for the general information help 
  5985.       panel. 
  5986.  
  5987.    2. Open the settings notebook for the subpart, in this case the frame 
  5988.       window. 
  5989.  
  5990.    3. Select the Control page. It looks like the following figure: 
  5991.  
  5992.    4. Enter the resource number for the general information help panel in the 
  5993.       Help panel id field. 
  5994.  
  5995.       When you generate the code for your application, Visual Builder creates a 
  5996.       help table in the resource (.rc) file that it generates and inserts this 
  5997.       number into the help table. 
  5998.  
  5999.    5. If the Enable check box is not checked, select it. 
  6000.  
  6001.    6. Select the OK push button. 
  6002.  
  6003.  You have now provided general help for the main window. The next step is to 
  6004.  provide a help window to display the help panels in. 
  6005.  
  6006.  
  6007. ΓòÉΓòÉΓòÉ 48.5. Provide the application help window ΓòÉΓòÉΓòÉ
  6008.  
  6009. Now that you have added the context-sensitive help and the general help for the 
  6010. main window, you need a help window to display the help panels in. You must 
  6011. place an IHelpWindow* part on the free-form surface to give Visual Builder a 
  6012. window in which to display the help information. The default owner of the 
  6013. IHelpWindow* part is the primary part for your application. Therefore, no 
  6014. connections are required. 
  6015.  
  6016. To add a help window to your application, do the following: 
  6017.  
  6018.    1. Select , the Other category, on the parts palette. 
  6019.  
  6020.    2. Select , the IHelpWindow* part, and place it on the free-form surface. 
  6021.  
  6022.    3. Open the settings notebook for the IHelpWindow* part. It looks like the 
  6023.       following figure: 
  6024.  
  6025.    4. In the Title field, enter the title of the help window. 
  6026.  
  6027.       This must be the same title that you entered on the :title tag in your 
  6028.       .ipf file. 
  6029.  
  6030.    5. In the Help libraries field, enter the name of the help file that you 
  6031.       compiled, such as oasearch.hlp. 
  6032.  
  6033.       If you had created multiple help files for your application, you would 
  6034.       enter all of their names in this field. 
  6035.  
  6036.    6. We recommend that you leave the Help table id field empty and let Visual 
  6037.       Builder generate it for you unless you need a specific help table ID. 
  6038.       Otherwise, you could have conflicts in your resource (.rc) file. 
  6039.  
  6040.    7. Select the OK push button. 
  6041.  
  6042.  
  6043. ΓòÉΓòÉΓòÉ 48.6. Provide help for factory-generated frame windows ΓòÉΓòÉΓòÉ
  6044.  
  6045. You can associate a help window with a part that is generated by an object 
  6046. factory if the base class of that part is IFrameWindow*. To do this, you can do 
  6047. either of the following: 
  6048.  
  6049.      Edit the part that the object factory generates, place an IHelpWindow* 
  6050.       part on the free-form surface next to it, and do all the things described 
  6051.       in the preceding sections to use the help window properly. Repeat this 
  6052.       step for each IFrameWindow*-based part that is generated by an object 
  6053.       factory. 
  6054.  
  6055.       You should use this method if you have created multiple help library 
  6056.       (.hlp) files for your library instead of putting all of your help panels 
  6057.       in one library file. 
  6058.  
  6059.      Place an IHelpWindow* part on the free-form surface in the same view with 
  6060.       the object factory if you have created only one help library file for all 
  6061.       of your help panels. Then, do the following: 
  6062.  
  6063.         1. Open the settings notebook for the IHelpWindow* part. 
  6064.  
  6065.         2. Enter the help window title and the name of the library (.hlp) file. 
  6066.  
  6067.         3. Close the settings notebook by selecting the OK push button. 
  6068.  
  6069.         4. Connect the newEvent feature of the object factory to the 
  6070.            setAssociatedWindow action of the help window. 
  6071.  
  6072.         5. Repeat step 4 for each object factory in the view. 
  6073.  
  6074.         6. Edit each IFrameWindow*-based part that an object factory generates 
  6075.            and specify the appropriate help panel IDs for the subparts that you 
  6076.            want to provide help for. Each help panel ID must be a resource ID 
  6077.            in the library file that you specified in step 2. 
  6078.  
  6079.  
  6080. ΓòÉΓòÉΓòÉ 48.7. Provide a Help push button ΓòÉΓòÉΓòÉ
  6081.  
  6082. To provide a Help push button in your application, do the following: 
  6083.  
  6084.    1. Select , the Buttons category, in the left-hand column on the parts 
  6085.       palette. 
  6086.  
  6087.    2. Select , the IPushButton* part, and place it where you want it to be. 
  6088.  
  6089.    3. Change the text on the push button to Help. 
  6090.  
  6091.    4. Open the settings notebook for the push button. 
  6092.  
  6093.    5. Select the Styles tab. 
  6094.  
  6095.    6. Find help on the Styles page and select the On radio button. 
  6096.  
  6097.       This style turns a regular push button into a help push button. 
  6098.  
  6099.    7. On the same page, find noPointerFocus and select the On radio button. 
  6100.  
  6101.    8. Select the OK push button to close the settings notebook. 
  6102.  
  6103.  You now have a Help push button. If you have followed the steps in the 
  6104.  preceding sections, clicking this button causes the contextual help panel for 
  6105.  the part that currently has the input focus to be displayed. If no part has 
  6106.  the focus, the main help panel for the window is displayed. The behavior of 
  6107.  the Help push button is identical to that of the F1 key. 
  6108.  
  6109.  To provide a help panel for the Help push button itself, follow the 
  6110.  instructions in 
  6111.  
  6112.  
  6113. ΓòÉΓòÉΓòÉ 48.8. Display fly-over help when the mouse pointer is over a part ΓòÉΓòÉΓòÉ
  6114.  
  6115. Your application can provide the following types of fly-over help: 
  6116.  
  6117.      A short text string that your application displays next to the subpart 
  6118.       that the mouse pointer is over 
  6119.  
  6120.      A longer text string that your application displays in a text control 
  6121.  
  6122.  Providing fly-over help for a subpart 
  6123.  
  6124.  To provide fly-over help for a subpart, do the following: 
  6125.  
  6126.    1. Place an IVBFlyText* part on the free-form surface by doing the 
  6127.       following: 
  6128.  
  6129.         a. Select , the Other category, on the parts palette. 
  6130.  
  6131.         b. Select , the IVBFlyText* part, and place it on the free-form 
  6132.            surface. 
  6133.  
  6134.    2. Add fly-over help text to one or more subparts by doing the following: 
  6135.  
  6136.         a. Open the settings notebook for a subpart, such as an entry field or 
  6137.            push button. 
  6138.  
  6139.         b. Select the Control notebook tab. 
  6140.  
  6141.         c. Enter fly-over text strings in the Fly over short text field, the 
  6142.            Fly over long text field, or both. 
  6143.  
  6144.         d. Select the OK push button to save the text strings that you just 
  6145.            entered. 
  6146.  
  6147.  That is all you need to do. There are no connections to make. 
  6148.  
  6149.  
  6150. ΓòÉΓòÉΓòÉ 48.9. Display help in an information area ΓòÉΓòÉΓòÉ
  6151.  
  6152. The following sections provide specific information about displaying help in an 
  6153. information area: 
  6154.  
  6155.      Adding an information area to a frame window 
  6156.  
  6157.      Displaying help for menu choices in an information area 
  6158.  
  6159.      Displaying information about successful actions 
  6160.  
  6161.  
  6162. ΓòÉΓòÉΓòÉ 48.9.1. Add an information area to a frame window ΓòÉΓòÉΓòÉ
  6163.  
  6164. To add an information area to a frame window, do the following: 
  6165.  
  6166.    1. Select , the Frame Extensions category, on the parts palette. 
  6167.  
  6168.    2. Select , the IInfoArea* part. 
  6169.  
  6170.    3. Move the mouse pointer over the title bar or window border of the frame 
  6171.       window and click mouse button 1. 
  6172.  
  6173.       Visual Builder places an information area at the bottom of the frame 
  6174.       window. 
  6175.  
  6176.    4. Open the settings notebook for the information area. 
  6177.  
  6178.    5. Enter text that you want your application to display in the following 
  6179.       fields: 
  6180.  
  6181.       Disabled text 
  6182.              Text to display when the selected menu choice is disabled. 
  6183.  
  6184.       Inactive text 
  6185.              Text to display when no menu choice is selected. 
  6186.  
  6187.       Missing text 
  6188.              Text to display when the information area cannot find and display 
  6189.              specific help for a menu choice. 
  6190.  
  6191.  
  6192. ΓòÉΓòÉΓòÉ 48.9.2. Display help for menu choices in an information area ΓòÉΓòÉΓòÉ
  6193.  
  6194. To display help text for menu choices in an information area, do the following: 
  6195.  
  6196.    1. Create the menu bar and pull-down menus for your application. 
  6197.  
  6198.    2. Open the settings notebook for each menu choice. 
  6199.  
  6200.    3. Enter a description of the menu choice in the Info area text field. 
  6201.  
  6202.    4. Select the OK push button to save the description you just entered. 
  6203.  
  6204.  
  6205. ΓòÉΓòÉΓòÉ 48.9.3. Display long fly-over text in an information area ΓòÉΓòÉΓòÉ
  6206.  
  6207. To display a long fly-over text string in an information area, do the 
  6208. following. 
  6209.  
  6210. Note:  The following steps assume that you have already added an IVBFlyText* 
  6211.        part and an IInfoArea* part to a frame window. If you have not, you 
  6212.        should complete the steps in the following sections and then return 
  6213.        here. 
  6214.  
  6215.      Displaying Fly-over Help When the Mouse Pointer Is Over a Part 
  6216.  
  6217.       When following these steps, make sure you enter a text string in the Fly 
  6218.       over long text field in the settings notebook for a subpart, such as an 
  6219.       entry field or push button. 
  6220.  
  6221.      Adding an Information Area to a Frame Window 
  6222.  
  6223.    1. Display the connection menu for the information area. 
  6224.  
  6225.    2. Select the this attribute. 
  6226.  
  6227.    3. Display the connection menu for the fly-over text part. 
  6228.  
  6229.    4. Select the longTextControl attribute. 
  6230.  
  6231.  That is all you have to do. 
  6232.  
  6233.  
  6234. ΓòÉΓòÉΓòÉ 48.9.4. Display information about successful actions ΓòÉΓòÉΓòÉ
  6235.  
  6236. To display information in an information area when an action or member function 
  6237. completes successfully, do the following: 
  6238.  
  6239.    1. Create an event-to-attribute connection using the text attribute of the 
  6240.       IInfoArea* part as the target. The source event can be one of the 
  6241.       following: 
  6242.  
  6243.           The same event that triggered the action or member function 
  6244.  
  6245.           The actionResult event of the connection that triggered the action 
  6246.            or member function 
  6247.  
  6248.    2. Double-click on the connection you just made to open the settings window 
  6249.       for the connection. 
  6250.  
  6251.    3. Select the Set parameters push button to open the Constant Parameter 
  6252.       Value Settings window. 
  6253.  
  6254.    4. In the text field, enter the text string that you want to assign to the 
  6255.       text attribute. 
  6256.  
  6257.       Your application will display this text string in the information area 
  6258.       each time the action or member function completes successfully. 
  6259.  
  6260.    5. Select the OK push button to close the Constant Parameter Value Settings 
  6261.       window. 
  6262.  
  6263.    6. Select the Cancel push button to close the connection settings window. 
  6264.  
  6265.  
  6266. ΓòÉΓòÉΓòÉ 49. ...Integrate visual parts into a single application ΓòÉΓòÉΓòÉ
  6267.  
  6268.      Adding nonvisual support parts to the primary part 
  6269.  
  6270.      Adding static visual parts 
  6271.  
  6272.      Adding visual parts as dynamic instances 
  6273.  
  6274.         -  Adding and setting Object Factory parts 
  6275.  
  6276.         -  Adding variable parts 
  6277.  
  6278.         -  Connecting to the Object Factory parts 
  6279.  
  6280.         -  Connecting the Object Factory parts to their corresponding variable 
  6281.            parts 
  6282.  
  6283.      Making the final connections 
  6284.  
  6285.         -  Connecting the nonvisual parts to the variables that represent them 
  6286.  
  6287.         -  Completing the menu bar 
  6288.  
  6289.  
  6290. ΓòÉΓòÉΓòÉ 49.1. Add nonvisual support parts to the primary part ΓòÉΓòÉΓòÉ
  6291.  
  6292. For this example, refer to the primary view, OAMain, in oawin.vbb, shown in the 
  6293. following figure: 
  6294.  
  6295.    1. Begin by building the primary part as you would any IFrameWindow*-based 
  6296.       part. For information about building the menu bar, see Adding Menus to 
  6297.       Your Application. 
  6298.  
  6299.    2. The OASearch application starts up with a small number of static 
  6300.       nonvisual instances to support the visual parts. Add the following parts: 
  6301.  
  6302.           OAContractor*.  Name it Contractor. 
  6303.           OAContract*.  Name it Contract. 
  6304.           OASkill*.  Name it Skill. 
  6305.           OASkillBase*.  Name it SkillBase. 
  6306.  
  6307.       You must connect these part instances to the variables that represent 
  6308.       them in the other visual parts. First, you must add the visual parts. 
  6309.  
  6310.  
  6311. ΓòÉΓòÉΓòÉ 49.2. Add static parts ΓòÉΓòÉΓòÉ
  6312.  
  6313. One visual part, OAGenInfo, exists statically in the OASearch application as a 
  6314. modal window. The disadvantage of using static visual parts is that once the 
  6315. user closes the window, the part is destroyed and cannot be instantiated again 
  6316. in the same session. 
  6317.  
  6318. Add the OAGenInfo* part. Name it VBDevelopment. You must also connect 
  6319. OAGEnInfo* to the menu item that causes it to display. For details, see 
  6320. Completing the Menu Bar. 
  6321.  
  6322.  
  6323. ΓòÉΓòÉΓòÉ 49.3. Add visual parts as dynamic instances ΓòÉΓòÉΓòÉ
  6324.  
  6325. Implementing dynamic parts involves the following tasks: 
  6326.  
  6327.      Adding and setting Object Factory parts 
  6328.      Adding variable parts 
  6329.      Connecting to the Object Factory parts 
  6330.      Connecting the Object Factory parts to the corresponding variable parts 
  6331.  
  6332.  The first step is adding and setting Object Factory parts. 
  6333.  
  6334.  
  6335. ΓòÉΓòÉΓòÉ 49.3.1. Add and set object factory parts ΓòÉΓòÉΓòÉ
  6336.  
  6337. Before you can use Object Factory parts, you must have created the part classes 
  6338. to be represented. Before you start, be sure to load the .vbb files that 
  6339. contain those parts into Visual Builder. 
  6340.  
  6341. Adding the Object Factory parts 
  6342.  
  6343.    1. Select , the Models category, from the left side of the parts palette. 
  6344.  
  6345.    2. Select the Sticky check box. 
  6346.  
  6347.    3. Select , the Object Factory part, from the right side of the parts 
  6348.       palette. 
  6349.  
  6350.    4. Drop six Object Factory parts on the free-form surface. 
  6351.  
  6352.    5. Unload the mouse pointer by selecting , the Selection tool, from the 
  6353.       Visual Builder tool bar. 
  6354.  
  6355.  Setting an Object Factory part 
  6356.  
  6357.    1. Change the part name using the Composition Editor contextual menu. 
  6358.  
  6359.       In the OASearch example, the Object Factory parts are named as follows: 
  6360.  
  6361.       ConQFac             Request for Contract Information window 
  6362.       ConVFac             Contract Information window 
  6363.       CtrQFac             Request for Contractor Information window 
  6364.       CtrVFac             Contractor Information window 
  6365.       SklQFac             Request for Skill Information window 
  6366.       SklVFac             Skill Information window 
  6367.  
  6368.    2. Change the part type from the default (IStandardNotifier*) using the 
  6369.       Composition Editor contextual menu. 
  6370.  
  6371.       In the OASearch example, the Object Factory parts have the following 
  6372.       types: 
  6373.  
  6374.       ConQFac             OAQueryContract* 
  6375.       ConVFac             OAContractView* 
  6376.       CtrQFac             OAQueryContractor* 
  6377.       CtrVFac             OAContractorView* 
  6378.       SklQFac             OAQuerySkill* 
  6379.       SklVFac             OASkillView* 
  6380.  
  6381.    3. Set the Object Factory part to automatically delete each instance, as 
  6382.       follows: 
  6383.  
  6384.         a. Open the settings notebook for the part. 
  6385.         b. Switch to the General page. 
  6386.         c. Select the AutoDelete check box. 
  6387.  
  6388.  
  6389. ΓòÉΓòÉΓòÉ 49.3.2. Add variable parts ΓòÉΓòÉΓòÉ
  6390.  
  6391. When used with Object Factory parts, variable parts represent the newly created 
  6392. part instance. Add and set variable parts as follows: 
  6393.  
  6394.  ContractQ      Set the type to OAQueryContract*. 
  6395.  ContractorQ    Set the type to OAQueryContractor*. 
  6396.  SkillQ         Set the type to OAQuerySkill*. 
  6397.  ContractV      Set the type to OAContractView*. 
  6398.  ContractorV    Set the type to OAContractorView*. 
  6399.  SkillV         Set the type to OASkillView*. 
  6400.  
  6401.  For more information on variables, see Adding a Variable to a Composite Part. 
  6402.  
  6403.  
  6404. ΓòÉΓòÉΓòÉ 49.3.3. Connect to the object factory parts ΓòÉΓòÉΓòÉ
  6405.  
  6406. Once you have added and set both the Object Factory and variable parts, connect 
  6407. the IGraphicPushButton* parts on the welcome window to the Object Factory parts 
  6408. representing the query windows, as follows: 
  6409.  
  6410.  
  6411.  From part, feature             To part, feature
  6412.  
  6413.  ContractGB, #buttonClickEvent  ConQFac, #new
  6414.  
  6415.  ContractorGB, #                CtrQFac, #new
  6416.  buttonClickEvent
  6417.  
  6418.  SkillGB, #buttonClickEvent     SklQFac, #new
  6419.  
  6420. Next, connect promoted button actions in the query windows to the Object 
  6421. Factory parts representing the information windows, as follows: 
  6422.  
  6423.  
  6424.  From part, feature             To part, feature
  6425.  
  6426.  ContractQ, #okPB               ConVFac, #new
  6427.  ButtonClickEvent
  6428.  
  6429.  ContractorQ, #okPB             CtrVFac, #new
  6430.  ButtonClickEvent
  6431.  
  6432.  SkillQ, #okPBButtonClickEvent  SklVFac, #new
  6433.  
  6434.  
  6435. ΓòÉΓòÉΓòÉ 49.3.4. Connect the object factory parts to their corresponding variable parts ΓòÉΓòÉΓòÉ
  6436.  
  6437. Once you have set both Object Factory and variable parts, you must connect 
  6438. them. In OAMain, the connections vary depending on whether the window is modal. 
  6439. Modal windows retain focus until they are closed; the user cannot switch focus 
  6440. to another window without closing the modal window. In OAMain, OAGenInfo and 
  6441. the query windows are modal; the other windows are modeless. 
  6442.  
  6443. Connections for modal windows 
  6444.  
  6445. Make the following connections for the query window parts. The connections for 
  6446. OAGenInfo* are listed in Completing the Menu Bar. 
  6447.  
  6448.  
  6449.  From part, feature             To part, feature
  6450.  
  6451.  ConQFac, #newEvent             ContractQ, #this
  6452.  
  6453.  ConQFac, #newEvent             ContractQ, #setFocus
  6454.  
  6455.  ConQFac, #newEvent             ContractQ, #showModally
  6456.  
  6457.  CtrQFac, #newEvent             ContractorQ, #this
  6458.  
  6459.  CtrQFac, #newEvent             ContractorQ, #setFocus
  6460.  
  6461.  CtrQFac, #newEvent             ContractorQ, #showModally
  6462.  
  6463.  SklQFac, #newEvent             SkillQ, #this
  6464.  
  6465.  SklQFac, #newEvent             SkillQ, #setFocus
  6466.  
  6467.  SklQFac, #newEvent             SkillQ, #showModally
  6468.  
  6469. Connections for modeless windows 
  6470.  
  6471. Now make the following connections for the modeless information windows: 
  6472.  
  6473.  
  6474.  From part, feature             To part, feature
  6475.  
  6476.  ConVFac, #newEvent             ContractV, #this
  6477.  
  6478.  ConVFac, #newEvent             ContractV, #setFocus
  6479.  
  6480.  ConVFac, #newEvent             ContractV, #visible
  6481.  
  6482.  CtrVFac, #newEvent             ContractorV, #this
  6483.  
  6484.  CtrVFac, #newEvent             ContractorV, #setFocus
  6485.  
  6486.  CtrVFac, #newEvent             ContractorV, #visible
  6487.  
  6488.  SklVFac, #newEvent             SkillV, #this
  6489.  
  6490.  SklVFac, #newEvent             SkillV, #setFocus
  6491.  
  6492.  SklVFac, #newEvent             SkillV, #visible
  6493.  
  6494.  
  6495. ΓòÉΓòÉΓòÉ 49.4. Make the final connections ΓòÉΓòÉΓòÉ
  6496.  
  6497. With all parts represented in the primary part, you have only to make the final 
  6498. connections. This includes the following: 
  6499.  
  6500.      Connecting the nonvisual parts to their corresponding variable parts 
  6501.      Completing the menu bar 
  6502.  
  6503.  
  6504. ΓòÉΓòÉΓòÉ 49.4.1. Connect the nonvisual parts to the variables that represent them ΓòÉΓòÉΓòÉ
  6505.  
  6506. Each visual part contains promoted variables as placeholders for the static 
  6507. nonvisual parts dropped in OAMain. Now, connect the static parts to the 
  6508. variables that represent them as follows: 
  6509.  
  6510.  
  6511.  From part, feature             To part, feature
  6512.  
  6513.  Contract, #this                ConQFac, #contract
  6514.  
  6515.  Contract, #this                ConVFac, #contract
  6516.  
  6517.  Contract, #this                CtrVFac, #contract
  6518.  
  6519.  Contractor, #this              CtrQFac, #contractor
  6520.  
  6521.  Contractor, #this              CtrVFac, #contractor
  6522.  
  6523.  Skill, #this                   SklQFac, #skill
  6524.  
  6525.  Skill, #this                   SklVFac*, #skill
  6526.  
  6527.  SkillBase, #this               SklQFac, #skillBase
  6528.  
  6529.  SkillBase, #this               SklVFac, #skillBase
  6530.  
  6531.  SkillBase, #this               CtrQFac, #skillBase
  6532.  
  6533.  SkillBase, #this               CtrVFac, #skillBase
  6534.  
  6535.  
  6536. ΓòÉΓòÉΓòÉ 49.4.2. Complete the menu bar ΓòÉΓòÉΓòÉ
  6537.  
  6538. Now that all parts appear on the free-form surface, you can complete the menu 
  6539. bar. The connections echo those made in Connecting to the Object Factory Parts. 
  6540.  
  6541. Connections from the View submenu 
  6542.  
  6543.  
  6544.  From part, feature             To part, feature
  6545.  
  6546.  ContractMI, #commandEvent      ConQFac, #new
  6547.  
  6548.  ContractorMI, #commandEvent    CtrQFac, #new
  6549.  
  6550.  SkillMI, #commandEvent         SklQFac, #new
  6551.  
  6552.  GenInfoMI, #commandEvent       VBDevelopment, #setFocus
  6553.  
  6554.  GenInfoMI, #commandEvent       VBDevelopment, #showModally
  6555.  
  6556. Connections from the Edit submenu 
  6557.  
  6558.  
  6559.  From part, feature             To part, feature
  6560.  
  6561.  ContractMI, #commandEvent      ConVFac, #new
  6562.  
  6563.  ContractorMI #commandEvent     CtrVFac, #new
  6564.  
  6565. Once all connections are complete, you are ready to generate code. Make sure to 
  6566. save your work. 
  6567.  
  6568.  
  6569. ΓòÉΓòÉΓòÉ 50. ...Generate source code for parts and applications ΓòÉΓòÉΓòÉ
  6570.  
  6571.      Preparing for source code generation: 
  6572.  
  6573.         -  Setting up Visual Builder to generate make files 
  6574.  
  6575.         -  Setting up Visual Builder projects to use WorkFrame's makemake 
  6576.            program 
  6577.  
  6578.      Generating C++ source code for individual parts 
  6579.  
  6580.      Source files created during part code generation 
  6581.  
  6582.      Generating C++ source code for your application's main() function 
  6583.  
  6584.      Source files created during generation of main() function code 
  6585.  
  6586.      Preparing generated files for compilation 
  6587.  
  6588.         -  Specifying additional libraries in the make file 
  6589.  
  6590.         -  Specifying debug options for the compiler and linker programs 
  6591.  
  6592.      Compiling and linking your application 
  6593.  
  6594.  
  6595. ΓòÉΓòÉΓòÉ 50.1. Prepare for source code generation ΓòÉΓòÉΓòÉ
  6596.  
  6597. Before getting started, decide how you want to build your application's make 
  6598. file. You can create make files in either of the following ways: 
  6599.  
  6600.      From Visual Builder 
  6601.      Using WorkFrame's makemake program 
  6602.  
  6603.  Both options require the following advance preparation. 
  6604.  
  6605.  
  6606. ΓòÉΓòÉΓòÉ 50.1.1. Set up Visual Builder to generate make files ΓòÉΓòÉΓòÉ
  6607.  
  6608. If you want Visual Builder to generate make files with the C++ source code, 
  6609. follow these steps from the Visual Builder window: 
  6610.  
  6611.    1. From the menu bar, select Options. 
  6612.  
  6613.    2. Select Preferences; then select Generate make files. 
  6614.  
  6615.  The next step is generating C++ source code for individual parts. 
  6616.  
  6617.  
  6618. ΓòÉΓòÉΓòÉ 50.1.2. Set up Visual Builder projects to use WorkFrame's makemake program ΓòÉΓòÉΓòÉ
  6619.  
  6620. If you prefer to build your application's make file using WorkFrame, make sure 
  6621. your Visual Builder project has the correct compile and link options set. 
  6622. Follow these steps from the desktop: 
  6623.  
  6624.    1. Open the Settings notebook for your Visual Builder project. 
  6625.  
  6626.    2. Select the Target notebook tab. Type an appropriate name in the Make file 
  6627.       name field. 
  6628.  
  6629.    3. Select the Actions notebook tab. 
  6630.  
  6631.    4. Select the link action; then select the Options push button. 
  6632.  
  6633.    5. Select the Templates notebook tab. 
  6634.  
  6635.    6. Select the Templates used radio button; then select the compile action to 
  6636.       associate with the link action. 
  6637.  
  6638.    7. Select the OK push button. 
  6639.  
  6640.    8. Select the File Names notebook tab. 
  6641.  
  6642.    9. Under Libraries to use, type in: 
  6643.  
  6644.             cppoov3i.lib os2386.lib
  6645.  
  6646.   10. Under Definition (.DEF) file name, type the appropriate module definition 
  6647.       file name. 
  6648.  
  6649.   11. Select the OK push button. 
  6650.  
  6651.   12. Close the Settings notebook. 
  6652.  
  6653.  The next step is generating C++ source code for individual parts. 
  6654.  
  6655.  
  6656. ΓòÉΓòÉΓòÉ 50.2. Generate C++ source code for individual parts ΓòÉΓòÉΓòÉ
  6657.  
  6658. After you finish constructing a part, you must generate source code. If the 
  6659. part is an application in itself or if you want to test a part individually, 
  6660. you must also generate the code as described in Generating C++ Source Code for 
  6661. Your Application's main() Function. 
  6662.  
  6663. You can generate source code for the part being edited from any of the Visual 
  6664. Builder editors. 
  6665.  
  6666.    1. From the editor's menu bar, select File. 
  6667.  
  6668.    2. Select Save and generate; then select Part source. 
  6669.  
  6670.  In addition, if you are using the Composition Editor, you can select , the 
  6671.  icon for the Generate Part Code tool, on the tool bar. There is no difference 
  6672.  between selecting this icon and using the menu item described previously. 
  6673.  
  6674.            One of the most common causes of code generation errors is changing 
  6675.            the names of features that are connected to other features. For 
  6676.            example, suppose feature A is connected to feature B. If you change 
  6677.            the name of feature A and then regenerate the source code for your 
  6678.            part, Visual Builder displays an error. This can also occur if you 
  6679.            change the name of a promoted feature. To correct the error, 
  6680.            double-click on the connection arrow and replace the incorrect 
  6681.            feature name with the correct one. 
  6682.  
  6683.  For more information about the files generated, see Source Files Created 
  6684.  during Part Code Generation. 
  6685.  
  6686.  The next step is generating C++ source code for your application's main() 
  6687.  function. 
  6688.  
  6689.  
  6690. ΓòÉΓòÉΓòÉ 50.2.1. Know which source files are created during part code generation ΓòÉΓòÉΓòÉ
  6691.  
  6692. For each part processed, Visual Builder generates several source code files. As 
  6693. an example, the following files are created for the OAContractView part: 
  6694.  
  6695.  contractg.cpp A C++ code file. 
  6696.  contractg.hpp The header file for contractg.cpp. 
  6697.  contractg.h A resource header file for the .cpp file. This file contains the 
  6698.            resource IDs for your part. 
  6699.  contractg.rc A resource file that contains any text strings used in the part 
  6700.            for entry field labels, push buttons, menus, and so forth. 
  6701.  
  6702.  If you selected Default to FAT file names under the Options pull-down menu of 
  6703.  the Visual Builder window and your part name has more than eight characters, 
  6704.  Visual Builder creates an eight-character name for the part when it is 
  6705.  created. 
  6706.  
  6707.  Note:  If you are using the File Allocation Table (FAT) file system, we 
  6708.         recommend that you always use part names and file names that have eight 
  6709.         characters or less, even if you have selected the Default to FAT file 
  6710.         names option. Otherwise, Visual Builder might use a file name for a 
  6711.         .vbb file that is the same as one that already exists and write over 
  6712.         the existing file. 
  6713.  
  6714.  For information about how the .h and .rc files are used for translation, see 
  6715.  Enabling National Language Support for an Application. 
  6716.  
  6717.  The next step is generating C++ source code for your application's main() 
  6718.  function. 
  6719.  
  6720.  
  6721. ΓòÉΓòÉΓòÉ 50.3. Generate C++ source code for my application's main() function ΓòÉΓòÉΓòÉ
  6722.  
  6723. To create an executable application, you must generate code for the standard 
  6724. C++ main() function. You can do this for parts that you want to test 
  6725. individually or for your entire application. If you want to compile your entire 
  6726. application, generate the function using the part that represents your 
  6727. application's primary view. 
  6728.  
  6729. You must first generate the C++ code for all parts that you intend to compile 
  6730. in your application. Load into Visual Builder the .vbb files that represent all 
  6731. parts that will appear in the compiled application. Then, generate the main() 
  6732. function from the part that you want to appear first when your application is 
  6733. started (the main part). 
  6734.  
  6735. You can generate application source code for the main() function if the main 
  6736. part is displayed in any of the Visual Builder editors. 
  6737.  
  6738.    1. From the editor's menu bar, select File. 
  6739.  
  6740.    2. Select Save and generate; then select main() for part. 
  6741.  
  6742.  For more information about the files generated, see Source Files Created 
  6743.  during Generation of main() Function Code. 
  6744.  
  6745.  The next step is preparing generated files for compilation. 
  6746.  
  6747.  
  6748. ΓòÉΓòÉΓòÉ 50.3.1. Know which source files are created during generation of main() ΓòÉΓòÉΓòÉ
  6749.  
  6750. function code 
  6751.  
  6752. For each main part processed, Visual Builder creates several files. For the 
  6753. OAMain part, the following files are created: 
  6754.  
  6755.  oamain.app The C++ code file containing the main() function declaration. 
  6756.  
  6757.            Note:  If you start Visual Builder from a WorkFrame project, a file 
  6758.                   named vbmain.cpp is generated instead of a file named 
  6759.                   oamain.app. 
  6760.  
  6761.  oamain.mak A make file, if you opted to generate make files using Visual 
  6762.            Builder. 
  6763.  
  6764.  If you selected Default to FAT file names as a preference under the Options 
  6765.  pull-down menu of the Visual Builder window and your part name has more than 
  6766.  eight characters, Visual Builder creates an eight-character name for the 
  6767.  generated files. 
  6768.  
  6769.  Note:  If you are using the File Allocation Table (FAT) file system, we 
  6770.         recommend that you always use part names and file names that have eight 
  6771.         characters or less, even if you have selected the Default to FAT file 
  6772.         names option. Otherwise, Visual Builder might use a file name for a 
  6773.         .vbb file that is the same as one that already exists and write over 
  6774.         the existing file. 
  6775.  
  6776.  The next step is preparing generated files for compilation. 
  6777.  
  6778.  
  6779. ΓòÉΓòÉΓòÉ 50.4. Prepare generated files for compilation ΓòÉΓòÉΓòÉ
  6780.  
  6781. Before compiling your application, be sure you have the following files: 
  6782.  
  6783.      Header files for all parts 
  6784.      .cpp files for all parts 
  6785.      A make file 
  6786.      An .app file for the main part 
  6787.  
  6788.       Note:  If you start Visual Builder from a WorkFrame project, you should 
  6789.              have a file named vbmain.cpp instead of an .app file. 
  6790.  
  6791.  Final preparations for compilation and linking include the following: 
  6792.  
  6793.      Specifying additional libraries (C++ libraries and DLLs) in the make file 
  6794.      Specifying debug options for the compiler and linker programs 
  6795.  
  6796.  
  6797. ΓòÉΓòÉΓòÉ 50.4.1. Specify additional libraries in the make file ΓòÉΓòÉΓòÉ
  6798.  
  6799. Review the list of libraries specified in the make file, particularly libraries 
  6800. for parts that you compiled separately. 
  6801.  
  6802. If your application uses DLLs, add the DLL names as dependent files in the 
  6803. description blocks used to keep the object files up to date. The order in which 
  6804. you list object files is significant. Files with external references must occur 
  6805. after the referred-to files. 
  6806.  
  6807.  
  6808. ΓòÉΓòÉΓòÉ 50.4.2. Specify the option to generate Browser information ΓòÉΓòÉΓòÉ
  6809.  
  6810. If your want the VisualAge C++ compiler to generate Browser information, you 
  6811. must include the -Fb+ option when you compile your application. This option 
  6812. causes the compiler to generate a file with an extension of .pdb. Once this 
  6813. file is generated, you can use the Browser data when connecting features to 
  6814. member functions and for other purposes. For more information, see Using 
  6815. Browser Information. 
  6816.  
  6817.  
  6818. ΓòÉΓòÉΓòÉ 50.4.3. Specify debug options for the compiler and linker programs ΓòÉΓòÉΓòÉ
  6819.  
  6820. If you prefer to compile and link your application using WorkFrame, you should 
  6821. have already specified debug options in your Visual Builder project file. For 
  6822. more information about the options you need to set, see the WorkFrame 
  6823. documentation. 
  6824.  
  6825. If you opted to let Visual Builder generate your make file, Visual Builder adds 
  6826. debug options to the make file by default. If you do not want your application 
  6827. compiled with debugging turned on, remove the /Ti+ option. 
  6828.  
  6829. For more information, refer to the VisualAge C++ Language Reference. 
  6830.  
  6831. To make Visual Builder connections easier to debug, set up a trace by following 
  6832. these steps: 
  6833.  
  6834.    1. In your config.sys file, add this line: 
  6835.  
  6836.             SET ICLUI TRACETO=STDOUT
  6837.  
  6838.    2. In your make file, add this phrase at the end of the GCPPFLAGS statement, 
  6839.       but before the back slash (\): 
  6840.  
  6841.             -DIC_TRACE_DEVELOP
  6842.  
  6843.    3. When you run your compiled application, redirect the output to a file. 
  6844.       For example, run myapp.exe as follows: 
  6845.  
  6846.             myapp > myapp.out
  6847.  
  6848.       Browse the output file (myapp.out) to see what connections were fired and 
  6849.       in what order. 
  6850.  
  6851.  
  6852. ΓòÉΓòÉΓòÉ 50.5. Compile and link my application ΓòÉΓòÉΓòÉ
  6853.  
  6854. You can compile your application from the OS/2 command line or from WorkFrame. 
  6855. To call both the complier and linker programs, you can run the Toolkit's nmake 
  6856. program. Regardless of how you choose to compile and link your Visual Builder 
  6857. application, use the following compile and link options: 
  6858.  
  6859.  B"/DE /pmtype:pm" Passes the string /DE /pmtype:pm to the linker as 
  6860.                 parameters. 
  6861.  
  6862.  C              Compiles and links. 
  6863.  
  6864.  Fb+            Generates Browser information in a file with a .pdb extension. 
  6865.  
  6866.  Ft(dir)        Generates files for template resolution and puts them in the 
  6867.                 dir directory. 
  6868.  
  6869.  Gd+            Dynamically links to the runtime library. 
  6870.  
  6871.  Gm+            Builds an .exe file. 
  6872.  
  6873.  I              Searches the directory of the source file for include files; 
  6874.                 then, searches paths specified in config.sys include variable. 
  6875.  
  6876.  Q              Displays the compiler logo when invoking the compiler. 
  6877.  
  6878.  Ti+            Generates debugger information. This is optional but 
  6879.                 recommended. 
  6880.  
  6881.  Tdp            Compiles all source files as C++ files and ensures that 
  6882.                 template functions are resolved. 
  6883.  
  6884.  For more information on compiling and linking, refer to the VisualAge C++ 
  6885.  Programming Guide. 
  6886.  
  6887.  
  6888. ΓòÉΓòÉΓòÉ 51. ...Use existing C and C++ code with Visual Builder ΓòÉΓòÉΓòÉ
  6889.  
  6890.      Defining the part interface using part information files 
  6891.  
  6892.      Creating a part information file 
  6893.  
  6894.      Importing the part 
  6895.  
  6896.  
  6897. ΓòÉΓòÉΓòÉ 51.1. Define the part interface using part information files ΓòÉΓòÉΓòÉ
  6898.  
  6899. If C++ code already exists for your Visual Builder application, you can more 
  6900. efficiently define the part interface using part information files. This 
  6901. involves the following steps: 
  6902.  
  6903.    1. Determine the part's features. 
  6904.  
  6905.    2. Create a part information file using your favorite editor. This file can 
  6906.       include information for as many parts as you need. 
  6907.  
  6908.    3. In Visual Builder, import the part. 
  6909.  
  6910.  
  6911. ΓòÉΓòÉΓòÉ 51.1.1. Create a part information file ΓòÉΓòÉΓòÉ
  6912.  
  6913. To create a part information file, add information about your part's part 
  6914. interface to a file using your preferred editor. The following example shows 
  6915. how you could specify part information for the OAContractor part: 
  6916.  
  6917. //VBBeginPartInfo: OAContractor,"Contractor part for OASearch sample"
  6918. //VBParent: IStandardNotifier
  6919. //VBIncludes: "Cntrctor.hpp" _OACONTRACTOR_,"iprofile.hpp","istring.hpp","iexcbase.hpp"
  6920. //VBPartDataFile: OANONVIS.VBB
  6921. //VBConstructor: OAContractor()
  6922. //VBComposerInfo: nonvisual,802,cppov33r
  6923. //VBEvent: ready, "ready", readyId
  6924. //VBAction: getContractor,
  6925. //VB:       "Get contractor data from database",
  6926. //VB:       OAContractor&,
  6927. //VB:       OAContractor& getContractor()
  6928. //VBAction: putContractor,
  6929. //VB:       "Add or update contractor data in database",
  6930. //VB:       OAContractor&,
  6931. //VB:       OAContractor& putContractor()
  6932. //VBAction: parseName,
  6933. //VB:       "Parse user input to get contractor's name",
  6934. //VB:       OAContractor&,
  6935. //VB        OAContractor& parseName(const IString& aName)
  6936. //VBAttribute: contractorID,
  6937. //VB:          "Contractor's employee identifier",
  6938. //VB:          IString,
  6939. //VB:          IString contractorID() const,,
  6940. //VB:          contractorIDId
  6941. //VBAttribute: lastName,
  6942. //VB:          "Contractor's last name",
  6943. //VB:          IString,
  6944. //VB:          IString lastName() const,
  6945. //VB:          OAContractor& setLastName(const IString& aLastName),
  6946. //VB:          lastNameId
  6947. //VBAttribute: firstName,
  6948. //VB:          "Contractor's first name",
  6949. //VB:          IString,
  6950. //VB:          IString firstName() const,
  6951. //VB:          OAContractor& setFirstName(const IString& aFirstName),
  6952. //VB:          firstNameId
  6953. //VBAttribute: middleInitial,
  6954. //VB:          "Contractor's middle initial",
  6955. //VB:          IString,
  6956. //VB:          IString middleInitial() const,
  6957. //VB:          OAContractor& setMiddleInitial(const IString& aMiddleInitial),
  6958. //VB:          middleInitialId
  6959. //VBAttribute: homeStreet,
  6960. //VB:          "Contractor's home street address",
  6961. //VB:          IString,
  6962. //VB:          IString homeStreet() const,
  6963. //VB:          OAContractor& setHomeStreet(const IString& aHomeStreet),
  6964. //VB:          homeStreetId
  6965. //VBAttribute: homeCity,
  6966. //VB:          "Contractor's home city",
  6967. //VB:          IString,
  6968. //VB:          IString homeCity() const,
  6969. //VB:          OAContractor& setHomeCity(const IString& aHomeCity),
  6970. //VB:          homeCityId
  6971. //VBAttribute: homeState,
  6972. //VB:          "Contractor's home state or province",
  6973. //VB:          IString,
  6974. //VB:          IString homeState() const,
  6975. //VB:          OAContractor& setHomeState(const IString& aHomeState),
  6976. //VB:          homeStateId
  6977. //VBAttribute: homeZip,
  6978. //VB:          "Contractor's home postal code",
  6979. //VB:          IString,
  6980. //VB:          IString homeZip() const,
  6981. //VB:          OAContractor& setHomeZip(const IString& aHomeZip),
  6982. //VB:          homeZipId
  6983. //VBAttribute: phoneNumber,
  6984. //VB:          "Contractor's daytime phone number",
  6985. //VB:          IString,
  6986. //VB:          IString phoneNumber() const,
  6987. //VB:          OAContractor& setPhoneNumber(const IString& aPhoneNumber),
  6988. //VB:          phoneNumberId
  6989. //VBAttribute: startDate,
  6990. //VB:          "Contractor's starting date with OA",
  6991. //VB:          IString,
  6992. //VB:          IString startDate() const,
  6993. //VB:          OAContractor& setStartDate(const IString& aStartDate),
  6994. //VB:          startDateId
  6995. //VBAttribute: endDate,
  6996. //VB:          "Contractor's last day with OA (empty if active)",
  6997. //VB:          IString,
  6998. //VB:          IString endDate() const,
  6999. //VB:          OAContractor& setEndDate(const IString& aEndDate),
  7000. //VB:          endDateId
  7001. //VBAttribute: activeStatus,
  7002. //VB:          "Whether contractor actively seeks contract work",
  7003. //VB:          Boolean,
  7004. //VB:          Boolean isActiveStatus() const,
  7005. //VB:          OAContractor& enableActiveStatus(Boolean enable = true),
  7006. //VB:          activeStatusId
  7007. //VBAttribute: currentContract,
  7008. //VB:          "Contractor's current assignment, if any",
  7009. //VB:          IString,
  7010. //VB:          IString currentContract() const,
  7011. //VB:          OAContractor& setCurrentContract(const IString& aCurrentContract),
  7012. //VB:          currentContractId
  7013. //VBPreferredFeatures: enabledForNotification, getContractor, putContractor, this
  7014. //VBEndPartInfo: OAContractor
  7015.  
  7016. Note the following syntax: 
  7017.  
  7018.      The VBBeginPartInfo and VBEndPartInfo statements delimit the part 
  7019.       information for OAContractor. 
  7020.  
  7021.      The VBPart statement specifies the base class for OAContractor, 
  7022.       IStandardNotifier*. 
  7023.  
  7024.      The VBIncludes statement specifies a header file to be added in an 
  7025.       #include directive when the code is generated. 
  7026.  
  7027.      The VBPartDataFile statement specifies the .vbb file that holds the 
  7028.       information for OAContractor. 
  7029.  
  7030.      The VBComposerInfo statement indicates that this is a nonvisual part. The 
  7031.       absence of the abstract keyword indicates that this is a concrete part 
  7032.       that can be dropped on the free-form surface. 
  7033.  
  7034.      The VBEvent, VBAction, and VBAttribute statements define features for 
  7035.       this part. 
  7036.  
  7037.  For information about part definition syntax, refer to Building VisualAge C++ 
  7038.  Parts for Fun and Profit. 
  7039.  
  7040.  The next step is importing the part. 
  7041.  
  7042.  
  7043. ΓòÉΓòÉΓòÉ 51.1.2. Import the part ΓòÉΓòÉΓòÉ
  7044.  
  7045. Before importing the part, you must create a part information file. To import 
  7046. the part, follow these steps from the Visual Builder window: 
  7047.  
  7048.    1. From the menu bar, select File. Select Import part information. 
  7049.  
  7050.       The Enter Name for Part Information File window appears. 
  7051.  
  7052.    2. Specify the path and name of the part information file that contains the 
  7053.       information that you want to import. When the import is finished, the 
  7054.       name of the part appears in in the Visual Builder window. 
  7055.  
  7056.  If C++ code for your part already exists, your part is finished. If you want 
  7057.  to change the part interface later, do either of the following: 
  7058.  
  7059.      Use the Part Interface Editor to edit feature specifications. You must 
  7060.       use this method to delete features. 
  7061.      Edit your part information file and re-import the part information. 
  7062.  
  7063.  If C++ code for your part does not exist, the next step is adding code to your 
  7064.  part. 
  7065.  
  7066.  
  7067. ΓòÉΓòÉΓòÉ 52. ...Add categories and parts to the parts palette ΓòÉΓòÉΓòÉ
  7068.  
  7069.      Preparing icons for the parts palette 
  7070.  
  7071.      Adding a category to the parts palette 
  7072.  
  7073.      Specifying a unique icon for a part you add to the parts palette 
  7074.  
  7075.      Adding a part to the parts palette 
  7076.  
  7077.      Deleting a category or part from the parts palette 
  7078.  
  7079.      Saving parts palette changes 
  7080.  
  7081.  
  7082. ΓòÉΓòÉΓòÉ 52.1. Prepare icons for the parts palette ΓòÉΓòÉΓòÉ
  7083.  
  7084. This example uses for the OAModels category and for the OAContractor part, 
  7085. which are stored in the cppov33r.dll file as resource numbers 800 and 802, 
  7086. respectively. 
  7087.  
  7088. To prepare icons for use with Visual Builder, do the following: 
  7089.  
  7090.    1. Create your icons. One way to do this is to use your operating system 
  7091.       toolkit icon editor. 
  7092.  
  7093.       For VGA displays on OS/2, use the Independent VGA form (32x32). For 
  7094.       higher display resolutions on OS/2, use the 8514-16 colors form (40x40). 
  7095.  
  7096.    2. Create a resource DLL that contains your icons. Use files similar to the 
  7097.       following: 
  7098.  
  7099.           userpal.c 
  7100.  
  7101.                         empty()
  7102.                         {
  7103.                         }
  7104.  
  7105.           userpal.rc 
  7106.  
  7107.                         icon 800 oamodels.ico
  7108.                         icon 801 oacontractor.ico
  7109.  
  7110.           userpal.def 
  7111.  
  7112.                         library userpal
  7113.                         description 'Icons for user-extended palette'
  7114.  
  7115.           userpal.mak 
  7116.  
  7117.                         userpal.dll: userpal.obj userpal.def userpal.res
  7118.                           icc userpal.obj /Feuserpal.dll userpal.def
  7119.                             rc userpal.res userpal.dll
  7120.  
  7121.                         userpal.obj: userpal.c
  7122.                           icc /C+ userpal.c
  7123.  
  7124.                         userpal.res: userpal.rc
  7125.                           rc -r userpal.rc
  7126.  
  7127.       Once you have the files ready, type the following to build the resource 
  7128.       DLL: nmake userpal.mak 
  7129.  
  7130.    3. Place the resource DLL in a directory in your LIBPATH. 
  7131.  
  7132.  Your icons are now ready for use with Visual Builder. 
  7133.  
  7134.  The next step is adding a category to the parts palette. 
  7135.  
  7136.  
  7137. ΓòÉΓòÉΓòÉ 52.2. Add a category to the parts palette ΓòÉΓòÉΓòÉ
  7138.  
  7139. Now that you have your icons prepared in a resource DLL, you are ready to 
  7140. extend the parts palette. To add a category to the parts palette, do the 
  7141. following: 
  7142.  
  7143.    1. In the Composition Editor, select Modify PaletteAdd New Category from 
  7144.       the Options pull-down menu. 
  7145.  
  7146.       The Add palette category window is displayed as follows: 
  7147.  
  7148.       Notice that the default category icon, , is specified. It is stored as 
  7149.       resource ID 150 in the dde4vr30.dll resource file provided with Visual 
  7150.       Builder. 
  7151.  
  7152.    2. Type OAModels or the name that you want for your category in the Category 
  7153.       name field. 
  7154.  
  7155.    3. Type cppov33r or the name of your resource DLL in the Module name field. 
  7156.  
  7157.       Note:  Do not type the .dll file extension in the Module name field. 
  7158.  
  7159.    4. Type 800 or the resource ID of the icon in your resource DLL in the ID 
  7160.       field. 
  7161.  
  7162.       Note:  After you enter the resource ID number, move the cursor to another 
  7163.              component in the window, such as the Module name field, if you 
  7164.              want to see the graphic that will be used before continuing. 
  7165.  
  7166.    5. Select the OK push button. 
  7167.  
  7168.  Your category with the icon specified is added to the parts palette. 
  7169.  
  7170.  The next step is specifying a unique icon for your part. 
  7171.  
  7172.  
  7173. ΓòÉΓòÉΓòÉ 52.3. Specify a unique icon for a part I add to the parts palette ΓòÉΓòÉΓòÉ
  7174.  
  7175. You can specify a unique icon for a part that you add to the parts palette, but 
  7176. you must do so before you add it to the parts palette. To give your part a 
  7177. unique icon, do the following: 
  7178.  
  7179.    1. Open the part. 
  7180.  
  7181.    2. Switch to the Class Editor. 
  7182.  
  7183.    3. Enter the name of the DLL file that contains the icon you want to use in 
  7184.       the DLL Name field. 
  7185.  
  7186.    4. Enter the resource ID number for the icon in the Resource Id field. 
  7187.  
  7188.       If you enter a valid DLL file name and resource ID number, Visual Builder 
  7189.       displays the icon below the Resource Id field. This allows you to verify 
  7190.       the icon before adding it to the parts palette. 
  7191.  
  7192.    5. Select FileSave to save the resource DLL and resource ID information in 
  7193.       the Class Editor. 
  7194.  
  7195.  The next step is adding a part to the parts palette. 
  7196.  
  7197.  
  7198. ΓòÉΓòÉΓòÉ 52.4. Add a part to the parts palette ΓòÉΓòÉΓòÉ
  7199.  
  7200. You can add a part to any category on the parts palette using any of the 
  7201. following methods: 
  7202.  
  7203.      Adding a part that is selected in the Visual Builder window 
  7204.  
  7205.      Adding the part that you are currently editing 
  7206.  
  7207.      Adding any part whose .vbb file is loaded 
  7208.  
  7209.  
  7210. ΓòÉΓòÉΓòÉ 52.4.1. Add a part that is selected in the Visual Builder window ΓòÉΓòÉΓòÉ
  7211.  
  7212. To add a part to the parts palette from the Visual Builder window, do the 
  7213. following: 
  7214.  
  7215.    1. Load the .vbb file that contains the part you want to add to the parts 
  7216.       palette if it is not already loaded. 
  7217.  
  7218.    2. Select the .vbb file. For this example, select oanonvis.vbb. 
  7219.  
  7220.    3. Select the part you want to add. For this example, select OAContractor. 
  7221.  
  7222.       Note:  You can add multiple parts by holding down the Ctrl key and 
  7223.              clicking on each part that you want to add. 
  7224.  
  7225.    4. Select PartAdd to palette. 
  7226.  
  7227.       Visual Builder displays the Add to Palette window, as shown in the 
  7228.       following figure: 
  7229.  
  7230.    5. Select the part that you want to add. For this example, select 
  7231.       OAContractor. 
  7232.  
  7233.    6. Select the category that you want to add the part to. For this example, 
  7234.       select OAModels. 
  7235.  
  7236.    7. Select the Add push button. 
  7237.  
  7238.       Visual Builder adds the OAContractor part to the parts palette in the 
  7239.       OAModels category. 
  7240.  
  7241.  
  7242. ΓòÉΓòÉΓòÉ 52.4.2. Add the part that I am currently editing ΓòÉΓòÉΓòÉ
  7243.  
  7244. You can add the part that you are currently editing to the parts palette from 
  7245. either the Composition Editor, the Class Editor, or the Part Interface Editor. 
  7246. To add the part that you are currently editing to the parts palette, do the 
  7247. following: 
  7248.  
  7249.    1. Double-click on the OAContractor part in the Visual Builder window. 
  7250.  
  7251.       Visual Builder opens the OAContractor part in the Part Interface Editor. 
  7252.  
  7253.    2. Select FileAdd to palette. 
  7254.  
  7255.       Visual Builder displays the Add to Palette window, as shown in the 
  7256.       following figure: 
  7257.  
  7258.       The Part name field shows the name of the part that you are editing. This 
  7259.       is the part that is to be added to the parts palette. You cannot change 
  7260.       the name of the part displayed in this field. In this example, 
  7261.       OAContractor is displayed in this field. 
  7262.  
  7263.    3. Select the category that you want to add the part to. For this example, 
  7264.       select OAModels. 
  7265.  
  7266.    4. Select the Add push button. 
  7267.  
  7268.       The OAContractor part is added to the OAModels category on the parts 
  7269.       palette. To see this, switch to the Composition Editor and select the 
  7270.       OAModels category. The icon for the OAContractor part is displayed in the 
  7271.       parts column. 
  7272.  
  7273.  
  7274. ΓòÉΓòÉΓòÉ 52.4.3. Add any part whose .vbb file is loaded ΓòÉΓòÉΓòÉ
  7275.  
  7276. You can add any part to the parts palette as long as its .vbb file is loaded in 
  7277. the Visual Builder window. The following steps explain how to do this: 
  7278.  
  7279.    1. In the Composition Editor, select Modify PaletteAdd New Part from the 
  7280.       Options pull-down menu. The Add to Palette window is displayed as 
  7281.       follows: 
  7282.  
  7283.       To add a part to the parts palette, do the following: 
  7284.  
  7285.         a. Type OAContractor in the Part name field or the class name of the 
  7286.            part you want to add. 
  7287.  
  7288.         b. Select OAModels in the Category list or the name of the category to 
  7289.            which you want to add your part. 
  7290.  
  7291.         c. Select the Add push button. 
  7292.  
  7293.            Your part is added to the parts palette in the specified category. 
  7294.  
  7295.  Notice that the part you just added uses the same icon as the part it inherits 
  7296.  from. If you inherit from a part whose icon does not appear on the parts 
  7297.  palette, such as IStandardNotifier*, or for which you have not provided a 
  7298.  resource DLL, Visual Builder uses the default part icon, . 
  7299.  
  7300.  The next section tells you how to delete a category or part from the parts 
  7301.  palette 
  7302.  
  7303.  
  7304. ΓòÉΓòÉΓòÉ 52.5. Delete a category or part from the parts palette ΓòÉΓòÉΓòÉ
  7305.  
  7306. To delete a part from the parts palette, do the following: 
  7307.  
  7308.    1. Select the part on the parts palette. 
  7309.  
  7310.    2. Select Modify PaletteDelete Part from the Options pull-down menu. 
  7311.  
  7312.       The selected part is deleted from the parts palette. 
  7313.  
  7314.  To delete a category from the parts palette, do the following: 
  7315.  
  7316.    1. Select the category on the parts palette. 
  7317.  
  7318.    2. Select Modify PaletteDelete Category from the Options pull-down menu. 
  7319.  
  7320.       The selected category and all of the parts in it are deleted from the 
  7321.       parts palette. 
  7322.  
  7323.  
  7324. ΓòÉΓòÉΓòÉ 52.6. Save parts palette changes ΓòÉΓòÉΓòÉ
  7325.  
  7326. Visual Builder automatically saves all parts palette changes for you. When you 
  7327. create a new category or part, Visual Builder stores information about that 
  7328. category or part in a file named vbpalet.dat, which is stored in your current 
  7329. directory. This file is written automatically. 
  7330.  
  7331. Removing a category or part that you just added 
  7332.  
  7333. The vbpalet.dat file also allows you to undo and redo any changes you make to 
  7334. the parts palette, but only during the current Composition Editor session. For 
  7335. example, after adding a category or part, you can select EditUndo to remove 
  7336. the part or category you just added. Selecting EditRedo would put the part or 
  7337. category back on the parts palette, again. 
  7338.  
  7339. Once you close the Composition Editor, you can no longer undo or redo any 
  7340. changes. However, you can still add categories and add parts, as well as delete 
  7341. categories and parts. 
  7342.  
  7343.  
  7344. ΓòÉΓòÉΓòÉ 53. ...Enable national language support for an application ΓòÉΓòÉΓòÉ
  7345.  
  7346.      Using resource files for translation 
  7347.  
  7348.      Using canvases to adjust size for translated text 
  7349.  
  7350.      Specifying parts with country-sensitive formatting 
  7351.  
  7352.      Providing double-byte character support for Asian languages 
  7353.  
  7354.  
  7355. ΓòÉΓòÉΓòÉ 53.1. Use resource files for translation ΓòÉΓòÉΓòÉ
  7356.  
  7357. In Generating Source Code for Parts and Applications, you learned that Visual 
  7358. Builder generates the following resource files for you: 
  7359.  
  7360.      A resource file (partname.rc), which contains the text strings used in 
  7361.       your part 
  7362.  
  7363.      A resource header file (partname.h), which contains the resource IDs for 
  7364.       your application 
  7365.  
  7366.  The resource (partname.rc) file 
  7367.  
  7368.  The .rc file groups resources into two categories:window resources and 
  7369.  nonwindow resources. The window resources are the text strings that are 
  7370.  associated with window IDs for information area text and fly-over text. 
  7371.  
  7372.  The nonwindow resources are the text strings that are displayed in your 
  7373.  composite part. Examples are window titles, static text used to label entry 
  7374.  fields and list boxes, and the text on push buttons and menu items. These text 
  7375.  strings are delimited by quotation marks (") and can be translated into 
  7376.  another language. 
  7377.  
  7378.  Here is the todolist.rc file that we generated for the To-Do List application 
  7379.  shown in Creating a Simple Visual Builder Application: 
  7380.  
  7381.   //*************************************************************
  7382.   // Resource file for: ToDoList.cpp
  7383.   //*************************************************************
  7384.   #include "ToDoList.h"
  7385.  
  7386.   #include <os2.h>
  7387.  
  7388.   #ifndef MAIN_RESOURCES_INCLUDED
  7389.   #define MAIN_RESOURCES_INCLUDED
  7390.  
  7391.   HELPTABLE WND_ToDoList
  7392.      BEGIN
  7393.         HELPITEM  WND_ToDoList_FrameWindow,  WND_ToDoList_FrameWindow,  0
  7394.      END
  7395.  
  7396.   #define ToDoList_WINDOWRESOURCES
  7397.   #define ToDoList_NONWINDOWRESOURCES
  7398.   STRINGTABLE
  7399.      BEGIN
  7400.         1,  "Visual Builder 3.0"
  7401.      END
  7402.  
  7403.   #endif
  7404.  
  7405.   #ifdef ToDoList_NONWINDOWRESOURCES
  7406.   #ifndef ToDoList_NONWINDOWRESOURCES_INCLUDED
  7407.   #define ToDoList_NONWINDOWRESOURCES_INCLUDED
  7408.   STRINGTABLE
  7409.      BEGIN
  7410.         STRRC_ToDoList_FrameWindow_title,  "To-Do List"
  7411.         STRRC_ToDoList_StaticText1_text,  "To-do item"
  7412.         STRRC_ToDoList_EntryField1_text,  ""
  7413.         STRRC_ToDoList_StaticText2_text,  "To-do list"
  7414.         STRRC_ToDoList_PushButton1_text,  "Add"
  7415.         STRRC_ToDoList_PushButton2_text,  "Remove"
  7416.      END
  7417.  
  7418.   #endif
  7419.   #endif
  7420.  
  7421.   #ifdef ToDoList_WINDOWRESOURCES
  7422.   HELPSUBTABLE (WND_ToDoList_FrameWindow)
  7423.      BEGIN
  7424.      END
  7425.  
  7426.   #endif
  7427.  
  7428.   #ifdef ToDoList_HELPITEMRESOURCES
  7429.         HELPITEM  WND_ToDoList_FrameWindow,  WND_ToDoList_FrameWindow,  0
  7430.   #endif
  7431.  
  7432.   #ifdef ToDoList_HELPSUBITEMRESOURCES
  7433.   #endif
  7434.  
  7435.  The window resources and nonwindow resources are grouped into separate string 
  7436.  tables so that translators can easily find the text that is to be translated. 
  7437.  
  7438.  You may have text strings in your part, such as the application name, that you 
  7439.  do not want translated. If that is the case, you can prevent those text 
  7440.  strings from being inserted in the .rc file by inserting a number sign (#) at 
  7441.  the beginning of the text and enclosing the text in quotation marks ("). This 
  7442.  change must be made in the settings notebook for the part, not in the 
  7443.  Composition Editor. 
  7444.  
  7445.  For example, suppose you do not want the text in the window title, To-Do List, 
  7446.  to be translated. To prevent Visual Builder from inserting this text string in 
  7447.  the .rc file, you would open the settings notebook for the ToDoList part, find 
  7448.  the entry field on the General page that contains the title text, and change 
  7449.  it to the following: 
  7450.  
  7451.   #"To-Do List"
  7452.  
  7453.  Notice that each text string that Visual Builder inserts in the .rc file is 
  7454.  preceded by a #define statement that begins with STRRC. These #define 
  7455.  statements represent the resource ID of each text string. Visual Builder 
  7456.  generates these #define statements and defines them in the partname.h file. By 
  7457.  inserting and defining these #define statements, Visual Builder relieves you 
  7458.  from the task of having to specify resource IDs for each text string. 
  7459.  
  7460.  To help Visual Builder generate these #define statements properly, you must 
  7461.  enter the starting resource ID for your part. The following section explains 
  7462.  how to do this. 
  7463.  
  7464.  The resource header (partname.h) file 
  7465.  
  7466.  The .h file contains a list of #define statements. Visual Builder uses these 
  7467.  #define statements in the .rc file to assign unique resource IDs to each of 
  7468.  the text strings that you use to create your composite part and a unique 
  7469.  window ID to all primitive visual parts. The only resource ID that you need to 
  7470.  specify is the starting resource ID for the part. 
  7471.  
  7472.  Here is the todolist.h file that we generated for the To-Do List application 
  7473.  shown in Creating a Simple Visual Builder Application: 
  7474.  
  7475.   //*************************************************************
  7476.   // Resource header file for: ToDoList.cpp
  7477.   //*************************************************************
  7478.   #ifndef _ICCONST_
  7479.   #include <icconst.h>
  7480.   #endif
  7481.  
  7482.   #ifndef _IVBDEFS_
  7483.   #include <ivbdefs.h>
  7484.   #endif
  7485.  
  7486.   #ifndef RC_ToDoList
  7487.   #define RC_ToDoList  10000
  7488.   #endif
  7489.  
  7490.   #ifndef WND_ToDoList
  7491.   #define WND_ToDoList  VBBASEWINDOWID
  7492.   #endif
  7493.  
  7494.   #define WNDOFFSET_ToDoList_FrameWindow  0
  7495.   #define WND_ToDoList_FrameWindow  WND_ToDoList
  7496.   #define STRRC_ToDoList_FrameWindow_title  RC_ToDoList+0
  7497.  
  7498.   #define WNDOFFSET_ToDoList_Canvas  1
  7499.   #define WND_ToDoList_Canvas  WND_ToDoList + WNDOFFSET_ToDoList_Canvas
  7500.  
  7501.   #define WNDOFFSET_ToDoList_StaticText1  2
  7502.   #define WND_ToDoList_StaticText1  WND_ToDoList + WNDOFFSET_ToDoList_StaticText1
  7503.   #define STRRC_ToDoList_StaticText1_text  RC_ToDoList+1
  7504.  
  7505.   #define WNDOFFSET_ToDoList_EntryField1  3
  7506.   #define WND_ToDoList_EntryField1  WND_ToDoList + WNDOFFSET_ToDoList_EntryField1
  7507.   #define STRRC_ToDoList_EntryField1_text  RC_ToDoList+2
  7508.  
  7509.   #define WNDOFFSET_ToDoList_StaticText2  4
  7510.   #define WND_ToDoList_StaticText2  WND_ToDoList + WNDOFFSET_ToDoList_StaticText2
  7511.   #define STRRC_ToDoList_StaticText2_text  RC_ToDoList+3
  7512.  
  7513.   #define WNDOFFSET_ToDoList_PushButton1  5
  7514.   #define WND_ToDoList_PushButton1  WND_ToDoList + WNDOFFSET_ToDoList_PushButton1
  7515.   #define STRRC_ToDoList_PushButton1_text  RC_ToDoList+4
  7516.  
  7517.   #define WNDOFFSET_ToDoList_PushButton2  6
  7518.   #define WND_ToDoList_PushButton2  WND_ToDoList + WNDOFFSET_ToDoList_PushButton2
  7519.   #define STRRC_ToDoList_PushButton2_text  RC_ToDoList+5
  7520.  
  7521.   #define WNDOFFSET_ToDoList_ListBox1  7
  7522.   #define WND_ToDoList_ListBox1  WND_ToDoList + WNDOFFSET_ToDoList_ListBox1
  7523.  
  7524.  
  7525.  Find the first #define statement in the todolist.h file. It is the RC_ToDoList 
  7526.  #define statement. The number to the right of this #define statement, 10000, 
  7527.  is the starting resource ID. This is the default number that Visual Builder 
  7528.  inserts when you select the check box next to the Starting resource id field 
  7529.  in the Class Editor. Visual Builder uses this number as the resource ID of the 
  7530.  first text string and increments the resource ID of each successive text 
  7531.  string by 1. 
  7532.  
  7533.  We chose to use the default number 10000 for the following reasons: 
  7534.  
  7535.      The resource ID must be a number. 
  7536.  
  7537.      The number specified must be either high enough or low enough that it 
  7538.       does not conflict with the resource IDs that Visual Builder generates for 
  7539.       the primitive parts (entry field, push buttons, and so forth) that are 
  7540.       used to compose the ToDoList part. 
  7541.  
  7542.  When determining resource IDs for window resources, Visual Builder begins with 
  7543.  15000 and increments the resource ID of each successive primitive part by 5. 
  7544.  Therefore, we recommend using starting resource IDs between 100 and 14500 for 
  7545.  most applications for the following reasons: 
  7546.  
  7547.      You should not use resource IDs below 100 because Presentation Manager 
  7548.       has reserved many of them for its own use. 
  7549.  
  7550.      Numbers between 100 and 14500 are low enough to prevent you from 
  7551.       experiencing any resource ID conflicts in most cases. 
  7552.  
  7553.  Specifying the starting resource ID for subparts 
  7554.  
  7555.  If you use a part that you have created as a subpart, specify a starting 
  7556.  resource ID for both the subpart and the part in which the subpart is 
  7557.  embedded. Do this to prevent conflicts between the resource IDs that Visual 
  7558.  Builder generates for your subpart and those it generates for the part in 
  7559.  which the subpart is embedded, as described in the preceding section. 
  7560.  Otherwise, Visual Builder uses the same starting resource IDs for both the 
  7561.  subpart and the part in which it is embedded, which causes compile errors. 
  7562.  
  7563.  For example, suppose you have a reusable Address part (a canvas with entry 
  7564.  fields and static text) that you want to embed as a subpart in the frame 
  7565.  window of your application's main view. You might give the main view a 
  7566.  starting resource ID of 5000 and the Address part a starting resource ID of 
  7567.  6000. Doing this would prevent conflicts with the resource IDs that Visual 
  7568.  Builder generates for the main view and those it generates for the Address 
  7569.  part. 
  7570.  
  7571.  
  7572. ΓòÉΓòÉΓòÉ 53.2. Use canvases to adjust size for translated text ΓòÉΓòÉΓòÉ
  7573.  
  7574. When text is translated from one language to another, the translated text often 
  7575. occupies more space than the original text occupied. This can cause problems 
  7576. because the layout of the user interface can be disrupted by the longer text 
  7577. strings. 
  7578.  
  7579. Two of the canvas parts that Visual Builder provides solve this problem for 
  7580. you:  ISetCanvas* and IMultiCellCanvas*. These parts allow you to insert 
  7581. translated text and rebuild your application without having to change the 
  7582. position of any of the parts in the user interface. The ISetCanvas* and 
  7583. IMultiCellCanvas* parts automatically adjust their size at run time to allow 
  7584. for longer text strings, taking into account the current window's text size and 
  7585. font. 
  7586.  
  7587. For example, suppose you are using an ISetCanvas* part with three vertical 
  7588. decks and three rows of IRadioButton* parts in each deck. Once the text strings 
  7589. for the IRadioButton* parts are translated, all you have to do is rebuild your 
  7590. application. The decks in the ISetCanvas* part automatically adjust their 
  7591. widths to allow for the size of the translated text strings. 
  7592.  
  7593. The IMultiCellCanvas part is also good for translation purposes because the 
  7594. rows and columns automatically adjust themselves to fit the translated text. 
  7595.  
  7596.  
  7597. ΓòÉΓòÉΓòÉ 53.3. Specify parts with country-sensitive formatting ΓòÉΓòÉΓòÉ
  7598.  
  7599. Visual Builder provides the following class interface parts that allow you to 
  7600. specify how information is presented for specific national languages: 
  7601.  
  7602.  IDate      This part allows you to customize the date formatting for the 
  7603.             selected part. This includes specifying the order for the month, 
  7604.             day, and year, and the character to use as a separator. 
  7605.  
  7606.  ITime      This part allows you to customize the time formatting for the 
  7607.             selected part. This includes specifying the 12- or 24-hour format 
  7608.             and the character to use as a separator. 
  7609.  
  7610.  
  7611. ΓòÉΓòÉΓòÉ 53.4. Provide double-byte character support for Asian languages ΓòÉΓòÉΓòÉ
  7612.  
  7613. The following Visual Builder parts provide DBCS support: 
  7614.  
  7615.  IBuffer 
  7616.    Class interface part that defines the contents of an IString. This part 
  7617.    provides attributes to determine whether part or all of the characters in a 
  7618.    buffer are DBCS or multi-byte character set (MBCS) characters, and whether 
  7619.    they are valid DBCS or MBCS characters. 
  7620.  
  7621.  IDBCSBuffer 
  7622.    Class interface part that implements the version of IString contents that 
  7623.    supports mixed OS/2 DBCS characters. This part ensures that MBCS characters 
  7624.    are processed properly. 
  7625.  
  7626.  IEntryField 
  7627.    Visual part that creates and manages an entry field control. On the General 
  7628.    page of the settings notebook for this part, you can specify the type of 
  7629.    data that the user can enter. It can be one of the following: 
  7630.  
  7631.    SBCS           Sets the entry field to accept SBCS text only. 
  7632.  
  7633.    DBCS           Sets the entry field to accept DBCS text only. 
  7634.  
  7635.    Mixed          Sets the entry field to accept text that is a mixture of SBCS 
  7636.                   and DBCS characters. Conversion from an ASCII DBCS code page 
  7637.                   to an EBCDIC DBCS code page can result in a possible increase 
  7638.                   in the length of the data because of the addition of shift-in 
  7639.                   and shift-out characters, but it does not exceed the text 
  7640.                   limit of the entry field. 
  7641.  
  7642.    Any            Sets the entry field to accept text that is a mixture of SBCS 
  7643.                   and DBCS characters. This setting is the opposite of mixed. 
  7644.                   If the text contains both SBCS and DBCS characters and is to 
  7645.                   be converted from an ASCII code page into an EBCDIC code 
  7646.                   page, this style causes an entry field to not account for 
  7647.                   shift-in and shift-out characters that would be introduced 
  7648.                   into its text. 
  7649.  
  7650.  IFrameWindow 
  7651.    Visual part that creates and manages a frame window control. This part has a 
  7652.    style option, appDBCSStatus, that includes a DBCS status area in the frame 
  7653.    window when it is displayed in a DBCS environment. IFrameWindow also has a 
  7654.    member function, shareParentDBCSStatus, that causes a child frame window to 
  7655.    share the DBCS status area of its parent. 
  7656.  
  7657.  IKeyboardEvent 
  7658.    Class interface part that represents a keyboard-related event. An 
  7659.    IKeyboardEvent object is created by a keyboard handler when a user presses 
  7660.    or releases a key. The part provides a virtualKey attribute that returns the 
  7661.    virtual key code of the key. Two of the codes it can return are firstDBCS 
  7662.    and lastDBCS. 
  7663.  
  7664.  IString 
  7665.    Class interface part that is an array of characters. This part provides 
  7666.    attributes to determine whether part or all of the characters in a string 
  7667.    are DBCS or MBCS characters, and whether they are valid DBCS or MBCS 
  7668.    characters. 
  7669.  
  7670.  
  7671. ΓòÉΓòÉΓòÉ 54. ...Use Direct-to-SOM objects in Visual Builder applications ΓòÉΓòÉΓòÉ
  7672.  
  7673.      Creating and importing the part information file 
  7674.  
  7675.      Using DTS objects in a Visual Builder application 
  7676.  
  7677.      Bypassing DTS limitations 
  7678.  
  7679.  
  7680. ΓòÉΓòÉΓòÉ 54.1. Create and import the part information file ΓòÉΓòÉΓòÉ
  7681.  
  7682. In Defining the Part Interface Using Part Information Files, you learned how to 
  7683. create a part information file. Create a file like this for your DTS objects. 
  7684. There are only two requirements when creating this file: 
  7685.  
  7686.      DTS objects can only have actions. This makes DTS objects the equivalent 
  7687.       of class interface parts because they have no notification capability. 
  7688.       Therefore, you must set the VBComposerInfo statement for each DTS object 
  7689.       to class. 
  7690.  
  7691.      Since DTS objects can only have actions, you cannot code any attributes 
  7692.       or events in your part information file. 
  7693.  
  7694.  The following example shows a part information file, mydtsdt.vbe, that 
  7695.  contains the information for the following sample DTS objects: 
  7696.  
  7697.  MyDTSDate      Returns the current date. 
  7698.  
  7699.  MyDTSTime      Returns the current time. 
  7700.  
  7701.   //
  7702.   // SOM classes as Visual Builder classes
  7703.   //
  7704.   //VBBeginPartInfo: MyDTSDate, "My DTS SOM Date Class"
  7705.   //VBIncludes: "mydtsdat.hh" MyDTSDate_hh
  7706.   //VBPartDataFile: 'mydtsdt.vbb'
  7707.   //VBLibFile: 'mydtsdat.lib'
  7708.   //VBComposerInfo: class
  7709.   //VBAction: getTodaysDate
  7710.   //VB:       ,"Get today's date action.",char*,
  7711.   //VB:       char* getTodaysDate()
  7712.   //VBPreferredFeatures: this, getTodaysDate
  7713.   //VBEndPartInfo: MyDTSDate
  7714.   //
  7715.   //VBBeginPartInfo: MyDTSTime, "My DTS SOM Time Class"
  7716.   //VBIncludes: "mydtstim.hh" MyDTSTime_hh
  7717.   //VBPartDataFile: 'mydtsdt.vbb'
  7718.   //VBLibFile: 'mydtstim.lib'
  7719.   //VBComposerInfo: class
  7720.   //VBAction: getCurrentTime
  7721.   //VB:       ,"Get current time action.",char*,
  7722.   //VB:       char* getCurrentTime()
  7723.   //VBPreferredFeatures: this, getCurrentTime
  7724.   //VBEndPartInfo: MyDTSTime
  7725.   //
  7726.  
  7727.  The mydtsdt.vbe file contains statements that refer to the following files 
  7728.  that are needed for each of the sample DTS objects: 
  7729.  
  7730.  mydtsdat.hh and mydtstim.hh The header files for the MyDTSDate and MyDTSTime 
  7731.                 SOM classes. 
  7732.  
  7733.  mydtsdat.lib and mydtstim.lib The library files that were created when the DTS 
  7734.                 objects were compiled. 
  7735.  
  7736.  mydtsdt.vbb    The part (.vbb) file that is to contain the information about 
  7737.                 the DTS parts when you import the part information from the 
  7738.                 mydtsdt.vbe file. You must load the mydtsdt.vbb file into 
  7739.                 Visual Builder before you can add the MyDTSDate and MyDTSTime 
  7740.                 parts to the free-form surface in the Composition Editor. 
  7741.  
  7742.  Once you create your part information file, you must import it into Visual 
  7743.  Builder before you can use your DTS objects in a Visual Builder application. 
  7744.  For information on how to do this, see Importing Part Information. 
  7745.  
  7746.  The next step is using DTS objects in a Visual Builder application. 
  7747.  
  7748.  
  7749. ΓòÉΓòÉΓòÉ 54.2. Use DTS objects in a Visual Builder application ΓòÉΓòÉΓòÉ
  7750.  
  7751. Using DTS objects in a Visual Builder application is no different from using a 
  7752. class interface part. You simply place the DTS objects on the free-form surface 
  7753. and make the necessary connections to use their actions. 
  7754.  
  7755. The following figure shows how we used the MyDTSDate and MyDTSTime objects in a 
  7756. simple application. 
  7757.  
  7758. To create the application, we placed the MyDTSDate and MyDTSTime parts on the 
  7759. free-form surface by selecting OptionsAdd part and providing the necessary 
  7760. information in the Add Part window for each part. 
  7761.  
  7762. In this application, when a user clicks on the Current push button, the 
  7763. buttonClickEvent feature causes the getTodaysDate and getTodaysTime actions to 
  7764. get the date and time that is currently set in your computer's operating 
  7765. system. In addition, the actionResult attribute of each connection updates the 
  7766. text attribute of each entry field with the result of the two actions, the 
  7767. current date and time. 
  7768.  
  7769. Earlier, we mentioned that actions in DTS classes can return only basic C data 
  7770. types. The getTodaysDate and getTodaysTime actions in our example both return a 
  7771. data type of char*. Therefore, when we connected the actionResult attribute to 
  7772. the text attribute of the entry field, Visual Builder displayed a message 
  7773. saying that the types did not match and asking if we wanted to continue. In 
  7774. this case, we could make the connection because IString has a constructor that 
  7775. takes a char*. You can find out whether to complete a connection in situations 
  7776. like this by looking at the IBM Open Class Library Reference. 
  7777.  
  7778.            When you have generated your code and are ready to compile your 
  7779.            application, make sure you have the .hh and .lib files that contain 
  7780.            the code for your DTS objects in the current directory. Also, make 
  7781.            sure the SOM Toolkit is installed because the VisualAge C++ compiler 
  7782.            must have access to several of its files. 
  7783.  
  7784.            When you are ready to run your application, the .dll for the DTS 
  7785.            objects must be accessible. 
  7786.  
  7787.  
  7788. ΓòÉΓòÉΓòÉ 54.3. Bypass DTS limitations ΓòÉΓòÉΓòÉ
  7789.  
  7790. Earlier, we told you that DTS objects have certain limitations, such as not 
  7791. being able to use attributes and events, and not being able to notify other 
  7792. parts. You can bypass these limitations by using nonvisual parts to manage the 
  7793. things your DTS objects cannot do. 
  7794.  
  7795. In the example shown in Using DTS Objects in a Visual Builder Application, we 
  7796. could have created two nonvisual parts called MyDate and MyTime in addition to 
  7797. the two DTS parts, MyDTSDate and MyDTSTime. We could give these nonvisual parts 
  7798. attributes such as theDate and theTime and notify other parts when the values 
  7799. of these attributes change. We could also give these attributes get and set 
  7800. member functions that call actions in the DTS objects to get and set the values 
  7801. of the attributes. 
  7802.  
  7803. Once this is done, we would place the nonvisual parts MyDate and MyTime on the 
  7804. free-form surface, instead of MyDTSDate and MyDTSTime, and make the same 
  7805. connections as described previously. 
  7806.  
  7807.  
  7808. ΓòÉΓòÉΓòÉ 55. Glossary ΓòÉΓòÉΓòÉ
  7809.  
  7810.  
  7811. ΓòÉΓòÉΓòÉ <hidden> Glossary description ΓòÉΓòÉΓòÉ
  7812.  
  7813. This glossary defines terms and abbreviations that are used in this book. If 
  7814. you do not find the term you are looking for, refer to the IBM Dictionary of 
  7815. Computing, New York:McGraw-Hill, 1994. 
  7816.  
  7817. This glossary includes terms and definitions from the American National 
  7818. Standard Dictionary for Information Systems, ANSI X3.172-1990, copyright 1990 
  7819. by the American National Standards Institute (ANSI). Copies may be purchased 
  7820. from the American National Standards Institute, 1430 Broadway, New York, New 
  7821. York 10018. 
  7822.  
  7823.  
  7824. ΓòÉΓòÉΓòÉ <hidden> Glossary listing ΓòÉΓòÉΓòÉ
  7825.  
  7826. A
  7827. abstract class
  7828. access
  7829. action
  7830. argument
  7831. attribute
  7832. attribute-to-action connection
  7833. attribute-to-attribute connection
  7834. attribute-to-member function connection
  7835. B
  7836. base class
  7837. behavior
  7838. C
  7839. caller
  7840. category
  7841. class
  7842. Class Editor
  7843. class hierarchy
  7844. class library
  7845. class member function
  7846. client area object
  7847. client object
  7848. collection
  7849. Common User Access (CUA)
  7850. composite part
  7851. Composition Editor
  7852. concrete class
  7853. connection
  7854. const
  7855. construction from parts
  7856. constructor
  7857. CUA
  7858. cursored emphasis
  7859. custom logic connection
  7860. D
  7861. data abstraction
  7862. data member
  7863. data model
  7864. data object
  7865. declaration
  7866. DEF file
  7867. derivation
  7868. destructor
  7869. DLL
  7870. dynamic link library (DLL)
  7871. E
  7872. encapsulation
  7873. event
  7874. event-to-action connection
  7875. event-to-attribute connection
  7876. event-to-member function connection
  7877. expansion area
  7878. F
  7879. feature
  7880. full attribute
  7881. free-form surface
  7882. G
  7883. graphical user interface (GUI)
  7884. GUI
  7885. H
  7886. handles
  7887. header file
  7888. I
  7889. inheritance
  7890. instance
  7891. L
  7892. legacy code
  7893. loaded
  7894. M
  7895. main part
  7896. member
  7897. member function
  7898. member function call
  7899. member function name
  7900. message
  7901. model
  7902. module definition file
  7903. N
  7904. nested class
  7905. nonvisual part
  7906. no-event attribute
  7907. no-set attribute
  7908. notebook part
  7909. O
  7910. object
  7911. object class
  7912. object factory
  7913. object-oriented programming
  7914. observer
  7915. operation
  7916. overloading
  7917. P
  7918. palette
  7919. parameter connection
  7920. parent class
  7921. part
  7922. part event
  7923. part event ID
  7924. part interface
  7925. Part Interface Editor
  7926. parts palette
  7927. preferred features
  7928. primary selection
  7929. private
  7930. process
  7931. program
  7932. protected
  7933. prototype
  7934. primitive part
  7935. process
  7936. property
  7937. pure virtual function
  7938. R
  7939. receiver
  7940. resource file
  7941. S
  7942. selection handles
  7943. server
  7944. service
  7945. settings view
  7946. sticky
  7947. structure
  7948. subpart
  7949. superclass
  7950. T
  7951. tear-off attribute
  7952. template
  7953. thread
  7954. tool bar
  7955. U
  7956. UI
  7957. unloaded
  7958. user interface (UI)
  7959. V
  7960. variable
  7961. view
  7962. virtual function
  7963. visual part
  7964. visual programming tool
  7965. W
  7966. white space
  7967. window
  7968.  
  7969.  
  7970. ΓòÉΓòÉΓòÉ <hidden> abstract class ΓòÉΓòÉΓòÉ
  7971.  
  7972. A class that provides common behavior across a set of subclasses but is not 
  7973. itself designed to have instances that work. An abstract class represents a 
  7974. concept; classes derived from it represent implementations of the concept. For 
  7975. example, IControl is the abstract base class for control view windows; the 
  7976. ICanvas and IListBox classes are controls derived from IControl. An abstract 
  7977. class must have at least one pure virtual function. 
  7978.  
  7979. See also  base class. 
  7980.  
  7981.  
  7982. ΓòÉΓòÉΓòÉ <hidden> access ΓòÉΓòÉΓòÉ
  7983.  
  7984. A property of a class that determines whether a class member is accessible in 
  7985. an expression or declaration. 
  7986.  
  7987.  
  7988. ΓòÉΓòÉΓòÉ <hidden> action ΓòÉΓòÉΓòÉ
  7989.  
  7990. A specification of a function that a part can perform. The visual builder uses 
  7991. action specifications to generate connections between parts. Actions are 
  7992. resolved to member function calls in the generated code. 
  7993.  
  7994. Compare to  event and  attribute. 
  7995.  
  7996.  
  7997. ΓòÉΓòÉΓòÉ <hidden> argument ΓòÉΓòÉΓòÉ
  7998.  
  7999. A data element, or value, included as part of a member function call. Arguments 
  8000. provide additional information that the called member function can use to 
  8001. perform the requested operation. 
  8002.  
  8003.  
  8004. ΓòÉΓòÉΓòÉ <hidden> attribute ΓòÉΓòÉΓòÉ
  8005.  
  8006. A specification of a property of a part. For example, a customer part could 
  8007. have a name attribute and an address attribute. An attribute can itself be a 
  8008. part with its own behavior and attributes. 
  8009.  
  8010. The visual builder uses attribute specifications to generate code to get and 
  8011. set part properties. 
  8012.  
  8013. Compare to  event and  action. 
  8014.  
  8015.  
  8016. ΓòÉΓòÉΓòÉ <hidden> attribute-to-action connection ΓòÉΓòÉΓòÉ
  8017.  
  8018. A connection that starts an action whenever an attribute's value changes. It is 
  8019. similar to an event-to-action connection because the attribute's event ID is 
  8020. used to notify the action when the value of the attribute changes. 
  8021.  
  8022. See also  connection. Compare to  event-to-action connection. 
  8023.  
  8024.  
  8025. ΓòÉΓòÉΓòÉ <hidden> attribute-to-attribute connection ΓòÉΓòÉΓòÉ
  8026.  
  8027. A connection from an attribute of one part to an attribute of another part. 
  8028. When one attribute is updated, the other attribute is updated automatically. 
  8029.  
  8030. See also  connection. 
  8031.  
  8032.  
  8033. ΓòÉΓòÉΓòÉ <hidden> attribute-to-member function connection ΓòÉΓòÉΓòÉ
  8034.  
  8035. A connection from an attribute of a part to a member function. The connected 
  8036. attribute receives its value from the member function, which can make 
  8037. calculations based on the values of other parts. 
  8038.  
  8039. See also  connection. 
  8040.  
  8041.  
  8042. ΓòÉΓòÉΓòÉ <hidden> base class ΓòÉΓòÉΓòÉ
  8043.  
  8044. A class from which other classes or parts are derived. A base class may itself 
  8045. be derived from another base class. 
  8046.  
  8047. See also  abstract class. 
  8048.  
  8049.  
  8050. ΓòÉΓòÉΓòÉ <hidden> behavior ΓòÉΓòÉΓòÉ
  8051.  
  8052. The set of external characteristics that an object exhibits. 
  8053.  
  8054.  
  8055. ΓòÉΓòÉΓòÉ <hidden> caller ΓòÉΓòÉΓòÉ
  8056.  
  8057. An object that sends a member function call to another object. 
  8058.  
  8059. Contrast with  receiver. 
  8060.  
  8061.  
  8062. ΓòÉΓòÉΓòÉ <hidden> category ΓòÉΓòÉΓòÉ
  8063.  
  8064. In the Composition Editor, a selectable grouping of parts represented by an 
  8065. icon in the left-most column. Selecting a category displays the parts belonging 
  8066. to that category in the next column. 
  8067.  
  8068. See also  parts palette. 
  8069.  
  8070.  
  8071. ΓòÉΓòÉΓòÉ <hidden> class ΓòÉΓòÉΓòÉ
  8072.  
  8073. An aggregate that can contain functions, types, and user-defined operators, in 
  8074. addition to data. Classes can be defined hierarchically, allowing one class to 
  8075. be an expansion of another, and can restrict access to its members. 
  8076.  
  8077.  
  8078. ΓòÉΓòÉΓòÉ <hidden> Class Editor ΓòÉΓòÉΓòÉ
  8079.  
  8080. The editor you use to specify the names of files that Visual Builder writes to 
  8081. when you generate default code. You can also use this editor to do the 
  8082. following: 
  8083.  
  8084.      Enter a description of the part 
  8085.      Specify a different .vbb file in which to store the part 
  8086.      See the name of the part's base class 
  8087.      Modify the part's default constructor 
  8088.      Enter additional constructor and destructor code 
  8089.      Specify a .lib file for the part 
  8090.      Specify a resource DLL and ID to assign an icon to the part 
  8091.      Specify other files that you want to include when you build your 
  8092.       application 
  8093.  
  8094.  Compare to  Composition Editor and  Part Interface Editor. 
  8095.  
  8096.  
  8097. ΓòÉΓòÉΓòÉ <hidden> class hierarchy ΓòÉΓòÉΓòÉ
  8098.  
  8099. A tree-like structure showing relationships among object classes. It places one 
  8100. abstract class at the top (a base class) and one or more layers of less 
  8101. abstract classes below it. 
  8102.  
  8103.  
  8104. ΓòÉΓòÉΓòÉ <hidden> class library ΓòÉΓòÉΓòÉ
  8105.  
  8106. A collection of classes. 
  8107.  
  8108.  
  8109. ΓòÉΓòÉΓòÉ <hidden> class member function ΓòÉΓòÉΓòÉ
  8110.  
  8111. See  member function. 
  8112.  
  8113.  
  8114. ΓòÉΓòÉΓòÉ <hidden> client area object ΓòÉΓòÉΓòÉ
  8115.  
  8116. An intermediate window between a frame window (IFrameWindow) and its controls 
  8117. and other child windows. 
  8118.  
  8119.  
  8120. ΓòÉΓòÉΓòÉ <hidden> client object ΓòÉΓòÉΓòÉ
  8121.  
  8122. An object that requests services from other objects. 
  8123.  
  8124.  
  8125. ΓòÉΓòÉΓòÉ <hidden> collection ΓòÉΓòÉΓòÉ
  8126.  
  8127. A set of features in which each feature is an object. 
  8128.  
  8129.  
  8130. ΓòÉΓòÉΓòÉ <hidden> Common User Access (CUA) ΓòÉΓòÉΓòÉ
  8131.  
  8132. An IBM architecture for designing graphical user interfaces using a set of 
  8133. standard components and terminology. 
  8134.  
  8135.  
  8136. ΓòÉΓòÉΓòÉ <hidden> composite part ΓòÉΓòÉΓòÉ
  8137.  
  8138. A part that is composed of a part and one or more subparts. A composite part 
  8139. can contain visual parts, nonvisual parts, or both. 
  8140.  
  8141. See also  nonvisual part, part, subpart, and  visual part. 
  8142.  
  8143.  
  8144. ΓòÉΓòÉΓòÉ <hidden> Composition Editor ΓòÉΓòÉΓòÉ
  8145.  
  8146. A view that is used to build a graphical user interface and to make connections 
  8147. between parts. 
  8148.  
  8149. Compare to  Class Editor and  Part Interface Editor. 
  8150.  
  8151.  
  8152. ΓòÉΓòÉΓòÉ <hidden> concrete class ΓòÉΓòÉΓòÉ
  8153.  
  8154. A subclass of an abstract class that is a specialization of the abstract class. 
  8155.  
  8156.  
  8157. ΓòÉΓòÉΓòÉ <hidden> connection ΓòÉΓòÉΓòÉ
  8158.  
  8159. A formal, explicit relationship between parts. Making connections is the basic 
  8160. technique for building any visual application because that defines the way in 
  8161. which parts communicate with one another. The visual builder generates the code 
  8162. that then implements these connections. 
  8163.  
  8164. See also  attribute-to-action connection, attribute-to-attribute connection, 
  8165. attribute-to-member function connection, parameter connection, custom logic 
  8166. connection, event-to-action connection, event-to-attribute connection, and 
  8167. event-to-member function connection. 
  8168.  
  8169.  
  8170. ΓòÉΓòÉΓòÉ <hidden> const ΓòÉΓòÉΓòÉ
  8171.  
  8172. An attribute of a data object that declares that the object cannot be changed. 
  8173.  
  8174.  
  8175. ΓòÉΓòÉΓòÉ <hidden> construction from parts ΓòÉΓòÉΓòÉ
  8176.  
  8177. A software development technology in which applications are assembled from 
  8178. existing and reusable software components, known as parts. 
  8179.  
  8180.  
  8181. ΓòÉΓòÉΓòÉ <hidden> constructor ΓòÉΓòÉΓòÉ
  8182.  
  8183. A special class member function that has the same name as the class and is used 
  8184. to construct and possibly initialize class objects. 
  8185.  
  8186.  
  8187. ΓòÉΓòÉΓòÉ <hidden> CUA ΓòÉΓòÉΓòÉ
  8188.  
  8189. See  Common User Access. 
  8190.  
  8191.  
  8192. ΓòÉΓòÉΓòÉ <hidden> cursored emphasis ΓòÉΓòÉΓòÉ
  8193.  
  8194. When the selection cursor is on a choice, that choice has cursored emphasis. 
  8195.  
  8196.  
  8197. ΓòÉΓòÉΓòÉ <hidden> custom logic connection ΓòÉΓòÉΓòÉ
  8198.  
  8199. A connection that causes your customized C or C++ code to be run. This 
  8200. connection can be triggered either when an attribute's value changes or an 
  8201. event occurs. 
  8202.  
  8203.  
  8204. ΓòÉΓòÉΓòÉ <hidden> data abstraction ΓòÉΓòÉΓòÉ
  8205.  
  8206. A data type with a private representation and a public set of operations. The 
  8207. C++ language uses the concept of classes to implement data abstraction. 
  8208.  
  8209.  
  8210. ΓòÉΓòÉΓòÉ <hidden> data member ΓòÉΓòÉΓòÉ
  8211.  
  8212. Private data that belongs to a given object and is hidden from direct access by 
  8213. all other objects. Data members can only be accessed by the member functions of 
  8214. the defining class and its subclasses. 
  8215.  
  8216.  
  8217. ΓòÉΓòÉΓòÉ <hidden> data model ΓòÉΓòÉΓòÉ
  8218.  
  8219. A combination of the base classes and parts shipped with the product and the 
  8220. classes and parts you save and create. They are saved in a file named 
  8221. vbbase.vbb. 
  8222.  
  8223.  
  8224. ΓòÉΓòÉΓòÉ <hidden> data object ΓòÉΓòÉΓòÉ
  8225.  
  8226. A storage area used to hold a value. 
  8227.  
  8228.  
  8229. ΓòÉΓòÉΓòÉ <hidden> declaration ΓòÉΓòÉΓòÉ
  8230.  
  8231. A description that makes an external object or function available to a function 
  8232. or a block. 
  8233.  
  8234.  
  8235. ΓòÉΓòÉΓòÉ <hidden> DEF file ΓòÉΓòÉΓòÉ
  8236.  
  8237. See  module definition file. 
  8238.  
  8239.  
  8240. ΓòÉΓòÉΓòÉ <hidden> derivation ΓòÉΓòÉΓòÉ
  8241.  
  8242. The creation of a new or abstract class from an existing or base class. 
  8243.  
  8244.  
  8245. ΓòÉΓòÉΓòÉ <hidden> destructor ΓòÉΓòÉΓòÉ
  8246.  
  8247. A special class member function that has the same name as the class and is used 
  8248. to destruct class objects. 
  8249.  
  8250.  
  8251. ΓòÉΓòÉΓòÉ <hidden> DLL ΓòÉΓòÉΓòÉ
  8252.  
  8253. See  dynamic link library. 
  8254.  
  8255.  
  8256. ΓòÉΓòÉΓòÉ <hidden> dynamic link library (DLL) ΓòÉΓòÉΓòÉ
  8257.  
  8258. In OS/2, a library containing data and code objects that can be used by 
  8259. programs or applications during loading or at run time. Although they are not 
  8260. part of the program's executable (.exe) file, they are sometimes required for 
  8261. an .exe file to run properly. 
  8262.  
  8263.  
  8264. ΓòÉΓòÉΓòÉ <hidden> encapsulation ΓòÉΓòÉΓòÉ
  8265.  
  8266. The hiding of a software object's internal representation. The object provides 
  8267. an interface that queries and manipulates the data without exposing its 
  8268. underlying structure. 
  8269.  
  8270.  
  8271. ΓòÉΓòÉΓòÉ <hidden> event ΓòÉΓòÉΓòÉ
  8272.  
  8273. A specification of a notification from a part. 
  8274.  
  8275. Compare to  action, attribute, and  part event. 
  8276.  
  8277.  
  8278. ΓòÉΓòÉΓòÉ <hidden> event-to-action connection ΓòÉΓòÉΓòÉ
  8279.  
  8280. A connection that causes an action to be performed when an event occurs. 
  8281.  
  8282. See also  connection. 
  8283.  
  8284.  
  8285. ΓòÉΓòÉΓòÉ <hidden> event-to-attribute connection ΓòÉΓòÉΓòÉ
  8286.  
  8287. A connection that changes the value of an attribute when a certain event 
  8288. occurs. 
  8289.  
  8290. See also  connection. 
  8291.  
  8292.  
  8293. ΓòÉΓòÉΓòÉ <hidden> event-to-member function connection ΓòÉΓòÉΓòÉ
  8294.  
  8295. A connection from an event of a part to a member function. When the connected 
  8296. event occurs, the member function is executed. 
  8297.  
  8298. See also  connection. 
  8299.  
  8300.  
  8301. ΓòÉΓòÉΓòÉ <hidden> expansion area ΓòÉΓòÉΓòÉ
  8302.  
  8303. The section of a multicell canvas between the current cell grid and the outer 
  8304. edge of the canvas. Visually, this area is bounded by the rightmost column 
  8305. gridline and the bottommost row gridline. 
  8306.  
  8307.  
  8308. ΓòÉΓòÉΓòÉ <hidden> feature ΓòÉΓòÉΓòÉ
  8309.  
  8310. A major component of a software product that can be installed separately. 
  8311.  
  8312. In Visual Builder, an action, attribute, or event that is available from a 
  8313. part's part interface and that other parts can connect to. 
  8314.  
  8315.  
  8316. ΓòÉΓòÉΓòÉ <hidden> full attribute ΓòÉΓòÉΓòÉ
  8317.  
  8318. An attribute that has all of the behaviors and characteristics that an 
  8319. attribute can have:  a data member, a get member function, a set member 
  8320. function, and an event identifier. 
  8321.  
  8322.  
  8323. ΓòÉΓòÉΓòÉ <hidden> free-form surface ΓòÉΓòÉΓòÉ
  8324.  
  8325. The large open area of the Composition Editor window. The free-form surface 
  8326. holds the visual parts contained in the views you build and representations of 
  8327. the nonvisual parts (models) that your application includes. 
  8328.  
  8329.  
  8330. ΓòÉΓòÉΓòÉ <hidden> graphical user interface (GUI) ΓòÉΓòÉΓòÉ
  8331.  
  8332. A type of interface that enables users to communicate with a program by 
  8333. manipulating graphical features, rather than by entering commands. Typically, a 
  8334. graphical user interface includes a combination of graphics, pointing devices, 
  8335. menu bars and other menus, overlapping windows, and icons. 
  8336.  
  8337.  
  8338. ΓòÉΓòÉΓòÉ <hidden> GUI ΓòÉΓòÉΓòÉ
  8339.  
  8340. See  graphical user interface. 
  8341.  
  8342.  
  8343. ΓòÉΓòÉΓòÉ <hidden> handles ΓòÉΓòÉΓòÉ
  8344.  
  8345. Small squares that appear on the corners of a selected visual part in the 
  8346. visual builder. Handles are used to resize parts. 
  8347.  
  8348. Compare to  primary selection. 
  8349.  
  8350.  
  8351. ΓòÉΓòÉΓòÉ <hidden> header file ΓòÉΓòÉΓòÉ
  8352.  
  8353. A file that contains system-defined control information that precedes user 
  8354. data. 
  8355.  
  8356.  
  8357. ΓòÉΓòÉΓòÉ <hidden> inheritance ΓòÉΓòÉΓòÉ
  8358.  
  8359. A mechanism by which an object class can use the attributes, relationships, and 
  8360. member functions defined in more abstract classes related to it (its base 
  8361. classes). 
  8362.  
  8363. An object-oriented programming technique that allows you to use existing 
  8364. classes as bases for creating other classes. 
  8365.  
  8366.  
  8367. ΓòÉΓòÉΓòÉ <hidden> instance ΓòÉΓòÉΓòÉ
  8368.  
  8369. Synonym for  object, a particular instantiation of a data type. 
  8370.  
  8371.  
  8372. ΓòÉΓòÉΓòÉ <hidden> legacy code ΓòÉΓòÉΓòÉ
  8373.  
  8374. Existing code that a user might have. Legacy applications often have 
  8375. character-based, nongraphical user interfaces; usually they are written in a 
  8376. nonobject-oriented language, such as C or COBOL. 
  8377.  
  8378.  
  8379. ΓòÉΓòÉΓòÉ <hidden> loaded ΓòÉΓòÉΓòÉ
  8380.  
  8381. The state of the mouse pointer between the time you select a part from the 
  8382. parts palette and deposit the part on the free-form surface. 
  8383.  
  8384.  
  8385. ΓòÉΓòÉΓòÉ <hidden> main part ΓòÉΓòÉΓòÉ
  8386.  
  8387. The part that users see when they start an application. This is the part from 
  8388. which the main() function C++ code for the application is generated. 
  8389.  
  8390. The main part is a special kind of composite part. 
  8391.  
  8392. See also  part and  subpart. 
  8393.  
  8394.  
  8395. ΓòÉΓòÉΓòÉ <hidden> member ΓòÉΓòÉΓòÉ
  8396.  
  8397. A data object in a structure or a union. 
  8398.  
  8399. In C++, classes and structures can also contain functions and types as members. 
  8400.  
  8401.  
  8402. ΓòÉΓòÉΓòÉ <hidden> member function ΓòÉΓòÉΓòÉ
  8403.  
  8404. An operator or function that is declared as a member of a class. A member 
  8405. function has access to the private and protected data members and member 
  8406. functions of objects of its class. 
  8407.  
  8408.  
  8409. ΓòÉΓòÉΓòÉ <hidden> member function call ΓòÉΓòÉΓòÉ
  8410.  
  8411. A communication from one object to another that requests the receiving object 
  8412. to execute a member function. 
  8413.  
  8414. A member function call consists of a member function name that indicates the 
  8415. requested member function and the arguments to be used in executing the member 
  8416. function. The member function call always returns some object to the requesting 
  8417. object as the result of performing the member function. 
  8418.  
  8419. Synonym for  message. 
  8420.  
  8421.  
  8422. ΓòÉΓòÉΓòÉ <hidden> member function name ΓòÉΓòÉΓòÉ
  8423.  
  8424. The component of a member function call that specifies the requested operation. 
  8425.  
  8426.  
  8427. ΓòÉΓòÉΓòÉ <hidden> message ΓòÉΓòÉΓòÉ
  8428.  
  8429. A request from one object that the receiving object implement a member 
  8430. function. Because data is encapsulated and not directly accessible, a message 
  8431. is the only way to send data from one object to another. Each message specifies 
  8432. the name of the receiving object, the member function to be implemented, and 
  8433. any arguments the member function needs for implementation. 
  8434.  
  8435. Synonym for  member function call. 
  8436.  
  8437.  
  8438. ΓòÉΓòÉΓòÉ <hidden> model ΓòÉΓòÉΓòÉ
  8439.  
  8440. A nonvisual part that represents the state and behavior of a object, such as a 
  8441. customer or an account. 
  8442.  
  8443. Contrast with  view. 
  8444.  
  8445.  
  8446. ΓòÉΓòÉΓòÉ <hidden> module definition file ΓòÉΓòÉΓòÉ
  8447.  
  8448. A file that describes the code segments within a load module. 
  8449.  
  8450. Synonym for DEF file. 
  8451.  
  8452.  
  8453. ΓòÉΓòÉΓòÉ <hidden> nested class ΓòÉΓòÉΓòÉ
  8454.  
  8455. A class defined within the scope of another class. 
  8456.  
  8457.  
  8458. ΓòÉΓòÉΓòÉ <hidden> nonvisual part ΓòÉΓòÉΓòÉ
  8459.  
  8460. A part that has no visual representation at run time. A nonvisual part 
  8461. typically represents some real-world object that exists in the business 
  8462. environment. 
  8463.  
  8464. Compare to  model. Contrast with  view and  visual part. 
  8465.  
  8466.  
  8467. ΓòÉΓòÉΓòÉ <hidden> no-event attribute ΓòÉΓòÉΓòÉ
  8468.  
  8469. An attribute that does not have an event identifier. 
  8470.  
  8471.  
  8472. ΓòÉΓòÉΓòÉ <hidden> no-set attribute ΓòÉΓòÉΓòÉ
  8473.  
  8474. An attribute that does not have a set member function. 
  8475.  
  8476.  
  8477. ΓòÉΓòÉΓòÉ <hidden> notebook part ΓòÉΓòÉΓòÉ
  8478.  
  8479. A visual part that resembles a bound notebook containing pages separated into 
  8480. sections by tabbed divider pages. A user can turn the pages of a notebook or 
  8481. select the tabs to move from one section to another. 
  8482.  
  8483.  
  8484. ΓòÉΓòÉΓòÉ <hidden> object ΓòÉΓòÉΓòÉ
  8485.  
  8486. A computer representation of something that a user can work with to perform a 
  8487. task. An object can appear as text or an icon. 
  8488.  
  8489. A collection of data and member functions that operate on that data, which 
  8490. together represent a logical entity in the system. In object-oriented 
  8491. programming, objects are grouped into classes that share common data 
  8492. definitions and member functions. Each object in the class is said to be an 
  8493. instance of the class. 
  8494.  
  8495. An instance of an object class consisting of attributes, a data structure, and 
  8496. operational member functions. It can represent a person, place, thing, event, 
  8497. or concept. Each instance has the same properties, attributes, and member 
  8498. functions as other instances of the object class, though it has unique values 
  8499. assigned to its attributes. 
  8500.  
  8501.  
  8502. ΓòÉΓòÉΓòÉ <hidden> object class ΓòÉΓòÉΓòÉ
  8503.  
  8504. A template for defining the attributes and member functions of an object. An 
  8505. object class can contain other object classes. An individual representation of 
  8506. an object class is called an object. 
  8507.  
  8508.  
  8509. ΓòÉΓòÉΓòÉ <hidden> object factory ΓòÉΓòÉΓòÉ
  8510.  
  8511. A nonvisual part capable of dynamically creating new instances of a specified 
  8512. part. For example, during the execution of an application, an object factory 
  8513. can create instances of a new class to collect the data being generated. 
  8514.  
  8515.  
  8516. ΓòÉΓòÉΓòÉ <hidden> object-oriented programming ΓòÉΓòÉΓòÉ
  8517.  
  8518. A programming approach based on the concepts of data abstraction and 
  8519. inheritance. Unlike procedural programming techniques, object-oriented 
  8520. programming concentrates on those data objects that comprise the problem and 
  8521. how they are manipulated, not on how something is accomplished. 
  8522.  
  8523.  
  8524. ΓòÉΓòÉΓòÉ <hidden> observer ΓòÉΓòÉΓòÉ
  8525.  
  8526. An object that receives notification from a notifier object. 
  8527.  
  8528.  
  8529. ΓòÉΓòÉΓòÉ <hidden> operation ΓòÉΓòÉΓòÉ
  8530.  
  8531. A member function or service that can be requested of an object. 
  8532.  
  8533.  
  8534. ΓòÉΓòÉΓòÉ <hidden> overloading ΓòÉΓòÉΓòÉ
  8535.  
  8536. An object-oriented programming technique that allows you to redefine functions 
  8537. and most standard C++ operators when the functions and operators are used with 
  8538. class types. 
  8539.  
  8540.  
  8541. ΓòÉΓòÉΓòÉ <hidden> palette ΓòÉΓòÉΓòÉ
  8542.  
  8543. See  parts palette. 
  8544.  
  8545.  
  8546. ΓòÉΓòÉΓòÉ <hidden> parameter connection ΓòÉΓòÉΓòÉ
  8547.  
  8548. A connection that satisfies a parameter of an action or member function by 
  8549. supplying either an attribute's value or the return value of an action, member 
  8550. function, or custom logic. The parameter is always the source of the 
  8551. connection. 
  8552.  
  8553. See also  connection. 
  8554.  
  8555.  
  8556. ΓòÉΓòÉΓòÉ <hidden> parent class ΓòÉΓòÉΓòÉ
  8557.  
  8558. The class from which another part or class inherits data, member functions, or 
  8559. both. 
  8560.  
  8561.  
  8562. ΓòÉΓòÉΓòÉ <hidden> part ΓòÉΓòÉΓòÉ
  8563.  
  8564. A self-contained software object with a standardized public interface, 
  8565. consisting of a set of external features that allow the part to interact with 
  8566. other parts. A part is implemented as a class that supports the INotifier 
  8567. protocol and has a part interface defined. 
  8568.  
  8569. The parts on the palette can be used as templates to create instances or 
  8570. objects. 
  8571.  
  8572.  
  8573. ΓòÉΓòÉΓòÉ <hidden> part event ΓòÉΓòÉΓòÉ
  8574.  
  8575. A representation of a change that occurs to a part. The events on a part's 
  8576. interface enable other interested parts to receive notification when something 
  8577. about the part changes. For example, a push button generates an event signaling 
  8578. that it has been clicked, which might cause another part to display a window. 
  8579.  
  8580.  
  8581. ΓòÉΓòÉΓòÉ <hidden> part event ID ΓòÉΓòÉΓòÉ
  8582.  
  8583. The name of a part static-data member used to identify which notification is 
  8584. being signaled. 
  8585.  
  8586.  
  8587. ΓòÉΓòÉΓòÉ <hidden> part interface ΓòÉΓòÉΓòÉ
  8588.  
  8589. A set of external features that allows a part to interact with other parts. A 
  8590. part's interface is made up of three characteristics: attributes, actions, and 
  8591. events. 
  8592.  
  8593.  
  8594. ΓòÉΓòÉΓòÉ <hidden> Part Interface Editor ΓòÉΓòÉΓòÉ
  8595.  
  8596. An editor that the application developer uses to create and modify attributes, 
  8597. actions, and events, which together make up the interface of a part. 
  8598.  
  8599. Compare to  Class Editor and  Composition Editor. 
  8600.  
  8601.  
  8602. ΓòÉΓòÉΓòÉ <hidden> parts palette ΓòÉΓòÉΓòÉ
  8603.  
  8604. The parts palette holds a collection of visual and nonvisual parts used in 
  8605. building additional parts for an application. The parts palette is organized 
  8606. into categories. Application developers can add parts to the palette for use in 
  8607. defining applications or other parts. 
  8608.  
  8609.  
  8610. ΓòÉΓòÉΓòÉ <hidden> preferred features ΓòÉΓòÉΓòÉ
  8611.  
  8612. A subset of the part's features that appear in a pop-up connection menu. 
  8613. Generally, they are the features used most often. 
  8614.  
  8615.  
  8616. ΓòÉΓòÉΓòÉ <hidden> primary selection ΓòÉΓòÉΓòÉ
  8617.  
  8618. In the Composition Editor, the part used as a base for an action that affects 
  8619. several parts. For example, an alignment tool will align all selected parts 
  8620. with the primary selection. Primary selection is indicated by closed (solid) 
  8621. selection handles, while the other selected parts have open selection handles. 
  8622.  
  8623. See also  selection handles. 
  8624.  
  8625.  
  8626. ΓòÉΓòÉΓòÉ <hidden> private ΓòÉΓòÉΓòÉ
  8627.  
  8628. Pertaining to a class member that is accessible only to member functions and 
  8629. friends of that class. 
  8630.  
  8631.  
  8632. ΓòÉΓòÉΓòÉ <hidden> process ΓòÉΓòÉΓòÉ
  8633.  
  8634. A program running under OS/2, along with the resources associated with it 
  8635. (memory, threads, file system resources, and so on). 
  8636.  
  8637.  
  8638. ΓòÉΓòÉΓòÉ <hidden> program ΓòÉΓòÉΓòÉ
  8639.  
  8640. One or more files containing a set of instructions conforming to a particular 
  8641. programming language syntax. 
  8642.  
  8643. A self-contained, executable module. Multiple copies of the same program can be 
  8644. run in different processes. 
  8645.  
  8646.  
  8647. ΓòÉΓòÉΓòÉ <hidden> protected ΓòÉΓòÉΓòÉ
  8648.  
  8649. Pertaining to a class member that is only accessible to member functions and 
  8650. friends of that class, or to member functions and friends of classes derived 
  8651. from that class. 
  8652.  
  8653.  
  8654. ΓòÉΓòÉΓòÉ <hidden> prototype ΓòÉΓòÉΓòÉ
  8655.  
  8656. A function declaration or definition that includes both the return type of the 
  8657. function and the types of its arguments. 
  8658.  
  8659.  
  8660. ΓòÉΓòÉΓòÉ <hidden> primitive part ΓòÉΓòÉΓòÉ
  8661.  
  8662. A basic building block of other parts. A primitive part can be relatively 
  8663. complex in terms of the function it provides. 
  8664.  
  8665.  
  8666. ΓòÉΓòÉΓòÉ <hidden> process ΓòÉΓòÉΓòÉ
  8667.  
  8668. A collection of code, data, and other system resources, including at least one 
  8669. thread of execution, that performs a data processing task. 
  8670.  
  8671.  
  8672. ΓòÉΓòÉΓòÉ <hidden> property ΓòÉΓòÉΓòÉ
  8673.  
  8674. A unique characteristic of a part. 
  8675.  
  8676.  
  8677. ΓòÉΓòÉΓòÉ <hidden> pure virtual function ΓòÉΓòÉΓòÉ
  8678.  
  8679. A virtual function that has a function definition of = 0;. 
  8680.  
  8681.  
  8682. ΓòÉΓòÉΓòÉ <hidden> receiver ΓòÉΓòÉΓòÉ
  8683.  
  8684. The object that receives a member function call. 
  8685.  
  8686. Contrast with  caller. 
  8687.  
  8688.  
  8689. ΓòÉΓòÉΓòÉ <hidden> resource file ΓòÉΓòÉΓòÉ
  8690.  
  8691. A file that contains data used by an application, such as text strings and 
  8692. icons. 
  8693.  
  8694.  
  8695. ΓòÉΓòÉΓòÉ <hidden> selection handles ΓòÉΓòÉΓòÉ
  8696.  
  8697. In the Composition Editor, small squares that appear on the corners of a 
  8698. selected visual part. Selection handles are used to resize parts. 
  8699.  
  8700. See also  primary selection. 
  8701.  
  8702.  
  8703. ΓòÉΓòÉΓòÉ <hidden> server ΓòÉΓòÉΓòÉ
  8704.  
  8705. A computer that provides services to multiple users or workstations in a 
  8706. network; for example, a file server, a print server, or a mail server. 
  8707.  
  8708.  
  8709. ΓòÉΓòÉΓòÉ <hidden> service ΓòÉΓòÉΓòÉ
  8710.  
  8711. A specific behavior that an object is responsible for exhibiting. 
  8712.  
  8713.  
  8714. ΓòÉΓòÉΓòÉ <hidden> settings view ΓòÉΓòÉΓòÉ
  8715.  
  8716. A view of a part that provides a way to display and set the attributes and 
  8717. options associated with the part. 
  8718.  
  8719.  
  8720. ΓòÉΓòÉΓòÉ <hidden> sticky ΓòÉΓòÉΓòÉ
  8721.  
  8722. In the Composition Editor, the mode that enables you to add multiple parts of 
  8723. the same class (for example, three push buttons) without going back and forth 
  8724. between the parts palette and the free-form surface. 
  8725.  
  8726.  
  8727. ΓòÉΓòÉΓòÉ <hidden> structure ΓòÉΓòÉΓòÉ
  8728.  
  8729. A construct that contains an ordered group of data objects. Unlike an array, 
  8730. the data objects within a structure can have varied data types. 
  8731.  
  8732.  
  8733. ΓòÉΓòÉΓòÉ <hidden> subpart ΓòÉΓòÉΓòÉ
  8734.  
  8735. A part that is used to create another part. 
  8736.  
  8737. See also  nonvisual part, part, and  visual part. 
  8738.  
  8739.  
  8740. ΓòÉΓòÉΓòÉ <hidden> superclass ΓòÉΓòÉΓòÉ
  8741.  
  8742. See  abstract class and  base class. 
  8743.  
  8744.  
  8745. ΓòÉΓòÉΓòÉ <hidden> tear-off attribute ΓòÉΓòÉΓòÉ
  8746.  
  8747. An attribute that an application developer has exposed to work with as though 
  8748. it were a stand-alone part. 
  8749.  
  8750.  
  8751. ΓòÉΓòÉΓòÉ <hidden> template ΓòÉΓòÉΓòÉ
  8752.  
  8753. A family of classes or functions with variable types. 
  8754.  
  8755.  
  8756. ΓòÉΓòÉΓòÉ <hidden> thread ΓòÉΓòÉΓòÉ
  8757.  
  8758. A unit of execution within a process. 
  8759.  
  8760.  
  8761. ΓòÉΓòÉΓòÉ <hidden> tool bar ΓòÉΓòÉΓòÉ
  8762.  
  8763. The strip of icons along the top of the free-form surface. The tool bar 
  8764. contains tools to help you construct composite parts. 
  8765.  
  8766.  
  8767. ΓòÉΓòÉΓòÉ <hidden> UI ΓòÉΓòÉΓòÉ
  8768.  
  8769. See  user interface. 
  8770.  
  8771.  
  8772. ΓòÉΓòÉΓòÉ <hidden> unloaded ΓòÉΓòÉΓòÉ
  8773.  
  8774. The state of the mouse pointer before you select a part from the parts palette 
  8775. and after you deposit a part on the free-form surface. In addition, you can 
  8776. unload the mouse pointer by pressing the Esc key. 
  8777.  
  8778.  
  8779. ΓòÉΓòÉΓòÉ <hidden> user interface (UI) ΓòÉΓòÉΓòÉ
  8780.  
  8781. The hardware, software, or both that enable a user to interact with a computer. 
  8782.  
  8783. The term user interface normally refers to the visual presentation and its 
  8784. underlying software with which a user interacts. 
  8785.  
  8786.  
  8787. ΓòÉΓòÉΓòÉ <hidden> variable ΓòÉΓòÉΓòÉ
  8788.  
  8789. A storage place within an object for a data feature. The data feature is an 
  8790. object, such as number or date, stored as an attribute of the containing 
  8791. object. 
  8792.  
  8793. A part that receives an identity at run time. A variable by itself contains no 
  8794. data or program logic; it must be connected such that it receives runtime 
  8795. identity from a part elsewhere in the application. 
  8796.  
  8797.  
  8798. ΓòÉΓòÉΓòÉ <hidden> view ΓòÉΓòÉΓòÉ
  8799.  
  8800. A visual part, such as a window, push button, or entry field. 
  8801.  
  8802. A visual representation that can display and change the underlying model 
  8803. objects of an application. Views are both the end result of developing an 
  8804. application and the basic unit of composition of user interfaces. 
  8805.  
  8806. Compare to  visual part. Contrast with  model. 
  8807.  
  8808.  
  8809. ΓòÉΓòÉΓòÉ <hidden> virtual function ΓòÉΓòÉΓòÉ
  8810.  
  8811. A function of a class that is declared with the keyword virtual. The 
  8812. implementation that is executed when you make a call to a virtual function 
  8813. depends on the type of the object for which it is called. This is determined at 
  8814. run time. 
  8815.  
  8816.  
  8817. ΓòÉΓòÉΓòÉ <hidden> visual part ΓòÉΓòÉΓòÉ
  8818.  
  8819. A part that has a visual representation at run time. Visual parts, such as 
  8820. windows, push buttons, and entry fields, make up the user interface of an 
  8821. application. 
  8822.  
  8823. Compare to  view. Contrast with  nonvisual part. 
  8824.  
  8825.  
  8826. ΓòÉΓòÉΓòÉ <hidden> visual programming tool ΓòÉΓòÉΓòÉ
  8827.  
  8828. A tool that provides a means for specifying programs graphically. Application 
  8829. programmers write applications by manipulating graphical representations of 
  8830. components. 
  8831.  
  8832.  
  8833. ΓòÉΓòÉΓòÉ <hidden> white space ΓòÉΓòÉΓòÉ
  8834.  
  8835. Space characters, tab characters, form-feed characters, and new-line 
  8836. characters. 
  8837.  
  8838.  
  8839. ΓòÉΓòÉΓòÉ <hidden> window ΓòÉΓòÉΓòÉ
  8840.  
  8841. A rectangular area of the screen with visible boundaries in which information 
  8842. is displayed. Windows can overlap on the screen, giving it the appearance of 
  8843. one window being on top of another. 
  8844.  
  8845. In the Composition Editor, a window is a part that can be used as a container 
  8846. for other visual parts, such as push buttons.