ITT Rule IDL Version 7.0 User Manual Page 369

  • Download
  • Add to my manuals
  • Print
  • Page
    / 430
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 368
Chapter 15: Creating a Custom iTool Widget Interface 369
iTool Developer’s Guide Example: a Custom iTool Interface
; Set the THICK property on the plot line and commit the change.
void = (*pState).oTool->DoSetProperty(plotID, 'THICK', $
linesize)
(*pState).oTool->CommitActions
END
Discussion
This routine uses the same technique as the draw_plot_event routine to ensure that
our iTool is the current tool. It then retrieves the identifier of the plot line, ensures
that the line itself is selected, and sets the THICK property on the line. For additional
information on retrieving component identifiers and changing property values, see
Appendix A, “Controlling iTools from the IDL Command Line.
color_event
The color_event routine is specified as the event handler for the Line Color droplist
in the custom section of the interface. The complete code for this event-handler
routine is shown below.
PRO color_event, event
; Retrieve a pointer to the state structure.
wChild = WIDGET_INFO(event.top, /CHILD)
WIDGET_CONTROL, wChild, GET_UVALUE = pState
; Get the iTool identifier and make sure our iTool
; is the current tool.
toolID = (*pState).oTool->GetFullIdentifier()
ITCURRENT, toolID
; Define some line colors.
colors = [[0,0,0],[255,0,0], [0,255,0], [0,0,255]]
; Get the value of the line color droplist and use it
; to select the line color.
linecolor = WIDGET_INFO((*pState).wLineColor, /DROPLIST_SELECT)
newcolor = colors[*,linecolor]
; Select the first plot line visualization in the window.
; There should be only one line, but we select the first one
; just to be sure.
plotID = (*pState).oTool->FindIdentifiers('*plot*', $
/VISUALIZATIONS)
plotObj = (*pState).oTool->GetByIdentifier(plotID[0])
plotObj->Select
Page view 368
1 2 ... 364 365 366 367 368 369 370 371 372 373 374 ... 429 430

Comments to this Manuals

No comments