Next: , Previous: kCADEventIDUndoRedo, Up: CAD events


7.24 kCADEventIDWriteString

In Write string mode, preference settings of CADSetAreaPrefs determine whether string editing is handled by the application or by the built-in string editor.

If string editing is to be handled by the application, then a mouse click triggers a kCADEventPhaseDuring phase of kCADEventIDWriteString. It is generated on mouse-down, which implies that there is no string-box tracking if the application handles string editing.

If string editing is handled by the built-in string editor, then the following events are triggered instead:

kCADEventPhaseBefore

IO Parameter Type Description
in theCADArea longint Area ID
in theEventID longint kCADEventIDWriteString
in theEventPhase longint kCADEventPhaseBefore
in theEventData1 longint the Object ID of the string object
in theEventData2 longint kCADTrue is the string object is a new object, kCADFalse if not
in theEventData3 longint kCADFalse if the string is single-line, kCADTrue if it is multi-line
in theEventData4 longint 0
in theMouseX real Mouse X-coordinate, optionally snapped if the string is single-line
in theMouseY real Mouse Y-coordinate, optionally snapped if the string is single-line
in theEventValue1 real Unsnapped mouse X-coordinate for a single-line string, the optional width for a multi-line string
in theEventValue2 real Unsnapped mouse Y-coordinate for a single-line string, the optional height for a multi-line string
in theKeyAsciiValue integer 0
in theModifiers longint Sum of pressed modifier keys, a mask of modifier key constants (also see CADGetAreaPrefs and CADSetAreaPrefs)
in theTickCount longint Tick count of the system software (a tick is a 1/60th of a second)
out theEventResult longint Set to kCADEventResultDoFilter to filter out the event or to kCADEventResultDontFilter to let it pass.

kCADEventPhaseDuring

IO Parameter Type Description
in theCADArea longint Area ID
in theEventID longint kCADEventIDWriteString
in theEventPhase longint kCADEventPhaseDuring
in theEventData1 longint Current Layer or Sublayer ID
in theEventData2 longint 0
in theEventData3 longint kCADTrue if the mouse cursor is snapped, kCADFalse if not
in theEventData4 longint Target object scope, initially empty. If you add objects to this scope, they will be removed by a successive undo action
in theMouseX real Mouse X-coordinate, optionally snapped
in theMouseY real Mouse Y-coordinate, optionally snapped
in theEventValue1 real Unsnapped mouse X-coordinate
in theEventValue2 real Unsnapped mouse Y-coordinate
in theKeyAsciiValue integer 0
in theModifiers longint Sum of pressed modifier keys, a mask of modifier key constants (also see CADGetAreaPrefs and CADSetAreaPrefs)
in theTickCount longint Tick count of the system software (a tick is a 1/60th of a second)
out theEventResult longint Set to kCADEventResultTriggerUndoRedo to trigger an undo and redo. Set to kCADEventResultTriggerUndoOnly to trigger an undo only. Set to kCADEventResultTriggerNone to trigger nothing. The default undo action removes those objects that were added to the target object scope.

kCADEventPhaseAfter

IO Parameter Type Description
in theCADArea longint Area ID
in theEventID longint kCADEventIDWriteString
in theEventPhase longint kCADEventPhaseAfter
in theEventData1 longint the Object ID of the string object
in theEventData2 longint kCADTrue is the string object is a new object, kCADFalse if not
in theEventData3 longint kCADTrue if the edit-box was accepted, kCADFalse if it was canceled
in theEventData4 longint 0
in theMouseX real 0.0
in theMouseY real 0.0
in theEventValue1 real 0.0
in theEventValue2 real 0.0
in theKeyAsciiValue integer 0
in theModifiers longint 0
in theTickCount longint 0
out theEventResult longint Don’t change.