comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: IDLgrLegend Property Sheets, array properties
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: IDLgrLegend Property Sheets, array properties [message #39146 is a reply to message #39144] Tue, 20 April 2004 11:18 Go to previous message
sdettrick is currently offline  sdettrick
Messages: 14
Registered: December 2003
Junior Member
I hate to reply to my own message but it has occurred to me that I can
just register each element of the ITEM_NAME and each triplet of the
ITEM_COLOR as a seperate property with a seperate name (e.g.
ITEM_NAME0, ITEM_NAME1, etc). In principle I guess the following
would work ( I say "in principle", because so far I can't get it to
work)

; Register ARRAY properties element-by-element
for i=0,n_elements( item_names )-1 do begin
self -> IDLitComponent::RegisterProperty, $
'ITEM_NAME'+strtrim(i,2),/STRING
self -> IDLitComponent::RegisterProperty, $
'ITEM_COLOR'+strtrim(i,2), /COLOR

self -> IDLitComponent::SetPropertyByIdentifier, $
'ITEM_NAME'+strtrim(i,2), item_names[i]
self -> IDLitComponent::SetPropertyByIdentifier, $
'ITEM_COLOR'+strtrim(i,2), reform( item_colors[*,i]
)
endfor

Then the event handler could use SetProperty instead of
SetPropertyByIdentifier to make changes to the actual ITEM_NAME array
property:

new_value = WIDGET_INFO(event.id, $
COMPONENT = event.component, $
PROPERTY_VALUE = event.identifier)
if strmatch( event.identifier, 'ITEM_NAME*' ) eq 1 then begin
self -> IDLgrLegend::GetProperty, item_name=item_names
modify = fix( strmid( event.identifier, $
strpos( event.identifer,'ITEM_NAME') $
+strlen('ITEM_NAME')))
item_names[modify] = new_value
self -> IDLgrLegend::SetProperty, item_name=item_names
endif

By the way this is all inside a class which inherits from the
IDLgrLegend class.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: explicit redraw does nothing until expose(?) event - IDLitComponent propertysheets
Next Topic: Re: xmanager to call object methods?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 06:41:58 PDT 2025

Total time taken to generate the page: 0.80084 seconds