bbj40.gif BBjControl


Creation Path


BBjAPI

|

+--BBjSysGui

|

+--BBjControl

 

Description

The BBjControl object is the base object for all SysGui controls and it provides methods for manipulating these controls.

Creation

The BBjControl object is obtained with the following BBjWindow object method:

Return Value

Method

BBjControl

getControl(int id)

Methods of BBjControl

Return Value

Method

BBjPopupMenu

addPopupMenu()

void

clearCallback(int eventType)

void

destroy()

void

focus()

BBjColor

getBackColor()

boolean

getCausesControlValidation()

boolean

getClientEdge()

int

getContextID()

int

getControlType()

BBjFont

getFont()

BBjColor

getForeColor()

int

getHeight()

int

getID()

string

getLongCue()

string

getName()

boolean

getNoEdge()

BBjPopupMenu

getPopupMenu()

boolean

getRaisedEdge()

int

getScreenX()

int

getScreenY()

string

getShortCue()

string

getText()

string

getToolTipText()

Object

getUserData()

int

getWidth()

int

getX()

int

getY()

boolean

isDestroyed()

boolean

isEnabled()

boolean

isOpaque()

boolean

isVisible()

void

removePopupMenu()

void

setBackColor(BBjColor color!)

void

setCallback(int eventType, string subRoutineName)

void

setCallback(int eventType, CustomObject customObj, string methodName)

void

setCausesControlValidation(boolean valid)

void

setClientEdge(boolean client)

void

setEnabled(boolean enabled)

void

setFont(BBjFont font!)

void

setForeColor(BBjColor color!)

void

setLocation(int x, int y)

void

setLongCue(string cue)

void

setName(string name)

void

setNoEdge(boolean noEdge)

void

setOpaque(boolean opaque)

void

setPopupMenu(BBjPopupMenu popupMenu!)

void

setRaisedEdge(boolean raised)

void

setShortCue(string cue)

void

setSize(int width, int height)

void

setText(string text)

void

setToolTipText(string text)

void

setUserData(Object userData)

void

setVisible(boolean visible)

Remarks

All SysGui controls (BBjWindow, BBjGrid, BBjTree, etc.) are also BBjControl objects. All BBjControl object methods, except where otherwise noted, can be used on all controls.

Constants

-1

UNKNOWN_CONTROL

1

MAIN_WINDOW

2

CHILD_WINDOW

11

PUSHBUTTON_CONTROL

12

RADIOBUTTON_CONTROL

13

CHECKBOX_CONTROL

14

HSCROLL_CONTROL

15

VSCROLL_CONTROL

16

EDIT_CONTROL

17

TEXT_CONTROL

18

LISTBOX_CONTROL

19

LISTBUTTON_CONTROL

20

LISTEDIT_CONTROL

21

GROUPBOX_CONTROL

22

CEDIT_CONTROL

24

LINECHART_CONTROL

25

BARCHART_CONTROL

26

PIECHART_CONTROL

28

MENUBUTTON_CONTROL

100

MENUITEM_CONTROL

101

CHECKABLE_MENUITEM_CONTROL

102

STATUSBAR_CONTROL

103

TOOLBUTTON_CONTROL

104

INPUTE_CONTROL

105

INPUTN_CONTROL

106

TAB_CONTROL

107

GRID_CONTROL

108

IMAGE_CONTROL

109

TREE_CONTROL

112

PROGRESS_CONTROL

113

NAVIGATOR_CONTROL

114

INPUTD_CONTROL

117

HSLIDER_CONTROL

118

VSLIDER_CONTROL

119

FILECHOOSER_CONTROL

120

COLORCHOOSER_CONTROL

121

FONTCHOOSER_CONTROL

123

INPUTD_SPINNER_CONTROL

124

INPUTE_SPINNER_CONTROL

125

INPUTN_SPINNER_CONTROL

126

EDIT_SPINNER_CONTROL

Alignment Constants:

 

ALIGN_LEFT

 

ALIGN_RIGHT

 

ALIGN_CENTER

Orientation Constants:

 

HORIZONTAL

 

VERTICAL

Menu Cut/Copy/Paste Constants:

32027

CUT

32028

COPY

32029

PASTE

Color Constants:

0

BLACK

1

BLUE

2

RED

3

MAGENTA

4

GREEN

5

CYAN

6

YELLOW

7

WHITE

8

DKGRAY

9

GRAY

10

LTGRAY

Example

REM Get a control from 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 common addWindow param values
X=10
Y=10
WIDTH=200
HEIGHT=200

REM Create a window with a title in the current context
TITLE$="BBj Window"
REM Set the current context
mySysGui!.setContext(0)
myWindow! = mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$)

REM Add a button on the window using mnemonics
PRINT (SYSGUI)'BUTTON'(101,50,100,90,30,"Button",$$)

REM Get the button
myButton! = myWindow!.getControl(101)

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

BBjAPI

BBjSysGui

BBjWindow Methods

BBj Object Variables

BBj Object Assignment

BBj Object Error Handling

BBj Object Operators

RecordSetBindable

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