BBjStatusBar

Description

The BBjStatusBar object provides methods for manipulating a GUI status bar control.

Creation

BBjAPI > BBjSysGui > BBjWindow > BBjStatusBar

A BBjStatusBar object is created through the following BBjWindow methods:

Return Value

Method

BBjStatusBar

addStatusBar()

BBjStatusBar

addStatusBar(int ID)

BBjStatusBar

addStatusBar(int ID, string flags)

BBjStatusBar

addStatusBar(int ID, string title, string flags)

BBjStatusBar

addStatusBar(string flags)

BBjStatusBar

addStatusBar(string title, string flags)

Methods of BBjStatusBar

Return Value

Method

BBjVector

getBorders()

int

getLengthAt(int index)

Rectangle

getRectangle(int index)

int

getSegmentCount()

BBjVector

getSegments()

string

getTextAt(int index)

void setAlignmentAt(int index, int align)

void

setMinimumHeight(int height)

void

setSegments(BBjVector segments!)

void

setTextAt(int index, string text)

Methods of BBjStatusBar inherited from BBjControl

Events

Callback Code

Object-oriented Event

Read Record Event

Code

ON_GAINED_FOCUS

BBjGainedFocusEvent

Control Focus Gained/Lost Event

f

ON_LOST_FOCUS

BBjLostFocusEvent

Control Focus Gained/Lost Event

f

ON_MOUSE_ENTER

BBjMouseEnterEvent

Mouse Enter/Exit Event

E

ON_MOUSE_EXIT

BBjMouseExitEvent

Mouse Enter/Exit Event

E

ON_POPUP_REQUEST

BBjPopupRequestEvent

Popup Request Event

r

ON_RIGHT_MOUSE_DOWN

BBjRightMouseDownEvent

Right Mouse Button Down Event

R

BUI logoCSS

The visual appearance of BUI controls is defined using CSS (cascading style sheets) rules. Easily change the default colors, border, and other settings by customizing these rules, all without changing any application code. See CSS API for a high-level overview of BUI CSS.

The BBjStatusBar defines the following style names:

Style Name Description
.BBjStatusBar The primary style name
.BBjStatusBar.bbj-disabled The status bar is disabled
.BBjStatusBar-segment Individual segments
.BBjStatusBar-segment-first First segment
.BBjStatusBar-segment-last Last segment

Remember that it's possible for .BBjStatusBar-segment-first and .BBjStatusBar-segment-last to refer to the same segment.

Example 1

sysgui = UNT
OPEN (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(100,100,150,50,"StatusBar",$00090003$)
window!.setCallback(window!.ON_CLOSE,"eoj")
statusbar! = window!.addStatusBar(99,flags$)
vector! = bbjapi().makeVector()
vector!.add(25)
vector!.add(60)
vector!.add(65535)
statusbar!.setSegments(vector!)
statusbar!.setTextAt(0,"25")
statusbar!.setAlignmentAt(0,statusbar!.RIGHT)
statusbar!.setTextAt(1,"60")
statusbar!.setAlignmentAt(1,statusbar!.RIGHT)
statusbar!.setTextAt(2,"end")
statusbar!.setAlignmentAt(2,statusbar!.RIGHT)
PROCESS_EVENTS

eoj:
RELEASE

With the default styles, it looks like this:

With the styles below, it looks like this:

CSS Example

.BBjStatusBar
{
  border-color: #c7c7c7;
  background: rgb(255,255,255);
  background: -moz-linear-gradient(top,  rgba(255,255,255,1) 0%, rgba(229,229,229,1) 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(229,229,229,1)));
  background: -webkit-linear-gradient(top,  rgba(255,255,255,1) 0%,rgba(229,229,229,1) 100%);
  background: -o-linear-gradient(top,  rgba(255,255,255,1) 0%,rgba(229,229,229,1) 100%);
  background: -ms-linear-gradient(top,  rgba(255,255,255,1) 0%,rgba(229,229,229,1) 100%);
  background: linear-gradient(to bottom,  rgba(255,255,255,1) 0%,rgba(229,229,229,1) 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e5e5e5',GradientType=0 );
}

.BBjStatusBar-segment
{
  color: darkBlue;
  border-color: #c7c7c7;
  padding: 3px;
}

Constants inherited from BBjControl

Example 2

rem ' BBjStatusBar Example

rem 'Add a status bar control to a window
rem 'Obtain the instance of the BBjAPI object
let myAPI!=BBjAPI()

rem 'Open the SysGui device
SYSGUI=UNT
OPEN (SYSGUI) "X0"

rem 'Obtain the instance of the BBjSysGui object
let mySysGui!=myAPI!.getSysGui()

rem 'Set addWindow param values
X=10
Y=10
WIDTH=200
HEIGHT=200
TITLE$="BBj Window"

rem 'Set the current context
mySysGui!.setContext(0)

rem 'Create a window
myWindow! = mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$)

rem 'Add a status bar on the window
myStatusBar! = myWindow!.addStatusBar(1,$0020$)

rem 'Set the text of the status bar
myStatusBar!.setTextAt(0, "This is a status bar")

rem 'Register the CALLBACK routines
CALLBACK(ON_CLOSE,APP_CLOSE,mySysGui!.getContext())

rem 'Process Events
process_events

rem 'Callback routine called when the user closes the application window
APP_CLOSE:
release

See Also

BBjAPI

BBjSysGui

BBjWindow

STATBAR Mnemonic - Create a Status Bar

CALLBACK Verb - Register BBj Subroutine

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.