OpenInsight 10.2 adds a new event called CELLPOSCHANGED to the EDITTABLE control. This is effectively the same as the normal POSCHANGED event but with the addition of an extra parameter called “ContextFlags” that provides more information on why the event was raised.
bForward = CELLPOSCHANGED( CtrlEntID, | CtrlClassID, | NextColumn, | NextRow, | ContextFlags )
ContextFlags is a simple bitmask integer that contains the following flags:
|Bit Flag Value||Description|
|0x00000001||If set then the cell position was changed via a keystroke.|
|0x00000002||If set then the cell position was changed via the mouse.|
Equates for these flags can be found in the PS_EDITTABLE_EQUATES insert record:
Equ PS_EDT_CTF_NONE$ To 0x00000000; Equ PS_EDT_CTF_KEYSTROKE$ To 0x00000001; Equ PS_EDT_CTF_MOUSECLICK$ To 0x00000002;
Example – testing to see if the position (CARETPOS) was changed via a mouse click:
$Insert PS_EditTable_Equates If BitAnd( ContextFlags, PS_EDT_CTF_MOUSECLICK$ ) Then // CARETPOS was changed by using the mouse. ... End
Notes on using the CELLPOSCHANGED event
- The default promoted system CELLPOSCHANGED event handler performs the same processing as the default promoted system POSCHANGED event handler (i.e. data validation and required checking etc).
- If a CELLPOSCHANGED event handler is defined by the developer then a standard POSCHANGED event will not be raised.
- To preserve backwards compatibility with existing applications the default promoted system CELLPOSCHANGED event will not be compiled into a control if there is no CELLPOSCHANGED quick event handler. This is to ensure that POSCHANGED is always executed if CELLPOSCHANGED has not been explicitly set for a control by the developer.
- CELLPOSCHANGED is available in OpenInsight 10.2 from the Beta 3 release onwards.