ITT Rule IDL Version 7.0 User Manual Page 215

  • Download
  • Add to my manuals
  • Print
  • Page
    / 430
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 214
Chapter 8: Creating a Manipulator 215
iTool Developer’s Guide Creating a New Manipulator
to determine whether a button is pressed during mouse motion, or which button is
pressed if this level of granularity is needed. See “Using Manipulator Public Instance
Data” on page 204 for details.
Example OnMouseMotion Method
The following example shows elements common in an interactive manipulator’s
OnMouseMotion method. For a complete working example, see “Example: Color
Table Manipulator on page 226.
; Configure mouse motion method.
pro ExampleManip::OnMouseMotion, oWin, x, y, KeyMods
; If there is not a valid image, call superclass and return.
IF (~OBJ_VALID(self.oImage)) THEN BEGIN
; Call our superclass.
self->IDLitManipulator::OnMouseMotion, oWin, x, y, KeyMods
RETURN
ENDIF
; Activate if mouse button is held down.
IF self.ButtonPress NE 0 THEN BEGIN
; Manipulate the visualization.
; ...
; Write manipulator information to the status bar
; using inherited IDLitIMessaging ProbeStatusMessage method.
self->ProbeStatusMessage, 'Show user manipulator status'
; Update the window to reflect the changes made.
oWin->Draw
ENDIF
; Call our superclass.
self->IDLitManipulator::OnMouseMotion, oWin, x, y, KeyMods
END
DiscussionThis OnMouseMotion method first verifies that there is a valid
image, oImage, in the class structure field. If not, call the superclass and return. If the
image is valid, make sure a mouse button is pressed during the mouse movement and
modify the image in some fashion. The IDLitIMessaging class (a superclass of
IDLitManipulator) provides access to the iTool status bar through the
ProbeStatusMessage method. Write a simple message, and update the window, which
can be accessed through the OnMouseMotion
oWin parameter. Other available
parameters include window coordinates of the cursor and modifier keys. See
Page view 214
1 2 ... 210 211 212 213 214 215 216 217 218 219 220 ... 429 430

Comments to this Manuals

No comments