TStatusBar

Source: source/classes/statusba.prg

Inherits from: TControl

TStatusBar wraps the Windows status bar common control to display a multi-pane status bar at the bottom of a window. It supports an arbitrary number of panes with individual widths and text, an integrated clock, and automatic message display with a configurable timeout.

Key DATA Members

DATATypeDescription
cMsgDefCharacterDefault status bar message text
oTimerObjectInternal timer for message timeout and clock updates
nPartTimeNumericPane index reserved for the clock display

Methods

MethodDescription
New( oWnd, cText, aWidths, aPrompts, lClock )Create a new TStatusBar control
SetMsg( cText )Set the status bar text (typically from oWnd:SetMsg())
SetParts( aWidths )Define pane widths as an array of numeric values
SetPartText( nPart, cText )Set the text of a specific pane by index
GetParts()Return the current pane width definitions
ClockOn()Enable the clock display in the last pane

Example: 3-Pane Status Bar with Clock

#include "FiveWin.ch"

function Main()

   local oWnd

   DEFINE WINDOW oWnd TITLE "StatusBar Demo" SIZE 600, 400

   DEFINE STATUSBAR oWnd PROMPT "Ready" ;
      CLOCK ;
      PARTS 150, 300

   // Set text in individual panes
   oWnd:oStatusBar:SetPartText( 2, "User: Admin" )
   oWnd:oStatusBar:SetPartText( 3, "Records: 42" )

   ACTIVATE WINDOW oWnd CENTERED

return nil

Notes

See Also