BBjProgressBar

Creation Path


BBjAPI

|

+--BBjSysGui

|

+--BBjWindow

|

+--BBjProgressBar

 

Description

In BBj 3.0 and higher, the BBjProgressBar object provides methods for manipulating a GUI progress bar control.

Implemented Interfaces

DropTarget

Creation

A BBjProgressBar object is created through the following BBjWindow methods:

Return Value

Method

BBjProgressBar

addProgressBar(int ID, int x, int y, int width, int height)

BBjProgressBar

addProgressBar(int ID, int x, int y, int width, int height, int minimum, int maximum)

BBjProgressBar

addProgressBar(int ID, int x, int y, int width, int height, int orientation)

BBjProgressBar

addProgressBar(int ID, int x, int y, int width, int height, int orientation, int minimum, int maximum)

BBjProgressBar

addProgressBar(int ID)

BBjProgressBar

addProgressBar(int ID, int min, int max)

BBjProgressBar

addProgressBar(int ID, int orientation)

BBjProgressBar

addProgressBar(int ID, int orientation, int min, int max)

BBjProgressBar

addProgressBar()

Methods of BBjProgressBar

Return Value

Method

int

getMaximum()

int

getMinimum()

int

getOrientation()

string

getText()

int

getValue()

boolean

isIndeterminate()

boolean

isStringPainted()

void

setIndeterminate(boolean indeterminate)

void

setMaximum(int maximum)

void

setMinimum(int minimum)

void

setOrientation(int orientation)

void

setStringPainted(boolean value)

void

setText(String text)

void

setValue(int value)

Methods of BBjProgressBar implemented for DropTarget

Return Value

Method

int

getDropActions()

void

setDropActions(int actions)

BBjVector

getDropTypes()

void

setDropTypes(BBjVector types)

Methods of BBjProgressBar inherited from BBjControl

Events

Callback Code

Object-oriented Event

Read Record Event

Code

ON_DROP_TARGET_DROP

BBjDropTargetDropEvent

Drop Target Drop Event

D

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


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 BBjProgressBar defines the following CSS style names:

.BBjProgressBar

.BBjProgressBar.bbj-disabled

.BBjProgressBar-bar

.BBjProgressBar-text

.BBjProgressBar-text-firstHalf

.BBjProgressBar-text-secondHalf

Remarks

None.

Constants inherited from BBjControl

Example

REM Add a progress 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=100
Y=100
WIDTH=300
HEIGHT=100
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 some buttons to the window
startButton! = myWindow!.addButton(1,5,10,90,30,"Start")
stopButton! = myWindow!.addButton(2,105,10,90,30,"Stop",$0001$)
resetButton! = myWindow!.addButton(3,205,10,90,30,"Reset")

REM Add a progress bar control to the window
myProgressBar! = myWindow!.addProgressBar(101,5,50,290,30)

REM Register the CALLBACK routines
CALLBACK(ON_CLOSE,APP_CLOSE,mySysGui!.getContext())
CALLBACK(ON_BUTTON_PUSH,doStart,mySysGui!.getContext(),startButton!.getID())
CALLBACK(ON_BUTTON_PUSH,doStop,mySysGui!.getContext(),stopButton!.getID())
CALLBACK(ON_BUTTON_PUSH,doReset,mySysGui!.getContext(),resetButton!.getID())

REM Process Events
PROCESS_EVENTS

doStart:
startButton!.setEnabled(0)
myAPI!.createTimer("",0.1,"progress")
stopButton!.setEnabled(1)
return

doStop:
stopButton!.setEnabled(0)
myAPI!.removeTimer("")
startButton!.setEnabled(1)
return

progress:
myProgressBar!.setValue(myProgressBar!.getValue()+1)
if myProgressBar!.getValue() >= myProgressBar!.getMaximum()
   gosub doStop
endif
return

doReset:
myProgressBar!.setValue(myProgressBar!.getMinimum())
return

REM Callback routine called when the user closes the application window
APP_CLOSE:
RELEASE
RETURN

See Also

BBjAPI

BBjSysGui

BBjWindow

CALLBACK Verb - Register BBj Subroutine

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