bbj40.gif BBjButton


Creation Path


BBjAPI

|

+--BBjSysGui

|

+--BBjWindow

|

+--BBjButton

 

Description

The BBjButton object provides methods for manipulating a GUI button control.

Implemented Interfaces

DropTarget, Focusable, TabTraversable, TextAlignable

Creation

A BBjButton object is created through the following BBjWindow methods:

Return Value

Method

BBjButton

addButton(int ID, int x, int y, int width, int height, string title)

BBjButton

addButton(int ID, int x, int y, int width, int height, string title, string flags)

Methods of BBjButton

Return Value

Method

string

getImageFile()

boolean

getNoEdge()

void

setImage(BBjImage image)

void

setImageFile(string file)

void

setNoEdge(boolean noEdge)

Methods of BBjButton implemented for DropTarget

Return Value

Method

int

getDropActions()

BBjVector

getDropTypes()

void

setDropActions(int actions)

void

setDropType(BBjVector types)

Methods of BBjButton implemented for Focusable

Return Value

Method

boolean

isFocusable()

void

setFocusable(boolean p_focus)

Methods of BBjButton implemented for TabTraversable

Return Value

Method

boolean

isTabTraversable()

void

setTabTraversable(boolean trav)

Methods of BBjButton implemented for TextAlignable

Return Value

Method

int

getAlignment()

void

setAlignment(int p_align)

Methods of BBjButton inherited from BBjControl

Events

Callback Code

Object-oriented Event

Read Record Event

Code

ON_BUTTON_PUSH

BBjButtonPushEvent

Push Button Event

B

ON_FORM_VALIDATION

BBjFormValidationEvent

Form Validation Event

V

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

Remarks

None.

Constants inherited from BBjControl

Example

REM Create a button

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 button on the window
myRedButton! = myWindow!.addButton(101,50,100,90,30,"Red",$0800$)

REM Register the CALLBACK routines
CALLBACK(ON_BUTTON_PUSH,RED_BUTTON_PUSHED,mySysGui!.getContext(),myRedButton!.getID())
CALLBACK(ON_CLOSE,APP_CLOSE,mySysGui!.getContext())

REM Process Events
PROCESS_EVENTS

REM Callback routine called when the red button is pressed
RED_BUTTON_PUSHED:
REM Create the BBjColor Object using colorNum constant
myColorRed! = mySysGui!.makeColor(mySysGui!.RED)
REM Set the button colors to RED
myRedButton!.setBackColor(myColorRed!)
RETURN

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

See Also

BBjAPI

BBjSysGui

BBjWindow

BUTTON Mnemonic - Create a Push Button Control

CALLBACK Verb - Register BBj Subroutine

Focusable

TabTraversable

TextAlignable

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