Special Properties

PANEL-WIDTHS (numeric)

You may specify this special property's value with an integer data item or literal. PANEL-WIDTHS allows you to specify:

  • How many panels the status bar should hold: You may use an array to specify all the panels on one line, and the number of items in the array determines how many panels are created on the status bar
  • The width of each panel on the status bar: Each number on the array specifies the width of its corresponding panel in characters

So if you specify your status bar using the following array:

DISPLAY STATUS-BAR
        PANEL-WIDTHS   (50,  20,  20)
        [ ... ].

you are setting up a status bar with three panels, the first at 50 characters wide and the other two at 20 characters each.

If you set PANEL-WIDTHS = 0, you create a status bar with one panel extending across its entire width and no text.

If you set PANEL-WIDTHS to a single positive non-zero number greater than the width of the entire status bar (as defined by the width of the host window), the panel gets sized down to fit in the host window and the text is truncated.

If you have a status bar composed of several panels, and you specify particular widths for each of them, for example:

DISPLAY STATUS-BAR
        PANEL-WIDTHS   (25, 25, 25, 25)

and this status bar is displayed in a window that is dynamic, when that window shrinks below the size specified by PANEL-WIDTHS, all the panels are reset to an average size small enough so that all panels fit in the window, say "20, 20, 20, 20".

If you don't want the all of the panels truncated, set the width of the last panel to -1, for example:

DISPLAY STATUS-BAR
        PANEL-WIDTHS   (25, 25, 25, -1)

This will cause the last panel to be sized to whatever space is left available on the window after the first panels have been accommodated. Based on our example, if the window was sized to 80 columns, the panels would be "25, 25, 25, 5".

The widths of panels with no PANEL-WIDTHS specified will be automatically calculated based on the total available width of the status bar divided by the number of panels, as specified through the use of PANEL-STYLE, PANEL-TEXT, or PANEL-INDEX.

When you modify PANEL-WIDTHS, the panel is not visually updated until the text is applied. This means that a MODIFY using PANEL-WIDTHS and no PANEL-TEXT will never be displayed. Conversely, any MODIFY statement without PANEL-WIDTHS reflects the changes immediately.

To erase the contents of a status bar, use:

MODIFY statusbar-handle PANEL-WIDTHS 0.

This removes all the panels and sets up the status bar with one panel extending across its entire width. After this operation, you have one panel with the style of previous panel 1 and no text.

PANEL-STYLE (numeric)

Allows you to specify the preferred style of the actual panel. You may specify the value with an integer data item or literal. Valid values are:

  • Flat (0) - the panel has the same height as the rest of the window, with no visual borders. This style is generally used to present information as a guide, displaying different text to inform the user about the status of the program or the cursor's location on the screen, or prompt for action or data entry into a field. It may also be used to indicate a condition that is temporarily disabled.
  • Lowered (1) - the panel appears sunken in the host window. This style is generally used to indicate that an option is active, for instance, the "numlock" is on or the "insert" mode is active.
  • Raised (2) - the panel appears raised in the host window. This style is generally used to indicate that an option is deactivated ("capslock" off, etc.).

You must apply the PANEL-STYLE before you apply the PANEL-TEXT, in order to have the text displayed properly.

The default is 0 (zero).

PANEL-TEXT (alphanumeric)

Can be specified with a data item or a literal. It allows you to specify the text content of a panel. The text may not exceed 255 characters, else the right-most text is automatically truncated. If the text exceeds the size of the panel, the visibility is the same as in any native Windows control, that is, the left-most text is visible.

PANEL-INDEX (numeric)

An integer data item or literal. It allows you to specify which panel you want to work with. General number range is from 1 to 128. If you specify an index number that is larger than the current number of panels but lower than 128, the status bar attempts to provide the additional panels up to the index number specified. The new panels all have the same width, as determined by the width of the status bar minus the width of the existing panels and divided by the number of additional panels to be generated. The additional panels inherit their style from the first existing panel. If the first panel does not exist, the default style 0 (zero) applies.

SELF-ACT (no parameters)

To have a panel in the status bar act like a push button without additional coding, apply this style to the control. You will also have to constrain your panel styles to either lowered (1) or raised (2). A click on a panel will then toggle the panel between the two styles.

Example:

77 MySecondPanelIsSetToStyle PIC 9. 
    	... 
    	DISPLAY ScreenDemo. 
        ACCEPT  ScreenDemo. 
        INQUIRE	AUTO-PANEL  
                PANEL-INDEX(2) 
                IN MySecondPanelIsSetToStyle. 

Note that SELF-ACT is related to the CMD-CLICKED event. SELF-ACT turns off the CMD-CLICKED event.

Note: The raised and lowered panels do not work with XP Visual styles (WIN32_NATIVECTLS runtime configuration variable).