Getting Started
The visual parts you construct in the Composition Editor are composite
parts because they contain other parts, known as subparts. What's
great about VisualAge is that you can use a composite visual part just like
any other part. So, if you construct your parts carefully, you can
reuse them throughout your application and in other applications.
Every visual part must have a primary part. Typically, this is the
Window part. However, to create a reusable composite part you use a
Form part, which you must make the primary part. The Form part is
similar to a Window part, except that it doesn't have a frame
border. This makes the part ideal for embedding into a window or some
other part in your user interface.
- On the VisualAge Organizer, from the Parts pull-down menu,
select New Part.
- On the New Part window, in the Part class field, type
SecurityFormView; in the Part type field, select
Visual part; then select OK.
- When the Composition Editor opens, delete the default Window part that
appears by selecting Delete from the Window part's pop-up
menu.
- From the Canvas category

add a Form part

.
Because you delete the Window part first, then add the Form part, the Form
part automatically becomes the primary part.
- Note:
- To make a part the primary part, select Become Primary Part from
its pop-up menu. If a part's pop-up menu doesn't have a
Become Primary Part choice, the part is already the primary
part. Nonvisual parts cannot be made the primary part.
The SecurityFormView part is now ready for you to create the user
interface.
- Add the necessary parts to the Form part and edit their labels so the form
looks like what is shown in Creating a reusable part.
As you add parts on top of the form part, they automatically become
children of the form part, just as with a window part.
- Be sure to use the Formatted Text part for the Price per share,
Shares owned and Total value fields and set their
format property to Monetary. Refer to Validating and formatting data for information about setting the format property in a
Formatted Text part.
- Arrange the parts to match the layout shown in Creating a reusable part.
- Because all of the Text parts are intended for output only, change their
properties so that they are read-only. You do this by setting their
editable property to false
- Save your work by selecting Save part from the File
pull-down menu then close the Composition Editor.
You have now finished creating a visual part that we will later
reuse.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]