IDLgrLegend Property Sheets, array properties [message #39155] |
Mon, 19 April 2004 17:07 |
sdettrick
Messages: 14 Registered: December 2003
|
Junior Member |
|
|
Hi,
I have a GUI with object graphics (not an iTool GUI), which has an
IDLgrLegend object. I have registered some properties of the
IDLgrLegend with the IDLitComponent framework, so that I can
interactively change the Legend properties with an event handler. It
works well for scalar variables.
However, both the ITEM_COLOR and ITEM_NAME (and all ITEM_* keywords)
are ARRAYS, not SCALARS. IDLitComponent::RegisterProperty can't
handle this - even in the documentation there seems to be no way to
register an ARRAY property.
Does anyone know of a workaround for this? This is NOT the
IDLgrLegend problem treated by RSI tech tip #3678.
Thanks in advance,
Sean Dettrick
PS
In a little more detail, the code crashes at the line of code where
the property sheet is declared:
Result = WIDGET_PROPERTYSHEET( wpopup, VALUE = self )
The ARRAY property which causes the code to crash is the ITEM_NAME,
which I have registered with the line:
self -> IDLitComponent::RegisterProperty, 'ITEM_NAME', /STRING
The IDL error output is:
% WIDGET_PROPERTYSHEET: Expression must be a scalar or 1 element array
in this context: <STRING Array[2]>.
% Execution halted at: MYLEGEND::PROPERTYSHEET
In contrast, these scalar properties all work well:
self -> IDLitComponent::RegisterProperty, 'TEXT_COLOR', /COLOR
self -> IDLitComponent::RegisterProperty, 'SHOW_OUTLINE', /BOOLEAN
self -> IDLitComponent::RegisterProperty, 'OUTLINE_THICK', /FLOAT
The ITEM_COLOR property doesn't crash it (because it expects an RGB
triplet array), but it only allows you to interactively change the
color of the first item in the list:
self -> IDLitComponent::RegisterProperty, 'ITEM_COLOR', /COLOR
|
|
|