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:
- On the composition surface, directly edit the
part text.
- In the part property sheet, enter the text in the
value column of the text property.
- For a title that is compliant with Common User
Access (CUA) guidelines, use an ITitle* part for
the frame window title. Drop the ITitle* part on
the title bar of the IFrameWindow* part. Then,
define the title in the ITitle* part property
sheet.
- Adding a menu bar
- To add a menu bar to the frame window, do the following:
- Drop an IMenu* part on the free-form surface.
- 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:
- Move any controls that you want to keep to the
free-form surface
- Open the client control's pop-up menu and select Delete
- Drop the new client control part on the client
area
- 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:
- Base the secondary composite part on an
IFrameWindow* part.
- Add any dialog, fly-over text, or message box
parts for the secondary window within its
composite part. They are automatically owned by
the base frame window.
- Add any controls, nonvisual parts, and
connections for the secondary window within its
composite part.
- If there are any features of nested parts that
you want to make available to other windows,
promote those features to the interface of the
composite part. You might want to promote the
following features:
- Attributes that need to be initialized
before the window is opened
- Actions that need to be performed before
the window is opened
- Attributes that provide data needed by
other windows
- Events that other windows need to be
aware of
- 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:
- Is the secondary window defined in its own
composite part?
- Is the secondary window static, or dynamically
created?
The part type you add depends on whether the secondary
window is defined in its own composite part.
- If it is, add the secondary composite part.
- Otherwise, add an IFrameWindow* part.
If you add an IFrameWindow* part for the secondary
window, you will also need to do the following:
- Add any dialog, fly-over text, or message box
parts for the secondary window. Modify their
properties to make the secondary frame window
their owner.
- Add any controls, nonvisual parts, and
connections for the secondary window.
How you add the part depends on whether it is static
or dynamic.
- For a static secondary window, add the part as a
part instance.
- For a dynamically created secondary window, do
the following:
- Add a Factory part from the parts palette
- Change the factory type to the part type
of your secondary window
- Assigning ownership of a secondary window
- To give the primary frame window ownership of a secondary
window, do one of the following:
- For a static secondary window, connect the
primary IFrameWindow* this attribute to
the owner attribute secondary window part.
Be sure to make the connection from the primary
window to the secondary window.
- For a dynamically created secondary window,
connect the primary IFrameWindow* this
attribute to the Factory owner attribute.
- 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:
- Add a Variable part from the parts palette, or
use the Add Part window to add your secondary
window part as a variable.
- If you added a Variable part from the parts
palette, change the variable type to the part
type of your secondary window.
- Connect the IPushButton* buttonClickEvent
feature to the Factory new action.
- 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:
- For a static secondary window, do the following:
- Connect the IPushButton* buttonClickEvent
feature to the secondary window setFocus
action.
- Connect the IPushButton* buttonClickEvent
feature to the secondary window show
action or showModally action.
- For a dynamically created secondary window, do
the following:
- Create the window when the user selects
the push button.
- Connect the Factory newEvent
feature to the Variable show
action or showModally action.
- Connect the Factory newEvent
feature to the Variable setFocus
action.
- Closing a window
- To close a window when the user presses a push button, do
one of the following:
- If the window is static and modeless, and might
be shown again, connect the IPushButton* buttonClickEvent
feature to the IFrameWindow* hide action.
- Otherwise, connect the IPushButton* buttonClickEvent
feature to the IFrameWindow* close action.
- 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:
- For a modeless window, set the autoDeleteObject
property in the factory's property sheet. Select true
in the value column.
- For a modal window, set the autoDeleteTarget
property in the variable's property sheet. Select
true in the value column.
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
IFrameWindow
Property Settings --
IFrameWindow
Portability --
IFrameWindow