Adding an iTool Window
An iTool drawable area, or window, is created using the CW_ITWINDOW compound widget. The iTool window can display iTool visualizations and atomic IDL graphics objects, provides a mechanism for the display of the iTools property sheet interface, and makes it easy to perform tasks including translation, rotation, and scaling of visualizations using standard iTool manipulators. The signature of the CW_ITWINDOW function is:
Result = CW_ITWINDOW(Parent, UI [, KEYWORDS] )
where:
Window Sizing Keywords
Two properties of the iTool window are worth understanding. The DIMENSIONS keyword specifies the visible area of the window in pixels as a two-element array [width, height]. The VIRTUAL_DIMENSIONS keyword specifies the total size of the drawing area in pixels as a two-element array [width, height]. These two keywords replace the XSIZE/YSIZE and SCR_XSIZE/SCR_YSIZE keywords to the standard IDL draw widget. The X_SCROLL_SIZE/Y_SCROLL_SIZE keywords are likewise unnecessary and ignored; the iTool window automatically handles the addition of scrollbars when necessary.
Modifying Window Contents
The contents of an iTool window can be modified interactively by the user in numerous ways:
- using the mouse and one of the available manipulators (translate, rotate, scale, etc.).
- by interactively selecting an available operation from an iTool menu or toolbar.
- by interactively changing a property value using the iTool property sheet.
- by interactively importing new data and creating new visualizations using the iTool Data Import Wizard or Insert Visualization dialog.
These methods are standard to all iTools, and are discussed in the iTool User's Guide. The contents of the iTool window can also be manipulated programmatically from "outside" the iTool framework in various ways:
- by applying an operation using the iTool object's DoAction method.
- by changing a property value using the iTool object's DoSetProperty method.
- by importing and visualizing new data, either by calling an iTool creation routine with the VIEW_NUMBER keyword set to replace the existing visualization, or by retrieving the iTool data item and using its SetData method.
These programmatic methods for modifying the contents of an existing iTool are discussed in Controlling iTools from the IDL Command Line.
Resizing iTool Windows
The CW_ITWINDOW compound widget defines a separate procedure, CW_ITWINDOW_RESIZE, that accepts as arguments the new width and height of the iTool window. This procedure handles all calculations necessary to properly resize the window, taking into account the current zoom factors and the presence or absence of scroll bars. See CW_ITWINDOW for complete details.