Working with IFrameWindow Parts

The following tasks are associated with using an IFrameWindow* part in visual composition. Tasks that are common to many parts are described in related topics.

Defining the title
To define a title for the frame window, do either of the following:

Adding a menu bar
To add a menu bar to the frame window, do the following:
  1. Drop an IMenu* part on the free-form surface.
  2. Connect the IMenu* this attributeattributeto the IFrameWindow* menu attribute.

Adding a tool bar
To add a tool bar to the frame window, drop an IToolBar* part on the title bar of the IFrameWindow* part. The tool bar is added at the top of the client area.

Adding an information area
To add an information (status) area to the frame window, drop an IVBInfoArea* part on the title bar of the IFrameWindow* part. The information area is added at the bottom of the client area.

Changing the client control
To change the client control part for the frame window, do the following:
  1. Move any controls that you want to keep to the free-form surface
  2. Open the client control's pop-up menu and select Delete
  3. Drop the new client control part on the client area
  4. Move any controls that you kept from the free-form surface to the new client control

Defining a secondary frame window composite part
Construction from parts makes it easy to define each frame window, along with its associated data and logic, in a separate composite part. This enhances reusability and object separation.

To define a secondary frame window in its own composite part, consider the following:

Adding a secondary frame window to a composite part
You must add any secondary frame windows to the composite parts that open them. The part type you add and how you add it depends on the following factors:

The part type you add depends on whether the secondary window is defined in its own composite part.

If you add an IFrameWindow* part for the secondary window, you will also need to do the following:

How you add the part depends on whether it is static or dynamic.

Assigning ownership of a secondary window
To give the primary frame window ownership of a secondary window, do one of the following:

Excluding a secondary window from the window list
By default, frame windows are added to the system window list when they are opened. On Windows, this has the effect of adding the window to the task bar. However, it is customary to add only primary windows to the task bar. To exclude a frame window from the window list, open the style property in the IFrameWindow* property sheet and set the windowList style to off.

Dynamically creating a secondary window
To dynamically create a secondary window when the user selects a push button, do the following:
  1. Add a Variable part from the parts palette, or use the Add Part window to add your secondary window part as a variable.

  2. If you added a Variable part from the parts palette, change the variable type to the part type of your secondary window.

  3. Connect the IPushButton* buttonClickEvent feature to the Factory new action.

  4. Connect the Factory newEvent feature to the Variable this attribute.

Initializing data for a secondary window
To load data for a secondary window before opening it, connect attributes in the primary window composite part to corresponding attributes of the secondary window. If the secondary window is defined in its own composite part, ensure that you have promoted attributes of any embedded parts that you want to initialize.

Opening a secondary window
To open a secondary window when the user selects a push button, do one of the following:

Closing a window
To close a window when the user presses a push button, do one of the following:

Removing a static window from the window list
To remove a static secondary window from the window list when it is closed, connect the ready event of the primary composite part (from the free-form surface) to the removeFromWindowList action of the secondary window.

Destroying a dynamically created window
To destroy a dynamically created secondary window after it is closed, do one of the following:


Related procedures
Setting Part Style Properties
Setting Part Color Properties
Setting Part Font Properties
Setting Part Handlers Properties
Setting Part Framing Properties
Working with VisualAge User Interface Parts
Editing Part Labels Directly
Composing Parts for Multiple Threads

Related references
IFrameWindow
Property Settings -- IFrameWindow
Portability -- IFrameWindow