Getting Started
Now you are ready to construct the secondary windows of the Investment
application. You want the windows to be dialogs that cannot be
sized. Both dialogs will take advantage of the reusable part you just
created.
The VisualAge Buy Security secondary window will look like the
following :

The VisualAge Sell Security secondary window will look like the
following :

You will create two new parts, one for each window, using the VisualAge
Organizer. The following steps explain how to create these two windows
by having two Composition Editor open at the same time.
- Using the VisualAge Organizer, Create a new Visual part named
BuySecurityView.
- Once the Composition Editor opens, directly edit the title of the window
to be VisualAge Buy Security.
- Open the Properties window for the Window part. Set the values for
the sizeBorder and maximizeButton properties to
false. Leave the Properties window open.
This maintains the size of the window so that it that cannot be sized using
the window size border or maximized during runtime.
- Add the Text part, Formatted Text part and
Label parts for the Shares to buy and Total
cost Text parts to the bottom of the window; directly edit the
labels and arrange them appropriately. Also, add a Push
Button part for the Buy push button and position it
appropriately.
- Select the Formatted Text part. The properties for this
part now appear in the Properties window. Change the format
attribute to Monetary.
The window should look like the following figure, with room to add the
reusable SecurityForm part at the top of the window:

- Save your work by selecting Save part from the File
pull-down menu.
Because the BuySecurityView window and the SellSecurityView window are
so similar, you can make a copy of the BuySecurityView window that you can
then paste into the SellSecurityView part to create your SellSecurityView
window.
- In the Composition Editor for the BuySecurityView part, select the Window
part. Then, from the Edit pull-down menu, select
Copy.
This copies the Window part, including all of its child parts and
properties information, to the clipboard.
- Minimize the Composition Editor for the BuySecurityView visual
part.
- Using the VisualAge Organizer, create a new Visual part named
SellSecurityView.
- When the Composition Editor opens, delete the Window part that appears by
default.
- From the Edit pull-down menu, select Paste.
The mouse is now loaded with a copy of the VisualAge Buy Security
window. Click mouse button 1 in the upper left corner of the free-form
surface of the Composition Editor.
- Directly edit the text of the following labels as follows:
- Change the Window part's title bar to VisualAge Sell
Security
- Change Shares to buy Label part to Shares to sell
- Change Total cost Label part to Total gain/loss
- Change Buy Push Button part to Sell.
- Save your work by selecting Save part from the File
pull-down menu and then selecting Save image from the
File pull-down menu.
- Minimize the Composition Editor for the VisualAge Sell Security
window.
You currently have two visual parts that you are editing in two different
Composition Editors. The part name of the Visual part being edited is
contained in the title bar of the Composition Editor window. Use the
steps in the next section to add the reusable part,
SecurityFormView, to both of these visual parts.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]