You may specify this special property's value with an integer data item or literal. PANEL-WIDTHS allows you to specify:
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.
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:
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).
Can be specified with a data item or a literal. It allows you to specify the text content of a panel. The property pays attention to the current setting of the TRANSLATE-TO-ANSI environment configuration variable. 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.
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.
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.