home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / vxdemo.zip / TUTBOOK.IN$ / TUTBOOK.INF (.txt)
OS/2 Help File  |  1993-11-22  |  109KB  |  731 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Welcome ΓòÉΓòÉΓòÉ
  3.  
  4. Welcome to the demonstration version of VXΓêÖREXX. 
  5.  
  6. Click the Forward button to continue. 
  7.  
  8.  
  9. ΓòÉΓòÉΓòÉ 2. Introduction to VXΓêÖREXX ΓòÉΓòÉΓòÉ
  10.  
  11. WATCOM's visual development environment for OS/2 REXX is an easy to use, 
  12. powerful and fully integrated environment for creating applications that 
  13. exploits the graphical user interface capabilities of OS/2 2.x and Presentation 
  14. Manager. The product combines a project management facility, visual designer, 
  15. and an interactive source-level debugger to deliver a very approachable and 
  16. highly productive visual development environment. 
  17.  
  18. Design applications visually 
  19.  
  20. Create rich graphical applications quickly and easily using the visual design 
  21. environment. With the visual designer, you can graphically create Presentation 
  22. Manager objects, quickly customize their properties, and easily attach REXX 
  23. routines to the objects. 
  24.  
  25. Powerful open environment 
  26.  
  27. Enjoy the simplicity of event-driven programming together with global editing 
  28. capabilities essential for professional project management. The WATCOM visual 
  29. development environment is open and extensible through IBM's object oriented 
  30. System Object Model (SOM) technology. You can access all standard REXX APIs 
  31. including DB2/2 because the VXΓêÖREXX is based on the OS/2 2.x system REXX. 
  32.  
  33. Intergrated development environment 
  34.  
  35. Build, test, and debug your applications without leaving the development 
  36. environment. Then package your applications as an EXE file or PM macro for 
  37. royalty-free redistribution. The power of the integrated development 
  38. environment can also be used with your existing REXX applications. 
  39.  
  40. Highlights 
  41.  
  42.    o Easy to use visual development environment 
  43.    o Create and modify objects dynamically at both edit and run time 
  44.    o Powerful project management facility 
  45.    o Advanced interactive source-level debugger 
  46.    o Package your applications as EXE files or PM macros 
  47.    o Access standard REXX APIs including DB2/2 
  48.    o Create REXX code visually using drag and drop programming 
  49.    o System Object Model (SOM) based object manager 
  50.    o Support for multi-threaded applications 
  51.    o Include OS/2 style help and hints in your applications 
  52.    o Supports SAA CUA '91 objects 
  53.    o Autosizing and alignment of objects 
  54.    o Integrated console window support for existing REXX programs 
  55.    o Royalty-free run time library 
  56.    o Multiple modeless window support 
  57.    o Create PM macros for applications supporting REXX as a macro language 
  58.  
  59. Click the Forward button to continue. 
  60.  
  61.  
  62. ΓòÉΓòÉΓòÉ 3. How to use this tutorial ΓòÉΓòÉΓòÉ
  63.  
  64. This tutorial shows you how to create applications with VXΓêÖREXX. The first two 
  65. parts show you how to use the tools and the system to create applications. The 
  66. third part of the manual is an alphabetical reference for all components of the 
  67. VXΓêÖREXX software. 
  68.  
  69. At any point in the tutorial, you can click the Back button to review a 
  70. previous page. You can also press Forward to skip ahead. To see an outline of 
  71. the whole tutorial, press the Contents button. 
  72.  
  73.  
  74. ΓòÉΓòÉΓòÉ 4. Samples included with the demonstration version ΓòÉΓòÉΓòÉ
  75.  
  76. A number of sample programs come with the demonstration version of VXΓêÖREXX. 
  77. They are located in the Samples folder, in your WATCOM VX-REXX folder. All 
  78. samples come ready to run with full source code. Here is a list of the sample 
  79. programs: 
  80.  
  81. Button         A simple first application with push buttons. 
  82.  
  83. Calc           A four function calculator. 
  84.  
  85. HintHelp       A demonstration of the run time help facility in VXΓêÖREXX. 
  86.  
  87. MindGame       A pattern guessing game. 
  88.  
  89. MMW            An example of modal and modeless windows. 
  90.  
  91. Movies         A multimedia sample that plays OS/2 movies (AVI files). 
  92.  
  93. SampleDB       A database sample (requires IBM DB2/2). 
  94.  
  95. Scan           An EPM macro that scans through the current file looking for 
  96.                REXX labels. 
  97.  
  98. Threads        A sample of a multithreaded program. 
  99.  
  100. WinCtrl        This program lists the top level frame windows on the desktop 
  101.                and lets you minimize, maximize, restore, and shake them. 
  102.  
  103.  
  104. ΓòÉΓòÉΓòÉ 5. About the demonstration version of the software ΓòÉΓòÉΓòÉ
  105.  
  106. The demonstration version of VXΓêÖREXX differs from the full version in a number 
  107. of ways: 
  108.  
  109. o The full version 2 software includes containers, notebooks, sliders, value 
  110.   sets, and DDE client objects. 
  111.  
  112. o The full version includes the online version of the VXΓêÖREXX Programmer's 
  113.   Guide and Reference manual. 
  114.  
  115. o You cannot save projects, make standalone executables, or make macro files 
  116.   using the demonstration version. 
  117.  
  118.  
  119. ΓòÉΓòÉΓòÉ 6. System requirements ΓòÉΓòÉΓòÉ
  120.  
  121. The minimum recommended configuration for WATCOM VXΓêÖREXX is a 20 megahertz 386 
  122. personal computer with 8 megabytes of memory. About 5 megabytes of hard disk 
  123. space are required to install the software. 
  124.  
  125. IBM OS/2 version 2.0 with the OS/2 Service Pak or higher must be installed 
  126. prior to installing VXΓêÖREXX. If you are running OS/2 2.0 without the OS/2 
  127. Service Pak, you must obtain it from IBM and install it to make sure that all 
  128. features of VXΓêÖREXX work correctly. The Service Pak required is IBM number 
  129. XR06055. You can obtain it from the IBM OS/2 BBS, from CompuServe, or directly 
  130. from IBM. Contact your IBM representative for more information. 
  131.  
  132. The OS/2 REXX interpreter and the REXX information must also be installed prior 
  133. to installing VXΓêÖREXX. 
  134.  
  135.  
  136. ΓòÉΓòÉΓòÉ 7. How to contact WATCOM ΓòÉΓòÉΓòÉ
  137.  
  138.  
  139. ΓòÉΓòÉΓòÉ 7.1. In North America (and all other non-European locations) ΓòÉΓòÉΓòÉ
  140.  
  141. WATCOM International Corporation. 
  142.  
  143. 415 Phillip Street, Waterloo, Ontario, CANADA, N2L 3X2 
  144.  
  145. Technical Support
  146. hot-line:   (519) 884-0702
  147. fax:        (519) 747-4971
  148. BBS:        (519) 884-2103
  149. Internet:   tech@watcom.on.ca
  150. Compuserve: type GO WATCOM
  151.  
  152. General Inquiries
  153. tel: (519)886-3700
  154. fax: (519)747-4971
  155.  
  156. Sales, upgrades, other product
  157. orders, and reseller inquiries/orders:
  158. 1-800-265-4555 (toll free in North America)
  159.  
  160.  
  161. ΓòÉΓòÉΓòÉ 7.2. In Europe ΓòÉΓòÉΓòÉ
  162.  
  163. WATCOM Europe Limited. 
  164.  
  165. PO Box 64, LIVINGSTON, West Lothian, EH54 7AE, UNITED KINGDOM 
  166.  
  167. Technical Support
  168.     United Kingdom
  169.         tel: 0506 460112
  170.         fax: 0506 460115
  171.  
  172.     Other Locations
  173.         tel: (44) 506 460112
  174.         fax: (44) 506 460115
  175.  
  176.     BBS: (519) 884-2103
  177.     Internet: tech@watcom.on.ca
  178.     Compuserve: type GO WATCOM
  179.  
  180. General Inquiries
  181.     United Kingdom
  182.         tel: 0506 460112
  183.         fax: 0506 460115
  184.  
  185.     Other Locations
  186.         tel: (44) 506 460112
  187.         fax: (44) 506 460115
  188.  
  189. Sales, Upgrades, other product orders, and reseller inquiries/orders:
  190.     United Kingdom Toll Free
  191.         tel: 0800 44 44 55
  192.         fax: 0800 55 54 55
  193.  
  194.     Germany Toll Free
  195.         tel: 0130 81 88 62
  196.         fax: 0130 81 88 63
  197.  
  198.     France Toll Free
  199.         tel: 05 90 81 35
  200.         fax: 05 90 81 36
  201.  
  202.     All Other Locations
  203.         tel: (44) 506 460112
  204.         fax: (44) 506 460115
  205.  
  206.  
  207. ΓòÉΓòÉΓòÉ 8. A simple program ΓòÉΓòÉΓòÉ
  208.  
  209. This chapter provides a brief introduction to the VXΓêÖREXX development 
  210. environment through a tutorial. We will learn how to start and stop VXΓêÖREXX and 
  211. create, and run a simple application. In addition, the drag and drop 
  212. programming feature of VXΓêÖREXX will be used to reduce the time and effort 
  213. needed for writing code. The same steps used in this tutorial can be used to 
  214. develop all VXΓêÖREXX applications. Subsequent chapters provide more details 
  215. about each step. 
  216.  
  217. In this tutorial, you will create an application which consists of an entry 
  218. field, push button, and list box. When run, text typed in the entry field will 
  219. be added to the list box using the push button. 
  220.  
  221.  
  222. ΓòÉΓòÉΓòÉ 8.1. Starting VXΓêÖREXX ΓòÉΓòÉΓòÉ
  223.  
  224. You can start VXΓêÖREXX by double clicking on the VXΓêÖREXX icon in the WATCOM 
  225. VXΓêÖREXX folder on your desktop. After it starts, you will see a window similar 
  226. to Figure 1. 
  227.  
  228. Figure 1  The initial VXΓêÖREXX screen.
  229.  
  230. The VXΓêÖREXX interface consists of a menu bar, a tool palette, and a project 
  231. window containing a grid of dots. The menu bar contains the commands that are 
  232. used to create and run applications. The tool palette contains the objects 
  233. which can be placed in the project window to create the user interface for an 
  234. application. 
  235.  
  236. Note:  The demonstration version of VXΓêÖREXX automatically opens the tutorial 
  237. book when it starts up. 
  238.  
  239.  
  240. ΓòÉΓòÉΓòÉ 8.2. Creating an application ΓòÉΓòÉΓòÉ
  241.  
  242. There are three basic steps to building a VXΓêÖREXX application: 
  243.  
  244.  1. Creating the user interface by adding objects to the project window. 
  245.  
  246.  2. Customizing each object's properties. 
  247.  
  248.  3. Attaching code to each object. 
  249.  
  250. We will go through these steps in the following sections to create a simple 
  251. application. 
  252.  
  253.  
  254. ΓòÉΓòÉΓòÉ 8.3. Creating the user interface ΓòÉΓòÉΓòÉ
  255.  
  256. Creating the user interface is the first step in building an application. The 
  257. interface to this application has three objects: an entry field, a push button, 
  258. and a list box. We will start by adding the entry field to the window: 
  259.  
  260.  1. Click on the Tools menu and then choose EntryField. 
  261.  
  262.  2. Position the mouse pointer near the top left corner of the project window. 
  263.  
  264.     The cursor will change to a cross while it is positioned on the project 
  265.     window. 
  266.  
  267.  3. Hold down mouse button 1 and drag the mouse down and to the right until the 
  268.     entry field is approximately the size of the one shown in Figure 2. 
  269.  
  270.         Figure 2  The entry field added to the window.
  271.  
  272.  4. Release the mouse button. 
  273.  
  274. Add the push button to the window using a similar procedure: 
  275.  
  276.  1. Click on the Tools menu and then choose PushButton. 
  277.  
  278.  2. Position the cursor below the bottom left corner of the entry field. 
  279.  
  280.  3. Hold down mouse button 1 and drag the mouse down and to the right until the 
  281.     push button  is approximately the size of the one shown in Figure 3. 
  282.  
  283.         Figure 3  The push button added to the window.
  284.  
  285.  4. Release the mouse button. 
  286.  
  287. Repeat the above steps using the ListBox item from the Tools menu to make your 
  288. window similar in appearance to Figure 4. 
  289.  
  290. Figure 4  The entry field, push button and list box on the window.
  291.  
  292. Finally, to improve the appearance of the window, center the three objects on 
  293. the window as follows: 
  294.  
  295.  1. Position the cursor on the entry field. 
  296.  
  297.  2. Press and hold down mouse button 1. Sizing handles will appear along the 
  298.     border of the entry field. Move the cursor over the push button and then 
  299.     over the list box. Now all three objects will have sizing handles along 
  300.     their borders. The screen should look similar to  Figure 5. 
  301.  
  302.         Figure 5  The entry field, push button and list box are selected.
  303.  
  304.  3. Release mouse button 1. 
  305.  
  306.  4. Position the cursor on the entry field once again and press mouse button 2 
  307.     to invoke the VXΓêÖREXX pop-up menu. 
  308.  
  309.  5. Select the Align menu item using mouse button 1. A second menu will appear. 
  310.     From this menu, click on the menu item used for centering objects as shown 
  311.     in Figure 6. 
  312.  
  313.         Figure 6  The menu item used to centre objects.
  314.     The push button and the list box will now be centered underneath the entry 
  315.     field. 
  316.  
  317.  6. Position the cursor over the right border of the window. The cursor shape 
  318.     should change to a sizing arrow. 
  319.  
  320.  7. Hold down mouse button 1 and move the cursor left or right to adjust the 
  321.     width of the window until the objects are centered. 
  322.  
  323.  8. Click on the window background to deselect the objects. 
  324.  
  325. The screen should appear as in  Figure 7. 
  326.  
  327. Figure 7  The objects centred on the window.
  328.  
  329. All the objects we need have been created. Now their properties must be 
  330. customized. 
  331.  
  332.  
  333. ΓòÉΓòÉΓòÉ 8.4. Customizing object properties ΓòÉΓòÉΓòÉ
  334.  
  335. Each VXΓêÖREXX object has properties such as color and size which can be 
  336. customized. An object is given default property values when it is first 
  337. created. Often, these properties need to be changed. 
  338.  
  339. The entry field has a font property which determines the font used to display 
  340. text. The height of the entry field should be set according to the size of the 
  341. font being used. This step can be done automatically using the entry field's 
  342. Autosize property. If this property is set to 1, the height of the entry field 
  343. will be adjusted automatically based on the font being used. Initially, the 
  344. Autosize property is set to 0. Change it to 1 as follows: 
  345.  
  346.  1. Click mouse button 2 anywhere over the entry field. A pop-up menu will be 
  347.     displayed. 
  348.  
  349.  2. Choose the Properties menu item. A property notebook will be displayed. 
  350.  
  351.  3. Click on the Size index tab. The Size page will be displayed as in Figure 
  352.     8. 
  353.  
  354.         Figure 8  The size page of the property notebook.
  355.  
  356.  4. Click on the check box marked Autosize. 
  357.  
  358.  5. Close the entry field's property notebook by double clicking on the title 
  359.     bar icon in the upper left corner. 
  360.  
  361. The text which appears on a push button is called the caption and is determined 
  362. by the push button's Caption property. To set the caption of the push button to 
  363. Add Item: 
  364.  
  365.  1. Click mouse button 2 anywhere over the push button and choose Properties to 
  366.     open the push button's property notebook. 
  367.  
  368.  2. Click on the Text index tab. The Text page will be displayed as in Figure 
  369.     9. 
  370.  
  371.         Figure 9  The text page of the property notebook.
  372.  
  373.  3. Click on the Caption entry field and type: 
  374.  
  375.         Add Item
  376.  
  377.  4. Close the property notebook. The text Add Item will appear on the push 
  378.     button. 
  379.  
  380. Lines in a list box are displayed one below another, beginning at the top. The 
  381. last line in the list box may not appear completely, depending on the height of 
  382. the list box. The height must be adjusted if this characteristic is 
  383. undesirable. To have the height adjusted automatically, set the AdjustHeight 
  384. property of the list box as follows: 
  385.  
  386.  1. Open the property notebook for the list box using the same method as 
  387.     before. 
  388.  
  389.  2. Turn to the Size page by clicking on the Size index tab. 
  390.  
  391.  3. Click on the AdjustHeight check box. 
  392.  
  393. By default, items in a list box will be sorted in ascending order. For our 
  394. application, we want items to be listed in the order they are added to the list 
  395. box. The list box's Sort property must be changed: 
  396.  
  397.  1. With the list box property notebook open, turn to the List page by clicking 
  398.     on the List index tab. 
  399.  
  400.  2. Click on the scroll arrows in the Sort drop down combobox. 
  401.  
  402.  3. Choose none from the drop down list. 
  403.  
  404.  4. Close the property notebook by double clicking on its title bar icon. 
  405.  
  406. Finally, set the text that will appear on the window title bar: 
  407.  
  408.  1. Open the property notebook for the window. Note that the cursor must be 
  409.     positioned on the window but not over any object in the window when 
  410.     pressing mouse button 2. 
  411.  
  412.  2. Index tabs for all pages in the notebook cannot be seen at once. The tab 
  413.     scroll arrows at the top and bottom right corners of the notebook, as shown 
  414.     in Figure 10, must be used to view all the index tabs. Press mouse button 1 
  415.     on the bottom right tab scroll arrow until the Text index tab appears. 
  416.  
  417.         Figure 10  The window's property notebook.
  418.  
  419.  3. Open the Text page of the notebook by clicking on the Text index tab. 
  420.  
  421.  4. Click on the Caption entry field and type: 
  422.  
  423.         Sample
  424.  
  425.  5. Close the property notebook. 
  426.  
  427. The first two steps in developing the sample application are complete: creating 
  428. the objects and customizing their properties. 
  429.  
  430.  
  431. ΓòÉΓòÉΓòÉ 8.5. A preliminary run ΓòÉΓòÉΓòÉ
  432.  
  433. Although the sample program is not finished you can run it to see what it will 
  434. look like when complete. To run it, click on the Run menu and choose Run 
  435. project. This will hide VXΓêÖREXX and run the application, which should appear 
  436. similar to Figure 11: 
  437.  
  438. Figure 11  A test run of the sample program.
  439.  
  440. Notice that the background of the window no longer contains a grid of dots. 
  441. Type text into the entry field to see how it will appear. Use the Tab key to 
  442. move between the objects. Click on the push button. Nothing happens because no 
  443. code has been attached to the push button. Attaching code to the objects in the 
  444. window is the next step in developing our sample application. 
  445.  
  446. Exit the application and return to VXΓêÖREXX by clicking on the title bar icon 
  447. and choosing Close. 
  448.  
  449.  
  450. ΓòÉΓòÉΓòÉ 8.6. Attaching code to objects ΓòÉΓòÉΓòÉ
  451.  
  452. In this application pressing the push button will add the text in the entry 
  453. field to the list box. We will use the drag and drop programming feature of 
  454. VXΓêÖREXX to help us write the code which will perform this task. First we must 
  455. obtain the text in the entry field. To attach this code to the push button: 
  456.  
  457.  1. Open the push button's property notebook and turn to the Event page by 
  458.     clicking on the Event tab. Code can be attached to the push button for any 
  459.     events which appear on this page. 
  460.  
  461.  2. Select Click and then click on Open to invoke an editor we can use to write 
  462.     our code. The editor will contain a skeleton for an event routine, as shown 
  463.     in Figure 12. 
  464.  
  465.         Figure 12  Event routine skeleton
  466.  
  467.     The first line in the editor is a comment, the second is the name of the 
  468.     routine, and the last line contains a REXX return instruction which needs 
  469.     to be executed at the end of the routine. The REXX code we place in this 
  470.     routine will be executed when the push button is pressed. 
  471.  
  472.  3. At this point, we could write code manually but there is a much easier 
  473.     method. Press and hold down mouse button 2 over the entry field. Now move 
  474.     the mouse over the editor. The editor window and the application window may 
  475.     need to be moved apart before this step can be done. A line joining the 
  476.     mouse to the entry field will appear as in Figure 13: 
  477.  
  478.         Figure 13  Getting the text in the entry field.
  479.  
  480.  4. Release mouse button 2. A dialog box will appear which lists descriptions 
  481.     of all the entry field methods which can be invoked and all the entry field 
  482.     properties which can be set or retrieved. 
  483.  
  484.  5. Click on the Value item under the Get property heading. We need to get the 
  485.     Value property because it contains the text in the entry field. Now click 
  486.     on OK. The following instruction is placed at the insertion point in the 
  487.     editor: 
  488.  
  489.         value = VRGet( "EF_1", "Value" )
  490.  
  491.     This instruction will assign the variable value with the text in the entry 
  492.     field. 
  493.  
  494. The automatic code generation feature of VXΓêÖREXX we have used is called drag 
  495. and drop programming. Using this feature, you can create REXX applications 
  496. without having to memorize the syntax of VXΓêÖREXX functions and methods. 
  497.  
  498. The next step is to add the text to the list box: 
  499.  
  500.  1. Press and hold down mouse button 2 over the list box and then move the 
  501.     pointer over the editor window. A line joining the cursor to the list box 
  502.     will appear. 
  503.  
  504.  2. Release mouse button 2. A dialog box will appear listing all the list box 
  505.     methods that can be invoked and all the list box properties which can be 
  506.     set or retrieved. Click on the Add a string item under the Methods heading 
  507.     and then press the OK button. 
  508.  
  509.  3. Another dialog box, as shown in  Figure 14, will appear. 
  510.  
  511.         Figure 14  The Add a String dialog box.
  512.  
  513.  4. Click on the string field and type the following: 
  514.  
  515.         value
  516.  
  517.  5. Click on the Quoted String check box. Now it should not be checked. 
  518.  
  519.  6. Press the OK button. The REXX code to add the text to the list box will be 
  520.     placed underneath the previous instruction, as shown in Figure 15. 
  521.  
  522. Figure 15  The event routine for the push button.
  523.  
  524. After getting the text, we should clear the entry field to allow new text to be 
  525. entered: 
  526.  
  527.  1. Press and hold down mouse button 2 over the entry field and then move the 
  528.     mouse over the editor window. 
  529.  
  530.  2. Release mouse button 2. A dialog box will appear. 
  531.  
  532.  3. Click on the Value item under the Set property heading and then press the 
  533.     OK button. 
  534.  
  535.  4. Click on OK from the second dialog box. The editor window should now appear 
  536.     as in  Figure 16. 
  537.  
  538.         Figure 16  The unfinished push button event routine.
  539.  
  540. The push button will have the focus when this routine is executed. We should 
  541. set the focus to the entry field so that new text can be entered immediately: 
  542.  
  543.  1. Press and hold down mouse button 2 over the entry field and then move the 
  544.     mouse over the editor window. 
  545.  
  546.  2. Release mouse button 2. 
  547.  
  548.  3. Click on the Set focus to object item underneath the Methods heading and 
  549.     then press the OK button. A line of code will be inserted below the 
  550.     previous lines in the editor window. 
  551.  
  552.  4. Close the editor window by double clicking on its title bar icon. 
  553.  
  554. The push button event routine is now complete and is shown in Figure 17. We can 
  555. perform a test run to see if it works correctly. 
  556.  
  557. Figure 17  The complete push button event routine.
  558.  
  559.  
  560. ΓòÉΓòÉΓòÉ 8.7. A test run ΓòÉΓòÉΓòÉ
  561.  
  562. To run the application, click on the Run menu and choose Run project. The 
  563. application window will look the same as it did during the first run. We have 
  564. not changed its appearance. However, try clicking on the push button after 
  565. typing text into the entry field. Now the text is added to the list box. Also, 
  566. the entry field is cleared and is given the focus again. The push button click 
  567. routine we created appears to be working as it should. 
  568.  
  569. Try adding more text to the list box. Also, try pressing the push button when 
  570. there is no text in the entry field. It seems as though no action is performed. 
  571. However, if more text is added to the list box, you can see that a blank line 
  572. is inserted when the entry field is empty and the push button is pressed, as 
  573. shown in Figure 18. 
  574.  
  575. Figure 18  Adding text to the list box.
  576.  
  577. This behavior is undesirable and needs to be prevented with the addition of 
  578. more code. Also, to make the application easier to use, we should allow text to 
  579. be added to the list box with the use of the Enter key. 
  580.  
  581.  
  582. ΓòÉΓòÉΓòÉ 8.8. Improving the application ΓòÉΓòÉΓòÉ
  583.  
  584. A push button can be enabled or disabled. When enabled, a push button responds 
  585. to events such as a click event. The push button in our application has always 
  586. been enabled. When a push button is disabled it does not respond to any events 
  587. and also appears grayed. In particular, a disabled push button cannot receive 
  588. the focus and will not respond when pressed. We will use this property of push 
  589. buttons to prevent blank lines from being added to the list box: 
  590.  
  591.  1. Press mouse button 2 anywhere over the entry field to activate the VXΓêÖREXX 
  592.     pop-up menu. 
  593.  
  594.  2. Click on events and then click on change. The editor window will appear 
  595.     with the skeleton of a routine, as shown in  Figure 19. 
  596.  
  597.         Figure 19  The entry field change routine.
  598.  
  599.     This routine will be executed whenever the contents of the entry field 
  600.     change. We need to determine if the entry field has become empty and if 
  601.     this is the case, we will disable the push button to prevent it from adding 
  602.     any text to the list box. 
  603.  
  604.  3. Press and hold down mouse button 2 over the entry field, move the mouse 
  605.     over the editor window and then release the mouse button. As before, a 
  606.     dialog box will appear. 
  607.  
  608.  4. Click on the Value item underneath the Get property heading and then press 
  609.     OK. The code to get the contents of the entry field will be generated. 
  610.  
  611.  5. Add the following line of code at the insertion point: 
  612.  
  613.         if value = "" then do
  614.  
  615.     Press the Enter key and then the Tab key at the end of this line. 
  616.  
  617.  6. At this point, we have determined that the entry field is empty so we must 
  618.     disable the push button. Press and hold down mouse button 2 over the push 
  619.     button, move the mouse over the editor window and then release the mouse 
  620.     button. A dialog box listing all methods and properties of a push button 
  621.     will appear. 
  622.  
  623.  7. Click on the Enabled item under the Set property heading and then press OK. 
  624.     A second dialog box will appear, as shown in Figure 20. 
  625.  
  626.         Figure 20  The enabled property dialog box.
  627.  
  628.     Click on the Enabled check box so that it is not checked. Press OK. The 
  629.     instruction to disable the push button is placed at the insertion point in 
  630.     the editor window. 
  631.  
  632.  8. Now we need to add the code that will enable the push button when the entry 
  633.     field is not empty. Add the following lines at the insertion point: 
  634.  
  635.         end
  636.         else do
  637.  
  638.     Press the Enter key and then the Tab key at the end of the second line. The 
  639.     editor window should appear as in Figure 21. 
  640.  
  641.         Figure 21  The incomplete entry field change routine.
  642.  
  643.     Press and hold down mouse button 2 over the push button, move the mouse 
  644.     over the editor window and then release the mouse button. From the dialog 
  645.     box click on the Enabled item under the Set property heading and then press 
  646.     OK. Press OK again on the second dialog box which appears. The code to 
  647.     enable the push button is inserted into the editor window. 
  648.  
  649.  9. One last line needs to be added to the routine: 
  650.  
  651.         end
  652.  
  653.     The complete routine is shown in Figure 22. 
  654.  
  655.         Figure 22  The complete entry field change routine.
  656.  
  657. Now we must make the push button disabled when the application is first run: 
  658.  
  659.  1. Open the push button's property notebook and turn to the Style page. Click 
  660.     on the Enabled check box so that it is not checked. 
  661.  
  662.  2. Also on this page is the Default check box. Click on this check box so that 
  663.     it becomes checked. Now, when the Enter key is pressed the push button 
  664.     click routine will be executed, as though the push button had been pressed. 
  665.     This behavior will allow text to be added to the list box by pressing the 
  666.     Enter key. 
  667.  
  668. We can easily make another improvement to the application by using the Hints 
  669. feature of VXΓêÖREXX: 
  670.  
  671.  1. Turn to the Hint page of the push button's property notebook. Type the 
  672.     following in the Hint entry field: 
  673.  
  674.         Add the text to the list box.
  675.  
  676.  2. Open the entry field's property notebook, turn to the Hint page and type 
  677.     the following: 
  678.  
  679.         Enter text.
  680.  
  681.  3. Open the window's property notebook, turn to the Hint page and click on the 
  682.     ShowHints check box. Select the Bottom item from the Status Area drop down 
  683.     combobox. A status bar will appear at the bottom of the window, as shown in 
  684.     Figure 23. 
  685.  
  686.         Figure 23  The status bar for showing hints.
  687.  
  688.     The status bar may overlap with the bottom of the list box. If this is the 
  689.     case then the list box can be raised or its height can be decreased. 
  690.  
  691. The previous steps add hints to the application. When the mouse is moved over 
  692. the push button, its hint text will be displayed in the status bar. Similarly, 
  693. when the mouse is positioned over the entry field, its hint text will be 
  694. displayed. We can now try out the improvements we have made. 
  695.  
  696.  
  697. ΓòÉΓòÉΓòÉ 8.9. Running the application ΓòÉΓòÉΓòÉ
  698.  
  699. Run the application as before by clicking on the Run menu and choosing Run 
  700. project. Move the mouse over the entry field and then the push button to see 
  701. their hints. The application window is shown in  Figure 24. 
  702.  
  703. Figure 24  Running the finished application.
  704.  
  705. Try typing in text and adding it to the list box with the use of the Enter key 
  706. as well as the push button. Notice that the push button becomes disabled 
  707. whenever the entry field is empty. 
  708.  
  709. Although this is a simple application, it would take considerably more effort 
  710. and expertise to create it with other languages and development tools. However, 
  711. with VXΓêÖREXX features such as drag and drop programming, we have created it 
  712. easily with little knowledge of OS/2 or the REXX language. 
  713.  
  714.  
  715. ΓòÉΓòÉΓòÉ 8.10. Stopping VXΓêÖREXX ΓòÉΓòÉΓòÉ
  716.  
  717. To exit VXΓêÖREXX and return to the OS/2 desktop, click on the VXΓêÖREXX title bar 
  718. icon and choose Close or double click on the title bar icon. 
  719.  
  720. In this tutorial, the following techniques have been learned: 
  721.  
  722.  1. Adding objects to a window. 
  723.  
  724.  2. Modifying an object's properties. 
  725.  
  726.  3. Using the VXΓêÖREXX drag and drop programming feature to add code. 
  727.  
  728.  4. Testing a project. 
  729.  
  730. These are the basics. The following chapters expand on these basics to show how 
  731. to create and maintain complex as well as simple applications.