BBjGridCell

Description

In BBj 18.0 and higher, this object collects a snapshot of data from a particular cell within a BBjGrid.

Note: Due to certain limitations and exceptions, some function calls are not available in BUI.

Creation

BBjAPI > BBjSysGui > BBjWindow > BBjGrid > BBjGridCell

The BBjGridCell object is created through the BBjGrid:

Return Value

Method

BBjGridCell

getCell(int row, int column)

BBjGridCell

getSelectedCell()

BBjGridCell

makeCell(int row, int column)

Methods of BBjGridCell

Return Value

Method

BBjColor

getBackColor()

BBjVector

getChangedData()

int

getColumn()

BBjFont

getFont()

BBjColor

getForeColor()

int getImageLocation()

int

getListSelection()

string

getMask()

string

getRelated()

string

getRestore()

int

getRow()

boolean

getState()

int

getStyle()

string

getText()

string

getToolTip()

boolean

isEditable()

boolean

isSelected()

void

setBackColor(BBjColor p_color)

void

setBackColor(int red, int green, int blue)

void

setBackColor(int red, int green, int blue, int a)

void

setData(String p_cellText, String p_cellRelated)

void

setFont(BBjFont p_font)

void

setForeColor(BBjColor p_color)

void

setForeColor(int p_red, int p_green, int p_blue)

void

setForeColor(int p_red, int p_green, int p_blue, int p_a)

void setImageLocation(int location)

void

setListSelection(int p_listSelection)

void

setMask(string p_cellMask)

void

setRelated(string p_related)

void

setRestore(string p_restore)

void

setSelected(boolean p_selected)

void

setState(boolean p_state)

void

setStyle(int p_style)

void

setText(string p_cellText)

void

setToolTip(string p_text)

Constants

Value Constant

0

ROW

1

COLUMN

2

TEXT

3

MASK

4

STYLE

5

FOREGROUND_COLOR

6

BACKGROUND_COLOR

7

IS_EDITABLE

8

IS_SELECTED

9

RESTORE

10

RELATED

11

STATE

12

LIST_SELECTION

13 IMAGE_LOCATION
14 FONT
15 HEIGHT (not currently used)
16 WIDTH (not currently used)
17 TOOLTIP

Example

gui! = BBjAPI().openSysGui("X0")
wnd! = gui!.addWindow(gui!.getAvailableContext(),100,50,500,400,"Grid Test")
grd! = wnd!.addGrid(wnd!.getAvailableControlID(),32,24,252,133)
grd!.setEnhancedSelectionModelEnabled(1)
grd!.setNumColumns(2)
grd!.setFitToGrid(BBjGrid.AUTO_RESIZE_NEXT_COLUMN)

vec! = new BBjVector()
vec!.addItem("1")
vec!.addItem("Item 1")
vec!.addItem("2")
vec!.addItem("Item 2")
vec!.addItem("3")
vec!.addItem("Item 3")

grd!.setNumRows(3)
grd!.setCellText(vec!)

rem 'SelectedCell calls are here.

cellvec! = new BBjVector()
cell1! = grd!.makeCell(0,0)
cell2! = grd!.makeCell(1,1)
cell3! = grd!.makeCell(2,0)
cellvec!.add(cell1!)
cellvec!.add(cell2!)
cellvec!.add(cell3!)

grd!.setSelectedCells(cellVec!)
print grd!.getSelectedCells()

wnd!.setCallback(wnd!.ON_CLOSE,"close")

process_events

close:
release

See Also

BBjAPI

BBjGrid

BBjGridData

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