BBjWindow

Description

A BBjWindow is an object that provides an interface to a GUI window. Graphical controls and child windows can be added to a BBjWindow.   

Extended Interfaces

DropTarget

Creation

BBjAPI > BBjSysGui > BBjWindow

BBjWindow objects are created by creating either a BBjTopLevelWindow or a BBjChildWindow.

Methods of BBjWindow

Return Value

Method

BBjBarChart

addBarChart(int controlID, int left, int top, int width, int height, string xLabel, string yLabel, int seriesCount, int categoryCount, boolean showLegend, boolean is3D, boolean isHorizontal)

addBarChart(int controlID, int left, int top, int width, int height, string xLabel, string yLabel, int seriesCount, int categoryCount, boolean showLegend, boolean is3D, boolean isHorizontal, String flags,

BBjButton

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

addButton(int ID, int x, int y, int width, int height, String title, String flags,

BBjCEdit

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

addCEdit(int ID, int x, int y, int width, int height, string title, String flags,

BBjCheckBox

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

addCheckBox(int ID, int x, int y, int width, int height, string title, String flags,

BBjChildWindow

addChildWindow(int ID, int x, int y, int w, int h, int context)

addChildWindow(int ID, int x, int y, int w, int h, string title, int context)

addChildWindow(int ID, int x, int y, int w, int h, string title, String flags, int context)

addChildWindow(int ID, int x, int y, int w, int h, string title, String flags, int context, string eventMask)

BBjColorChooser

addColorChooser(int ID, int x, int y, int width, int width)

addColorChooser(int ID, int x, int y, int width, int height, BBjColor selected!)

addColorChooser(int ID, int x, int y, int width, int height, BBjColor selected!, String flags,

BBjDataAwareGrid

addDataAwareGrid(int ID, int x, int y, int width, int height, int channel, string template)

addDataAwareGrid(int ID, int x, int y, int width, int height, String flags, int channel, string template)

addDataAwareGrid(int ID, int rowID, int colID, int x, int y, int width, int height, int channel, string template)

addDataAwareGrid(int ID, int rowID, int colID, int x, int y, int width, int height, String flags, int channel, string template)

BBjDataBoundGrid

addDataBoundGrid(int ID, int x, int y, int width, int width)

addDataBoundGrid(int ID, int x, int y, int width, int height, String flags,

BBjEditBox

addEditBox(int ID, int x, int y, int width, int height, String title)

addEditBox(int ID, int x, int y, int width, int height, String title, String flags)

addEditBox(int ID, int x, int y, int width, int height, String title, String flags, string type)

BBjEditBoxSpinner

addEditBoxSpinner(int ID, int x, int y, int width, int height, string text$)

addEditBoxSpinner(int ID, int x, int y, int width, int height, string text$, String flags$)

addEditBoxSpinner(int ID, int x, int y, int width, int height, BBjVector list!)

addEditBoxSpinner(int ID, int x, int y, int width, int height, BBjVector list!, String flags$)

addEditBoxSpinner(int ID, int x, int y, int width, int height, BBjVector list!, string text$)

BBjFileChooser

addFileChooser(int ID, int x, int y, int width, int height, string directory)

addFileChooser(int ID, int x, int y, int width, int height, string directory, String flags,

BBjFontChooser

addFontChooser(int ID, int x, int y, int width, int width)

addFontChooser(int ID, int x, int y, int width, int height, BBjFont font!)

addFontChooser(int ID, int x, int y, int width, int height, BBjFont font!, String flags)

BBjGenericChart

addGenericChart(int controlID, int left, int top, int width, int width)

addGenericChart(int controlID, int left, int top, int width, int height, String flags)

BBjGrid

addGrid(int ID, int x, int y, int width, int width)

addGrid(int ID, int x, int y, int width, int height, String flags)

addGrid(int ID, int x, int y, int width, int height, String flags, int rows, int columns)

addGrid(int ID, int rowID, int colID, int x, int y, int width, int width)

addGrid(int ID, int rowID, int colID, int x, int y, int width, int height, String flags)

addGrid(int ID, int rowID, int colID, int x, int y, int width, int height, String flags, int rows, int columns)

BBjGroupBox

addGroupBox(int ID, int x, int y, int width, int height, String title)

addGroupBox(int ID, int x, int y, int width, int height, String title, String flags)

BBjScrollBar

addHorizontalScrollBar int ID, int x,int y, int width, int height, String flags)

addHorizontalScrollBar(int ID, int x,int y, int width, int width)

BBjSlider

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

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

BBjHtmlEdit

addHtmlEdit(int ID, int x, int y, int width, int width, String html)

addHtmlEdit(int ID, int x, int y, int width, int width, String html, string flags)

BBjHtmlView

addHtmlView(int ID, int x, int y, int width, int width, String html)

addHtmlView(int ID, int x, int y, int width, int width, String html, string flags)

BBjImageCtrl

addImage(int ID, int x, int y, int width, int height, string filename) – deprecated, use addImageCtrl

BBjImageCtrl

addImageCtrl(int ID, int x, int y, int width, int height, BBjImage image)

addImageCtrl(int ID, int x, int y, int width, int height, string filename)

BBjInputD

addInputD(int ID, int x, int y, int w, int h)

addInputD(int ID, int x, int y, int w, int h, String flags)

addInputD(int ID, int x, int y, int w, int h, String flags, String mask)

addInputD(int ID, int x, int y, int w, int h, String flags, String mask, string rules)

addInputD(int ID, int x, int y, int w, int h, String flags, String mask, string rules, int restore)

addInputD(int ID, int x, int y, int w, int h, String flags, String mask, string rules, int restore, int value)

BBjInputDSpinner

addInputDSpinner(int ID, int x, int y, int w, int h)

addInputDSpinner(int ID, int x, int y, int w, int h, int min, int max)

addInputDSpinner(int ID, int x, int y, int w, int h, String flags$)

addInputDSpinner(int ID, int x, int y, int w, int h, String flags$, int min, int max)

addInputDSpinner(int ID, int x, int y, int w, int h, String flags$, String mask$)

addInputDSpinner(int ID, int x, int y, int w, int h, String flags$, String mask$, int min, int max)

addInputDSpinner(int ID, int x, int y, int w, int h, String flags$, String mask$, string rules$)

addInputDSpinner(int ID, int x, int y, int w, int h, String flags$, String mask$, string rules$, int restore, int value)

addInputDSpinner(int ID, int x, int y, int w, int h, String flags$, String mask$, string rules$, int restore, int value, int min, int max)

BBjInputE

addInputE(int ID, int x, int y, int w, int h)

addInputE(int ID, int x, int y, int w, int h, String flags)

addInputE(int ID, int x, int y, int w, int h, String flags, int len)

addInputE(int ID, int x, int y, int w, int h, String flags, int len, string pad)

addInputE(int ID, int x, int y, int w, int h, String flags, int len, string pad, string val)

addInputE(int ID, int x, int y, int w, int h, String flags, int len, string pad, int initPos, string restore, string val)

addInputE(int ID, int x, int y, int w, int h, String flags, String mask)

addInputE(int ID, int x, int y, int w, int h, String flags, String mask, string pad)

addInputE(int ID, int x, int y, int w, int h, String flags, String mask, string pad,string val)

BBjInputESpinner

addInputESpinner(int ID, int x, int y, int w, int h)

addInputESpinner(int ID, int x, int y, int w, int h, BBjVector list!)

addInputESpinner(int ID, int x, int y, int w, int h, String flags$)

addInputESpinner(int ID, int x, int y, int w, int h, String flags$, BBjVector list!)

addInputESpinner(int ID, int x, int y, int w, int h, String flags$, int len)

addInputESpinner(int ID, int x, int y, int w, int h, String flags$, int len, BBjVector list!)

addInputESpinner(int ID, int x, int y, int w, int h, String flags$, int len, string pad$)

addInputESpinner(int ID, int x, int y, int w, int h, String flags$, int len, string pad$, BBjVector list!)

addInputESpinner(int ID, int x, int y, int w, int h, String flags$, int len, string pad$, string val$)

addInputESpinner(int ID, int x, int y, int w, int h, String flags$, int len, string pad$, string val$, BBjVector list!)

addInputESpinner(int ID, int x, int y, int w, int h, String flags$, int len, string pad$, int initPos, string restore$, string val$)

addInputESpinner(int ID, int x, int y, int w, int h, String flags$, int len, string pad$, int initPos, string restore$, string val$, BBjVector list!)

addInputESpinner(int ID, int x, int y, int w, int h, String flags$, String mask$)

addInputESpinner(int ID, int x, int y, int w, int h, String flags$, String mask$, BBjVector list!)

addInputESpinner(int ID, int x, int y, int w, int h, String flags$, String mask$, string pad$)

addInputESpinner(int ID, int x, int y, int w, int h, String flags$, String mask$, string pad$, BBjVector list!)

addInputESpinner(int ID, int x, int y, int w, int h, String flags$, String mask$, string pad$, string val$)

addInputESpinner(int ID, int x, int y, int w, int h, String flags$, String mask$, string pad$, string val$, BBjVector list!)

addInputESpinner(int ID, int x, int y, int w, int h, String flags$, String mask$, string pad$, int initPos, string restore$, string val$)

addInputESpinner(int ID, int x, int y, int w, int h, String flags$, String mask$, string pad$, int initPos, string restore$, string val$, BBjVector list!)

BBjInputN

addInputN(int ID, int x, int y, int w, int h)

addInputN(int ID, int x, int y, int w, int h, String flags)

addInputN(int ID, int x, int y, int w, int h, String flags, String mask)

addInputN(int ID, int x, int y, int w, int h, String flags, String mask, string rules)

addInputN(int ID, int x, int y, int w, int h, String flags, String mask, string rules, int restore, int value)

BBjInputNSpinner

addInputNSpinner(int ID, int x, int y, int w, int h)

addInputNSpinner(int ID, int x, int y, int w, int h, int min, int max)

addInputNSpinner(int ID, int x, int y, int w, int h, String flags$)

addInputNSpinner(int ID, int x, int y, int w, int h, String flags$, int min, int max)

addInputNSpinner(int ID, int x, int y, int w, int h, String flags$, String mask$)

addInputNSpinner(int ID, int x, int y, int w, int h, String flags$, String mask$, int min, int max)

addInputNSpinner(int ID, int x, int y, int w, int h, String flags$, String mask$, string rules$)

addInputNSpinner(int ID, int x, int y, int w, int h, String flags$, String mask$, string rules$, int restore, int value)

addInputNSpinner(int ID, int x, int y, int w, int h, String flags$, String mask$, string rules$, int restore, int value, int min, int max)

BBjLineChart

addLineChart(int controlID, int left, int top, int width, int height, string xLabel, string yLabel, int numSeries, boolean showLegend)

addLineChart(int controlID, int left, int top, int width, int height, string xLabel, string yLabel, int numSeries, boolean showLegend, String flags)

BBjListBox

addListBox(int ID, int x, int y, int width, int height, string initialContents)

addListBox(int ID, int x, int y, int width, int height, string initialContents, String flags)

BBjListButton

addListButton(int ID, int x, int y, int width, int height, string initialContents)

addListButton(int ID, int x, int y, int width, int height, string initialContents, String flags,

BBjListEdit

addListEdit(int ID, int x, int y, int width, int height, string initialContents)

addListEdit(int ID, int x, int y, int width, int height, string initialContents, String flags,

BBjMenuButton

addMenuButton(int ID, int x, int y, int width, int height, String title)

addMenuButton(int ID, int x, int y, int width, int height, String title), String flags)

BBjNavigator

addNavigator(int ID, int x, int y, int width, int height, String title)

addNavigator(int ID, int x, int y, int width, int height, String title, String flags,

BBjPieChart

addPieChart(int controlID, int left, int top, int width, int height, boolean showLegend, boolean is3D)

addPieChart(int controlID, int left, int top, int width, int height, boolean showLegend, boolean is3D, String flags)

BBjPieChart

 

BBjProgressBar

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

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

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

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

BBjPrintPreview

addPrintPreview(int ID, int x, int y, int width, int height, String flags)

BBjRadioButton

addRadioButton(int ID, int x,int y, int width, int height, String title)

addRadioButton(int ID, int x,int y, int width, int height, String title, String flags,

BBjRadioGroup

addRadioGroup()

addRadioGroup(BBjVector radiobutton!)

BBjSlider

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

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

BBjStaticText

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

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

BBjStatusBar

addStatusBar(int ID)

addStatusBar(int ID, string flags)

addStatusBar(int ID, string title, string flags)

BBjTabCtrl

addTabCtrl(int ID, int x, int y, int w, int h)

BBjTabCtrl

addTabCtrl(int ID, int x, int y, int w, int h, string flags)

BBjTabCtrl

addTabCtrl(int ID, int x, int y, int w, int h, string flags, string styles)

BBjTabCtrl

addTabCtrl(int ID, int x, int y, int w, int h, string flags, string styles, string tabDesc)

BBjTabCtrl

addTabCtrl(int ID, int x, int y, int w, int h, string flags, string styles, string tabDesc, int imageList)

BBjToolButton

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

BBjToolButton

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

BBjTree

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

BBjTree

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

BBjScrollBar

addVerticalScrollBar(int ID, int x, int y, int width, int width)

BBjScrollBar

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

BBjWrappedJComponent

addWrappedJComponent(int ID, int x, int y, int w, int h, ClientObject jComponent)

BBjChildWindow

createChildWindow(int resHandle, int childWindowID, int controlID, int x, int y)

BBjChildWindow

createChildWindow(int resHandle, int childWindowID, int controlID, int x, int y, int context)

BBjVector

getAllControls()

int

getAvailableControlID()

BBjChildWindow

getChildWindow(int id)

getChildWindow(string name)

BBjControl

getControl(int id)

getControl(string name)

BBjDrawPanel

getDrawPanel()

BBjImage

getDrawPanelImage()

BBjControl

getFocusedControl()

int

getFocusedControlID()

int

getHorizontalScrollPosition()

int

getHorizontalScrollWidth()

BBjImage

getIcon()

BBjVector

getIcons()

boolean

getRepaintEnabled()

boolean

getReportAllKeyEvents()

boolean

getReportAllMouseEvents()

int

getVerticalScrollHeight()

int

getVerticalScrollPosition()

string

getWindowFlags()

BBjImage

getWindowImage()

boolean

isEnterAsTab()

void

raise()

BBjControl

restoreControl(BBjControl control)

void

setCursor(string filename)

setCursor(int cursorid)

void

setEnterAsTab(boolean enterAsTab)

void

setHorizontalScrollPosition(int position)

void

setIcon(string filename$)

setIcon(string filename$, int index)

setIcon(BBjImage image!)

void

setIcons(BBjVector images!)

void

setRepaintEnabled(boolean enabled)

void

setReportAllKeyEvents(boolean report)

void

setReportAllMouseEvents(boolean report)

void

setScribble(boolean scribble)

void

setTrack(boolean track)

void

setVerticalScrollPosition(int position)

Methods of BBjWindow implemented for DropTarget

Return Value

Method

int

getDropActions()

void

setDropActions(int actions)

BBjVector

getDropTypes()

void

setDropTypes(BBjVector types!)

Methods of BBjWindow inherited from BBjControl

Convenience Methods of BBjWindow

In BBj 6.0 and higher, BBjWindow provides convenience methods listed in the table below. Each of these method calls getControl(int controlID) and casts the returned value to a specific control type. Convenience methods can be used to avoid using the CAST() Function if the developer knows the type of a control.

In BBj 11.0 and higher, these methods can be called with a string name.

 

Return Value

Method

BBjBarChart

getBarChart(int controlID)

BBjBarChart

getBarChart(string name)

BBjButton

getButton(int ID)

BBjButton

getButton(string name)

BBjCEdit

getCEdit(int ID)

BBjCEdit

getCEdit(string name)

BBjCheckBox

getCheckBox(int controlID)

BBjCheckBox

getCheckBox(string name)

BBjDataAwareGrid

getDataAwareGrid(int controlID)

BBjDataAwareGrid

getDataAwareGrid(string name)

BBjDataBoundGrid

getDataBoundGrid(int controlID)

BBjDataBoundGrid

getDataBoundGrid(string name)

BBjEditBox

getEditBox(int controlID)

BBjEditBox

getEditBox(string name)

BBjEditBoxSpinner

getEditBoxSpinner(int controlID)

BBjEditBoxSpinner

getEditBoxSpinner(string name)

BBjGenericChart

getGenericChart(int controlID)

BBjGenericChart

getGenericChart(string name)

BBjGridHeader

getGridHeader(int controlID)

BBjGridHeader

getGridHeader(string name)

BBjGroupBox

getGroupBox(int ID)

BBjGroupBox

getGroupBox(string name)

BBjHtmlEdit

getHtmlEdit(int controlID)

BBjHtmlEdit

getHtmlEdit(string name)

BBjHtmlView

getHtmlView(int ID)

BBjHtmlView

getHtmlView(string name)

BBjImageCtrl

getImageCtrl(int ID)

BBjImageCtrl

getImageCtrl(string name)

BBjInputD

getInputD(int ID)

BBjInputD

getInputD(string name)

BBjInputDSpinner

getInputDSpinner(int controlID)

BBjInputDSpinner

getInputDSpinner(string name)

BBjInputE

getInputE(int ID)

BBjInputE

getInputE(string name)

BBjInputESpinner

getInputESpinner(int controlID)

BBjInputESpinner

getInputESpinner(string name)

BBjInputN

getInputN(int ID)

BBjInputN

getInputN(string name)

BBjInputNSpinner

getInputNSpinner(int controlID)

BBjInputNSpinner

getInputNSpinner(string name)

BBjLineChart

getLineChart(int controlID)

BBjLineChart

getLineChart(string name)

BBjListBox

getListBox(int ID)

BBjListBox

getListBox(string name)

BBjListButton

getListButton(int ID)

BBjListButton

getListButton(string name)

BBjListEdit

getListEdit(int ID)

BBjListEdit

getListEdit(string name)

BBjMenu

getMenu(int ID)

BBjMenu

getMenu(string name)

BBjMenuBar

getMenuBar(int ID)

BBjMenuBar

getMenuBar(string name)

BBjMenuButton

getMenuButton(int controlID)

BBjMenuButton

getMenuButton(string name)

BBjMenuItem

getMenuItem(int ID)

BBjMenuItem

getMenuItem(string name)

BBjNavigator

getNavigator(int ID)

BBjNavigator

getNavigator(string name)

BBjPieChart

getPieChart(int controlID)

BBjPieChart

getPieChart(string name)

BBjProgressBar

getProgressBar(int ID)

BBjProgressBar

getProgressBar(string name)

BBjRadioButton

getRadioButton(int ID)

BBjRadioButton

getRadioButton(string name)

BBjScrollBar

getScrollBar(int ID)

BBjScrollBar

getScrollBar(string name)

BBjSlider

getSlider(int controlID)

BBjSlider

getSlider(string name)

BBjStandardGrid

getStandardGrid(int ID)

BBjStandardGrid

getStandardGrid(string name)

BBjStaticText

getStaticText(int ID)

BBjStaticText

getStaticText(string name)

BBjStatusBar

getStatusBar(int ID)

BBjStatusBar

getStatusBar(string name)

BBjTabCtrl

getTabCtrl(int ID)

BBjTabCtrl

getTabCtrl(string name)

BBjToolButton

getToolButton(int ID)

BBjToolButton

getToolButton(string name)

BBjTree

getTree(int ID)

BBjTree

getTree(string name)

Events

Callback Code

Object-oriented Event

Read Record Event

Code

ON_ACTIVATE

BBjActivateEvent

Activation

A

ON_CLOSE

BBjCloseEvent

Window Close Box

X

ON_COLOR_CHANGE

BBjColorChangeEvent

System Color Change Event

s

ON_DEACTIVATE

BBjDeactivateEvent

Activation

A

ON_DOUBLE_CLICK

BBjDoubleClickEvent

Mouse Double-Click

2

ON_DROP_TARGET_DROP

BBjDropTargetDropEvent

Drop Target Drop Event

D

ON_KEYPRESS

BBjKeypressEvent

Keypress

t

ON_MINIMIZE

BBjMinimizeEvent

Activation

A

ON_MOUSE_DOWN

BBjMouseDownEvent

Mouse Button Down

d

ON_MOUSE_ENTER

BBjMouseEnterEvent

Mouse Enter/Exit Event

E

ON_MOUSE_EXIT

BBjMouseExitEvent

Mouse Enter/Exit Event

E

ON_MOUSE_MOVE

BBjMouseMoveEvent

Mouse Move

m

ON_MOUSE_SCROLL

BBjScrollWheelEvent

Mouse Scroll Wheel

w

ON_MOUSE_UP

BBjMouseUpEvent

Mouse Button Up

u

ON_RESIZE

BBjResizeEvent

Window Resize

S

ON_RESTORE

BBjRestoreEvent

Activation

A

ON_RIGHT_MOUSE_DOWN

BBjRightMouseDownEvent

Right Mouse Button Down Event

R

ON_SCREEN_RESIZE

BBjScreenResizeEvent

Screen Resize Event

s

ON_WINDOW_MOVE

BBjWindowMoveEvent

Window Move

L

ON_WINDOW_SCROLL

BBjWindowScrollEvent

Scrollbar Move

p

ON_WINDOW_GAINED_FOCUS

BBjWindowGainedFocusEvent

Window Focus Gained/Lost Event

F

ON_WINDOW_LOST_FOCUS

BBjWindowLostFocusEvent

Window Focus Gained/Lost Event

F

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 next level contains a BBjWindow structure, the container for individual BBjControls. The BBjWindow defines a special style name (capture) to enable mouse capture mode. When this mode is selected, a mousedown on the window causes it to capture all mouse move events, including ones that fall outside the window bounds, until the next mouseup.

Click here.

Remarks

All BBjControl objects are created via a window object. Except for the tree, all controls created with object syntax can also be manipulated with mnemonics and sendmsgs. They are identical to the controls created with mnemonics or in a resource. All events for the controls still will be generated.

Constants

None.

Example

REM Create 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 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

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