CellFocusChanged
This event triggers each time the focus inside the verification table changes.
Syntax
[FieldName]_CellFocusChanged (pTable as ISCBCdrTable, pWorkdoc as ISCBCdrWorkdoc, Reason as CdrTableFocusChangeReason, OldRow as Long, OldColumn as Long, pNewRow as Long, pNewColumn as Long)
Parameter | Description |
---|---|
pTable | Current table object. |
pWorkdoc | Current workdoc object. |
Reason | Reason for the focus change.
Possible values |
OldRow | This parameter contains the index of the derivation row. |
OldColumn | This parameter contains the index of the derivation column. |
pNewRow | This parameter contains the index of the destination row. This value can be changed (set back to OldRow value), to forbid an action, such as double-clicking on the special column. |
pNewColumn | This parameter contains the index of the destination column. This value can be changed (set back to OldColumn value), to forbid an action, such as double-clicking on the special column. |
Sample Code
Private Sub Table_CellFocusChanged(pTable as SCBCdrPROJLib.SCBCdrTable, pWorkdoc as SCBCdrPROJLib.SCBCdrWorkdoc, ByVal Reason as SCBCdrPROJLib.CdrTableFocusChangeReason, ByVal OldRow as Long, ByVal OldColumn as Long, pNewRow as Long, pNewColumn as Long)
Select Case Reason
Case CdrTfcrCellBitmapClicked
'Occurs when a user clicks on cell's picture, e.g., on check-box image of a check-box cell.
Case CdrTfcrCellDoubleClicked
'Occurs if a user double clicks on a table cell. Could be useful if it is designed to implement a kind of database look-up, by double clicking on a cell.
Case CdrTfcrCellLocationClicked
'Occurs when a user clicks on a word that is linked to one of the cells in image viewer. This sets the keyboard focus to the corresponding table cell.
Case CdrTfcrColumnMapped
'Occurs when a user maps a column.
Case CdrTfcrColumnsSwapped
'Occurs when a user swaps two columns.
Case CdrTfcrColumnUnmapped
'Occurs when a user unmaps a column.
Case CdrTfcrEnterPressed
'Occurs when "Enter" key is pressed, i.e. cell (table) validation is activated.
Case CdrTfcrFocusRefreshed
'Occurs when the program refreshes a table.
Case CdrTfcrFormLoaded
'Occurs right after a new document to verify is loaded.
Case CdrTfcrMouseClicked
'Occurs when a cell is selected by mouse click.
Case CdrTfcrRowsMerged
'Occurs when rows were merged to one row.
Case CdrTfcrRowsRemoved
'Occurs when a user removes a row.
Case CdrTfcrTableCandidateChanged
'Occurs when a user changes current table candidate.
Case CdrTfcrTabPressed
'Occurs when the focus is changed to another cell by arrow keys or Tab keys.
Case CdrTfcrUnknownReason
'Focus is changed due to unknown reason.
End Select
'Example of changing cell focus from the script:
'when document is opened, set focus to the first cell
If Reason = CdrTfcrFormLoaded Then
pNewRow = 0
pNewColumn = 0
End If
'Example of changing cell focus from the script: do not allow selection of first cell by mouse
If OldRow = 0 And OldColumn = 0 And Reason = CdrTfcrMouseClicked Then
pNewRow = 1
pNewColumn = 1
End If
End Sub