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()

boolean

addStyle(string styleName)

void

clearCallback(int eventType)

void

clearStyles()

void

destroy()

void

focus()

string

getAttribute(string attribute)

BBjColor

getBackColor()

boolean

getCausesControlValidation()

boolean

getClientEdge()

string

getClientProperty(Object key)

int

getContextID()

int

getControlType()

BBjFont

getFont()

BBjColor

getForeColor()

int

getHeight()

int

getID()

string

getLongCue()

string

getName()

boolean

getNoEdge()

BBjWindow

getParentWindow()

BBjPopupMenu

getPopupMenu()

boolean

getRaisedEdge()

int

getScreenX()

int

getScreenY()

string

getShortCue()

string

getComputedStyle(string property)

string

getStyle(string property)

BBjVector

getStyles()

string

getText()

string

getToolTipText()

Object

getUserData()

int

getWidth()

int

getX()

int

getY()

boolean

isDestroyed()

boolean

isEnabled()

boolean

isOpaque()

boolean

isVisible()

void

putClientProperty(Object key, Object value)

void

removePopupMenu()

boolean

removeStyle(string styleName)

void

setAttribute(string attribute, string value)

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

setCursor(int cursor)

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

setStyle(string property, string value)

void

setText(string text)

void

setToolTipText(string text)

void

setUserData(Object userData)

void

setVisible(boolean visible)

void

showToolTipText()

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.

All BUI windows and controls inherit the BBjControl style. The basic implementation of this style sets the following CSS properties:

.BBjControl
{
    box-sizing:
    border-box; font: inherit;
}

The box-sizing: border-box setting says that a control defined for a given size will take up precisely that size on the screen, with any padding and borders going inside that defined size. The font: inherit setting initializes the font of each control to the font of its parent. If a custom CSS file defines additional styles for the .BBjControl selector, they'll be applied to every control and every window -- so use this sparingly.

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

Control Constants:

-1

UNKNOWN_CONTROL

0

WINDOW

1

MAIN_WINDOW

2

CHILD_WINDOW

3

MENU

4

SPECIAL_CONTROL

5

NATIVE_CONTROL

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

27

HTMLVIEW_CONTROL

28

MENUBUTTON_CONTROL

29

PRINTPREVIEW_CONTROL

30

GENERICCHART_CONTROL

31

WRAPPED_JCOMPONENT_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

110

DATAAWARE_GRID_CONTROL

112

PROGRESS_CONTROL

113

NAVIGATOR_CONTROL

114

INPUTD_CONTROL

115

NAMESPACE_CONTROL

116

GRID_HEADER_CONTROL

117

HSLIDER_CONTROL

118

VSLIDER_CONTROL

119

FILECHOOSER_CONTROL

120

COLORCHOOSER_CONTROL

121

FONTCHOOSER_CONTROL

122

DATABOUND_GRID_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.



______________________________________________________________________________________

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