Code: Select all
sub main()
sStatusBar "Start to display only this text"
sStatusBar , " and add this text"
sStatusBar , " and even add more text"
sStatusBar 'This will clear and restore the StatusBar
end sub
global vStatusBarText as string '=text that is been displayed on the statusbar
sub sStatusBar(optional vNewText, optional vAddText) 'set or add text to the statusbar, nothing = clear&reset it.
if isError(vNewText) then
if isError(vAddText) then 'clear statusbar
vStatusBarText=""
else 'add text to the previous statusbar
vStatusBarText=vStatusBarText & vAddText
endif
else
if isError(vAddText) then 'use new text
vStatusBarText=vNewText
else 'use new text and add the other text as well
vStatusBarText=vNewText & vAddText
endif
endif
vStatusBarText=right(vStatusBarText,int(ThisComponent.CurrentController.VisibleArea.Width/150)) 'Select last part that could be displayed.
if isNull(ThisComponent.CurrentController) then exit sub 'Because the last XEventListener-event can't be written to the statusbar, because it's no longer there!
if vStatusBarText="" then 'reset statusbar
ThisComponent.CurrentController.StatusIndicator.Reset
else 'change the text in the statusbar
ThisComponent.CurrentController.StatusIndicator.Start(vStatusBarText,0)
endif
end sub