ITT Rule IDL Version 7.0 User Manual Page 326

  • Download
  • Add to my manuals
  • Print
  • Page
    / 430
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 325
326 Chapter 14: Creating a User Interface Panel
Example: A Simple UI Panel iTool Developer’s Guide
oTargets = state.oTool->GetSelectedItems(count = nTarg)
IF nTarg GT 0 THEN BEGIN
; If there are selected items, use only the last item
; selected, which is stored in the first element of
; the returned array.
oTarget = oTargets[0]
; Get the iTool identifier of the selected item.
name = oTarget->GetFullIdentifier()
; Retrieve the setting of the HIDE property.
oTarget->GetProperty, HIDE = hide
; Change the value of the HIDE property from 0 to 1
; or from 1 to 0. Use the DoSetProperty and
; CommitActions method to ensure that the change
; is entered into the undo/redo transaction buffer.
void = state.oTool->DoSetProperty(name, "HIDE", $
((hide+1) MOD 2))
state.oTool->CommitActions
ENDIF
BREAK
END
ELSE:
ENDSWITCH
; Refresh the iTool window.
state.oTool->RefreshCurrentWindow
END
Discussion
It is beyond the scope of this chapter to describe the IDL widget concepts employed
in the Example4_panel event handler; the comments in the code describe most of the
features. The following points are worth noting, however:
If the event received by the event handler routine is generated by the
Rotate
button, the example calls the DoAction method of the IDLitUI object, with the
identifier of the
Rotate Left operation as its argument.
If the event received by the event handler routine is generated by the
Hide/Show button, the example does the following:
Use the reference to the iTool object stored in the state structure to retrieve
the list of selected items using the GetSelectedItems method.
Retrieve the object identifier of the last item selected. (Note that the last
item selected is stored in the first element of the returned array.)
Retrieve the value of the HIDE property of the selected item.
Page view 325
1 2 ... 321 322 323 324 325 326 327 328 329 330 331 ... 429 430

Comments to this Manuals

No comments