ITT Rule IDL Version 7.0 User Manual Page 386

  • Download
  • Add to my manuals
  • Print
  • Page
    / 430
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 385
386 Appendix A: Controlling iTools from the IDL Command Line
Retrieving Property Information iTool Developer’s Guide
Property Attribute Information
Knowing the property identifier for the property you wish to change is often enough,
if you are already familiar with the property, its data type, and range of possible
values. For example, suppose you want to change the line thickness of a plot line.
You may already know that the value of the THICK property of a plot line is a
floating-point integer, so you can confidently call the DoSetProperty method as
described in “Changing Property Values” on page 389, specifying a floating-point
number for the new line thickness value.
But you may not always know the data type or range of allowed values for a given
property. If you have the property identifier, you can get additional information on
the property using the GetPropertyAttribute method of the IDLitComponent class.
For example, suppose we want to set the value of the WIDTH property of the Smooth
operation. The following statements will retrieve the text description, the data type,
and the range of allowed values for the WIDTH property:
objSmooth->GetPropertyAttribute, 'WIDTH', DESCRIPTION=desc, $
TYPE=type, VALID_RANGE=range
PRINT, desc, type, range
IDL prints:
Smooth Filter Width. 2 0
The first attribute (DESCRIPTION) is the text description of the property. The
second attribute (TYPE) is the data type accepted by the property; the description of
the TYPE attribute reveals that the value 2 indicates that the property accepts an
integer value. The third attribute (VALID_RANGE) is the range of accepted values;
the scalar value 0 indicates that there are no restrictions on the range of integer values
allowed.
See “IDLitComponent::GetPropertyAttribute” (IDL Reference Guide) for additional
information on retrieving property attributes. An Example Property Information
Retrieval Routine” on page 387 discusses an example utility (included in the IDL
distribution) that uses these techniques.
Property Value Information
To retrieve the current value of a property, you must use the property identifier and
the GetPropertyByIdentifier method of the IDLitComponent class.
For example, the following statements will retrieve and print the current value of the
WIDTH property of the Smooth operation in the current iTool:
success = objSmooth->GetPropertyByIdentifier('WIDTH', width_value)
Page view 385
1 2 ... 381 382 383 384 385 386 387 388 389 390 391 ... 429 430

Comments to this Manuals

No comments