Defining Secondary Window Attributes

You can define a total of ten attributes for each secondary window that you create. The attributes are the same as those for the main window, except that a secondary window includes a unique name and may be authored to stay on top of other windows.

Secondary window attributes include:

nThe name of the secondary window.

nThe title that appears in the secondary window’s title bar.

nThe position of the window’s upper left corner.

nThe window’s size.

nThe window’s state (maximized or normal).

nThe background color of the scrolling and nonscrolling regions.

nThe window’s on-top state (on top or normal).

You can define as many as five secondary windows for a single Help file. The window attributes are determined by the entry in the [WINDOWS] section of the Help project file and are set when the Help file is opened. Once, the window attributes cannot be changed while the Help file is open. The window attributes do not apply to any other Help file that might be opened during a user’s session.

A secondary window definition has the following form:

window-name="caption", (x-coord, y-coord, width, height), window-state, (scrolling-RGB), (nonscrolling-RGB), ontop-state

The following example shows a sample secondary window definition:

[WINDOWS]
graph="Charts", (0,0,600,723), 0, , (192,192,192), 0

This definition creates a secondary window named “graph” that displays Charts in the title bar. The window is positioned in the extreme upper-left corner of the screen and is 600-by-723 (in Help coordinates). The window appears in its normal state with a light grey background in the nonscrolling region. The window does not stay on top of other application windows.

Note:

The following sections describe each attribute in a secondary window definition. If you have already read about Help window attributes in “The Main Window” section, you may want to skim this section and just read about the window-name and ontop-state attributes.

\sgmlnitp The information here is a summary of the secondary window attributes. For a complete description of each attribute, refer to the [WINDOWS]section in Chapter 16, “The Help Project File.”Window Name

The window-name identifies a secondary window and gives it a name that you can then use when creating jumps and Help macros. In the sample definition above, the window name is “graph.”

Whenever you include this name in a jump hot spot, Help displays the topic in a secondary window. (For an example of a jump to a secondary window, see “Creating Jumps to Secondary Windows,” later in this chapter.)

Caption

The caption is the text that appears in the secondary window’s title bar and in the icon label when the window is minimized. In the sample definition above, the window caption is Charts.

X-Coord and Y-Coord

The x-coord and y-coord attributes are numbers that define where the secondary window appears on the user’s computer screen. The numbers represent the horizontal and vertical location of the upper-left corner of the window as defined in terms of Help’s 1024-by-1024 coordinate system. For example, the upper-left corner coordinates for the sample secondary window “graph” are (0,0), the extreme upper-left corner of the screen.

When Help first displays the window, it uses the position values you’ve specified. Users can move the window after it has been displayed.

Width and Height

The width and height attributes are numbers that define the normal width and height of the window, again in terms of the Windows Help coordinate system. In the example definition, the window is 600-by-723.

When Help first displays the window, it uses the size values you’ve specified. Users can change the window’s size after it has been displayed.

Window State

The window-state is a number (0 or 1) that indicates whether the window is displayed at normal size or maximized when Help first opens it. In the example, the “graph” window is displayed at normal size.

The following table shows the effect of the window-state attribute.

State Initial window position
Normal Window appears in the location and size defined by your position and size values.
Maximized Window fills the entire screen. If the user restores the window to its normal state, it occupies the part of the screen defined by your position and size values.

Scrolling and Nonscrolling Region Background Colors

The scrolling-RGB and nonscrolling-RGB are number sequences that define the background color of the window’s scrolling and nonscrolling regions. The numbers represent the red, green, and blue (RGB) components of the color. If these numbers are not given, the scrolling and nonscrolling areas use the user’s default colors as defined by the Control Panel Colors setting. Help supports any solid or dithered colors available from the Windows system colors. In the example, the secondary window uses light gray [(192,192,192)] as the background color for the nonscrolling region.

Use the Color setting in Control Panel to see the colors resulting from different RGB values. To change the color of text in the window, use your word processor. Format the text in the color that you want it to appear. Just remember not to create conflicts between the text color and any custom background color you might have specified.

On Top State

The ontop state specifies whether the secondary window stays on top of other windows. If the author defines the window as “on top,” the user cannot change the window behavior using the Always On Top command in Help. The on-top value is either 0 for normal behavior or 1 for on-top behavior. The main Help window cannot be authored as a topmost window. The example window “graph” is not defined as an on-top window.