TMsgBar inherits from TControl; TMsgItem is a helper class
TMsgBar is a themed status bar replacement that supports embedded interactive
items (clock, date, keyboard indicators, and custom action buttons). It offers
Office 2007/2010/2015 visual styles and centered text alignment. TMsgItem
defines individual embeddable items within a TMsgBar.
#include "FiveWin.ch"
function Main()
local oWnd, oMsgBar, oItem
DEFINE WINDOW oWnd TITLE "TMsgBar Demo" SIZE 600, 400
DEFINE MSGBAR oMsgBar OF oWnd PROMPT "Ready" ;
2010 CLOCK DATE KEYBOARD
// Add a custom clickable item
oItem := TMsgItem():New( oMsgBar, "Records: 0", 120 )
oItem:bAction := {|| MsgInfo( "Status clicked!" ) }
oMsgBar:AddItem( oItem )
ACTIVATE WINDOW oWnd CENTERED
return nil
Notes
TMsgBar supports visual themes via l2007, l2010, and l2015 flags. Only one theme should be enabled at a time.
The CLOCK, DATE, and KEYBOARD clauses (or corresponding methods) add standard system indicators. Clock and date update automatically via an internal timer.
TMsgItem supports two-state bitmaps (hBitmap1 for "on", hBitmap2 for "off"), useful for toggle indicators. Set lActive to switch between them.
Use ShowPopup() to attach a popup menu to an item, enabling context-sensitive actions when the user clicks the item.
TMsgBar is typically used as oWnd:oMsgBar and replaces the traditional oWnd:oStatusBar in themed applications.