Procedure: Creating a scrolling window

To create a scrolling window, open the layout window for the window where the scrolling window will be placed.

  1. Draw the scrolling window.

Select the scrolling window tool and draw the scrolling window on the window layout. The Scrolling Window Options window will appear.

  1. Name the scrolling window.

Enter the name of the scrolling window in the Scrolling Window Name field.

  1. Select the link table and link key.

Select the link table from the Link Table list. This table will be linked to the scrolling window; data displayed in the window will come from this table.

Select a table key in the Link Key list. This key determines the order in which records will be sorted if another key isn’t specified when the scrolling window is filled. Click OK to close the Scrolling Window Options window.

  1. Specify the scrolling window characteristics.

To specify the visual properties of the scrolling window, select it in the layout and display the Properties window. The following visual property is specific to scrolling windows:

[spacer]

Property

Description

AltLineColor

If this property is set to true, alternating lines of the scrolling window will appear with a different color. Use the Field_SetAltLineColor() function to specify the alternate line color.


To specify the object properties, double-click the scrolling window to open the scrolling window layout. Display the Properties window to set the object properties for the scrolling window. Set the following properties:

[spacer]

Property

Description

DefaultDblClick

In a browse-only scrolling window, setting the DefaultDblClick property to true provides a short cut, allowing the user to double-click a line in the scrolling window to accomplish the action of selecting a line and clicking the push button that has the Default property set to true.

HelpContextID

This is the help context ID for the scrolling window.

LinkTable

This is the table linked to the scrolling window. Records displayed in the scrolling window come from this table.

LinkTableKey

This is the key for the linked table that specifies the default sorting order for the records in the scrolling window.

Name

This is the name of the scrolling window.

ScrollToBottom

Setting this option to true causes the scrolling window to display records at the end of the linked table, rather than at the beginning. In effect, the scrolling window has been scrolled to the bottom of the table. This is useful for adds-allowed scrolling windows because the user doesn’t have to scroll to the end of the window to add a new item.

WindowID

This is the resource ID of the scrolling window.

WindowType

Specify whether you want a browse-only, editable or adds-allowed scrolling window.


  1. Design the scrolling window.

Design how the scrolling window will appear in normal mode by placing the necessary fields at the top of the window.

  1. Mark the small line item.

Choose Mark Small Line Item from the Tools menu and mark the position of the line, using the crosshairs pointer. The boundary of the small line item is indicated by a dashed line. The items between the dashed line and the top of the layout area will be displayed when the scrolling window is in normal mode.

  1. Mark the big line item (if necessary).

If the scrolling window will display information in expanded mode, add the appropriate additional fields to the window, then choose Mark Big Line Item from the Tools menu and mark its position. The big line item must be marked in multiples of the height of the small line item. For example, if the small line item was 18 pixels high, the big line item must be marked in multiples of 18 pixels. The items between the dashed line indicating the big line item and the top of the layout area will display in expanded mode. If the scrolling window will display information only in normal mode, you don’t need to mark the big line item.

If you need to resize the small line item or big line item, just choose Mark Small Line Item or Mark Big Line Item from the Tools menu and mark the line again.


  1. Add scripts to the scrolling window.

With the scrolling window layout still open, select the Script tab in the Properties window. This lists the scripts that can be applied to the scrolling window. Refer to Adding scripts to a scrolling window for more detailed information.

A window pre script for the window containing the scrolling window usually includes the fill window statement, used to fill the scrolling window with data from the scrolling window’s linked table. The following table shows the other scripts that can be attached to the scrolling window.

[spacer]

Script name

When the script is run

Line pre script

When the focus moves to a different line in the scrolling window.

Line change script

When the focus leaves a line in the scrolling window where some of the information in that line has changed.

Line post script

When the focus leaves a line in the scrolling window.

Line fill script

When the scrolling window first fills, the fill script runs until the window is full. It also runs when a new line is added to the scrolling window from the linked file or when the focus moves to an existing line in the scrolling window. The fill script runs before the line pre script.

Line insert script

When the user chooses the Insert Row menu item or when the insert line statement is run.

Line delete script

When the user chooses the Delete Row menu item or when the delete line statement is run.



Documentation Feedback