BBjGridCellSelectionChangedEvent

Description

In BBj 19.20 and higher, this event is returned by BBjAPI().getLastEvent() when the program is executing callback code that the program has registered for the ON_CELL_SELECTION_CHANGE event.

Methods of BBjGridCellSelectionChangedEvent

Return Value

Method

BBjVector

getSelectedCells()

int

getSelectedCellCount()

Methods of BBjGridCellSelectionChangedEvent implemented for BBjGridEvent

Return Value Method
BBjDataAwareGrid getDataAwareGrid()
BBjDataBoundGrid getDataBoundGrid()
BBjStandardGrid getStandardGrid()

Methods of BBjGridCellSelectionChangedEvent inherited from BBjGridCellEvent

Return Value Method
java.awt.Rectangle getCellBounds()
int getColumn()
string getOriginalText()
int getRow()

Methods of BBjGridCellSelectionChangedEvent inherited from BBjSysGuiEvent

Return Value Method
BBjControl getControl()

Methods of BBjGridCellSelectionChangedEvent inherited from BBjEvent

Return Value Method
string getEventName()
string getEventString()

Remarks

This event will only work when the selection mode is set to GRID_SELECT_CELL and will trigger when the cell is selected or deselected.

Example

rem ' BBjGridCellSelectionChangedEvent Example

sysgui = unt
open (sysgui)"X0"

declare BBjAPI bbjapi!
declare BBjSysGui sysgui!
declare BBjTopLevelWindow window!
declare BBjStandardGrid grid!

bbjapi! = BBjAPI()
sysgui! = bbjapi!.getSysGui()
window! = sysgui!.addWindow(100,100,400,300,"Test Grid getSelectedCount",$00010003$)
window!.setCallback(bbjapi!.ON_CLOSE,"eoj")

rows=10,cols=10
grid! = window!.addGrid(101,10,10,580,350)

rem 'grid!.setEnhancedSelectionModelEnabled(1)

grid!.setDefaultColumnWidth(50)
grid!.setRowHeight(23)
grid!.setMultipleSelection(1)
grid!.setSelectionMode(grid!.GRID_SELECT_CELL)
grid!.setNumRows(rows)
grid!.setNumColumns(cols)
gridvec! = bbjapi!.makeVector()
for row = 0 to rows-1
    for col = 0 to cols-1
        text$=str(row:"00")+","+str(col:"00")
        gridvec!.addItem(text$)
    next col
next row
grid!.setCellText(0,0,gridvec!)

grid!.setCallback(grid!.ON_CELL_SELECTION_CHANGE,"cell_selection_changed")

counter = 0

process_events

eoj:
release

cell_selection_changed:
    ev! = cast(BBjGridCellSelectionChangedEvent,sysgui!.getLastEvent())
    Print "Cell Selection Changed"
    Print "ev!.getColumn()= ",ev!.getColumn()
    Print "ev!.getRow()= ", ev!.getRow()

    Print "ev!.getSelectedCells() = ", ev!.getSelectedCells()
    Print "ev!.getSelectedCellCount() = ", ev!.getSelectedCellCount()
    Print
    counter = counter + 1
    Print counter
    Print
return

ClosedVersion History

  • BBj 19.20: BBjGridCellSelectionChangedEvent introduced.

See Also

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

BBjAPI