BBjSlider

Creation Path


BBjAPI

|

+--BBjSysGui

|

+--BBjWindow

|

+--BBjSlider

 

Description

The BBjSlider object provides methods for manipulating a GUI slider control.

Implemented Interfaces

DropTarget, Focusable, MouseWheelEnabled, RecordSetBindable, SimpleRecordSetBindable, TabTraversable

Creation

A BBjSlider object is created through the following BBjWindow methods:

Return Value

Method

BBjSlider

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

BBjSlider

addHorizontalSlider(int ID, int x,int y, int width, int height, string flags)

BBjSlider

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

BBjSlider

addVerticalSlider(int ID, int x,int y, int width, int height, string flags)

Methods of BBjSlider

Return Value

Method

boolean

getInverted()

Map<Integer,String>

getLabels()

int

getMajorTickSpacing()

int

getMaximum()

int

getMinimum()

int

getMinorTickSpacing()

int

getOrientation()

boolean

getPaintLabels()

boolean

getPaintTicks()

boolean

getSnapToTicks()

int

getValue()

void

setInverted(boolean inverted)

void

setLabels(Map<Integer,String> labels)

void

setMajorTickSpacing(int tick)

void

setMaximum(int maximum)

void

setMinimum(int minimum)

void

setMinorTickSpacing(int tick)

void

setPaintLabels(boolean paint)

void

setPaintTicks(boolean paint)

void

setSnapToTicks(boolean snap)

void

setValue(int value)

Methods of BBjSlider implemented for DropTarget

Return Value

Method

int

getDropActions()

void

setDropActions(int actions)

BBjVector

getDropTypes()

void

setDropTypes(BBjVector types)

Methods of BBjSlider implemented for Focusable

Return Value

Method

boolean

isFocusable()

void

setFocusable(boolean p_focus)

Methods of BBjSlider implemented for MouseWheelEnabled

Return Value

Method

int

getScrollWheelBehavior()

void

setScrollWheelBehavior(int trav)

Methods of BBjSlider implemented for RecordSetBindable

Return Value

Method

void

bindRecordSet(BBjRecordSet recordset, string fieldname)

string

getBoundFieldName()

Methods of BBjSlider implemented for SimpleRecordSetBindable

Return Value

Method

BBjRecordSet

getBoundRecordSet()

void

unbindRecordSet()

Methods of BBjSlider implemented for TabTraversable

Return Value

Method

boolean

isTabTraversable()

void

setTabTraversable(boolean trav)

Methods of BBjSlider inherited from BBjControl

Events

Callback Code

Object-oriented Event

Read Record Event

Code

ON_CONTROL_SCROLL

BBjControlScrollEvent

Scrollbar Move Event

p

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.

For a sample BBjSlider, refer to the BUI Showcase (demo, code). The BBjSlider defines the following style names:

.BBjSlider

.BBjSlider.bbj-disabled

.BBjSlider.bbj-focused

.BBjSlider.bbj-horizontal

.BBjSlider.bbj-vertical

.BBjSlider.bbj-labels

.BBjSlider.bbj-ticks

.BBjSlider-line

.BBjSlider-line-sliding

.BBjSlider-knob

.BBjSlider-knob-sliding

.BBjSlider-label

.BBjSlider-minor-tick

.BBjSlider-major-tick

Remarks

None.

Constants inherited from BBjControl

Example

REM Add a vertical Slider 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 vertical Slider on the window
myVSlider! = myWindow!.addVerticalSlider(101,180,0,20,200,$0000$)

REM Register the CALLBACK routines
CALLBACK(ON_CONTROL_SCROLL,SLIDER_SCROLLED,mySysGui!.getContext(),myVSlider!.getID())
CALLBACK(ON_CLOSE,APP_CLOSE,mySysGui!.getContext())

REM Process Events
PROCESS_EVENTS

REM Callback routine called when the Slider is used to scroll
SLIDER_SCROLLED:
REM Display a message that the Slider has been used to scroll
MESSAGE$="The Slider has been used to scroll"
LET X=MSGBOX(MESSAGE$)
RETURN

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

See Also

BBjAPI

BBjSysGui

BBjWindow

SCROLL Mnemonic - Set Scrolling Attributes

CALLBACK Verb - Register BBj Subroutine

Focusable

MouseWheelEnabled

TabTraversable

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



______________________________________________________________________________________

Copyright BASIS International Ltd. BBj®, Visual PRO/5®, PRO/5®, and BBx® are registered trademarks.