
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(int ID) |
BBjStatusBar |
addStatusBar(int ID, string flags) |
BBjStatusBar |
addStatusBar(int ID, string title, string flags) |
BBjStatusBar |
addStatusBar() |
BBjStatusBar |
addStatusBar(string flags) |
BBjStatusBar |
addStatusBar(string title, string flags) |
Methods of BBjStatusBar
Return Value |
Method |
---|---|
int |
getLengthAt(int index) |
Rectangle |
getRectangle(int index) |
int |
|
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 |
f |
||
ON_LOST_FOCUS |
f |
||
ON_MOUSE_ENTER |
E |
||
ON_MOUSE_EXIT |
E |
||
ON_POPUP_REQUEST |
r |
||
ON_RIGHT_MOUSE_DOWN |
R |
CSS
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.
BBjStatusBar Example
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:
BBjStatusBar CSS
.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
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
RETURN
See Also
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.