Using Status Window Controls

Top  Previous  Next

About status windows

A status window is a horizontal window at the bottom of a parent window in which an application can display various kinds of status information. The status window can be divided into panes to display more than one type of information..

Creating the control

Status window controls are created with the CONTROL statement. The status window is created with one pane by default. The dimensions in the CONTROL statement are ignored as the status window is auto sized to the parent windows client area.

 

Example creation statement:

CONTROL win,@STATUS,"Status Window",0,0,0,0,0,2

When used in an MDI frame window the client area of the frame is automatically adjusted to account for the status window. For a regular dialog or window you need to take into account the height of the status bar when drawing into the window. Use the GETSIZE function to determine the height of the control.

Controlling the status window control.

The status window control is accessed through the CONTROLCMD statement/function. CONTROLCMD can be used as a statement or function depending on the command issued.

Statements and Functions

CONTROLCMD window | dialog, ID, @SWRESIZE

Use this statement to inform the status window that the parent has been resized. A status window automatically sizes itself to the parent windows client area at the bottom of the window. The typical place to use this is in response to the @IDSIZE message in the parent window.

CONTROLCMD window | dialog, ID, @SWSETPANES, count, sizes[]

Sets the number of panes and the right edges of the panes.

count is the number of panes to create. sizes[] is an integer array, each element containing the pixel position of the right edge of the pane. If an element of the array is -1 then the corresponding pane extends to right edge of the client area.

CONTROLCMD window | dialog, ID, @SWSETPANETEXT, pane, text$

Use this statement to change the pane text. If there is only one pane then SETCONTROLTEXT can also be used.

pane is the zero-based index of the pane to set.

 

See the example file statusbar.eba for a complete demonstration