
Chapter 8: Creating a Manipulator 219
iTool Developer’s Guide Creating a New Manipulator
; the retrieved IDLitVisImage object.
self.oImage = (*self.pSelectionList)[0]
ENDIF ELSE BEGIN
RETURN
ENDELSE
; Record the current values for the selected images.
iStatus = self->RecordUndoValues()
; *** Interact with the visualization based upon key press.
; ...
; Commit this transaction.
iStatus = self->CommitUndoValues()
; Write information to the status bar
; using inherited IDLitIMessaging ProbeStatusMessage method.
self->ProbeStatusMessage, 'Some manpulation information'
; Update the window to reflect the changes made.
oWin->Draw
END
Discussion
The OnKeyboard method will customarily contain portions of code from any
implemented mouse transaction methods. In this example, if a button press event
occurred, access the list of selected items and verify that the first item is an image. If
so, call IDLitManipulator::RecordUndoValues, as was previously shown in the
OnMouseDown method. Interact with the visualization as defined in an
OnMouseDown or OnMouseMotion method. After making modifications, call
CommitUndoValues to commit the transaction to the undo/redo buffer, previously
shown in the OnMouseUp method. Use the IDLitIMessaging::ProbeStatusMessage
method to write information to the status bar of the iTool and access the
oWin
parameter to update the window, as was previously shown in the OnMouseMotion
method.
Creating a RegisterCursor Method
It is a useful visual indication to the user that a manipulator has been activated if the
cursor changes. You can define a pre-existing cursor for a manipulator using the
DEFAULT_CURSOR property during initialization as described in “Example Init
Method” on page 210 or using the SetProperty method. If none of the predefined
cursors suit your needs, you can create a custom cursor by calling a method that