I stumbled accross a solution. That information should spare others from sweating over a response.
The following seems to work. I adapted it from the actual code in my class method, but I haven't confirmed that the adapted version still compiles & runs ok -- my adaptations *may* have introduced some errors.
MyWinScene = Self->Get(/ALL, ISA='IDLitgrWinScene')
if (N_ELEMENTS(MyWinScene) GT 0) && obj_valid(MyWinScene[0]) then $
MyView = MyWinScene[0]->Get(/ALL, ISA='IDLitgrView')
; /TOOLS/ATMOSPHERE SURFACE TOOL/WINDOW/VIEW_1/ANNOTATION/LEGEND/SURFACE LEGEND ITEM
if (N_ELEMENTS(Self.MyLegend) lt 1) || ~obj_valid(Self.MyLegend[0]) then begin
; when this works correctly (the first time), the current selection is
; /TOOLS/ATMOSPHERE SURFACE TOOL/WINDOW/VIEW_1/VISUALIZATION LAYER/DATA SPACE ROOT/DATA SPACE/SURFACE
SaveSelection = Self->GetSelectedItems()
; Note that SaveSelection is an IDLitVisualization
void = Self->DoAction('Operations/Insert/Legend')
if (N_ELEMENTS(MyView) GT 0) && obj_valid(MyView[0]) then $
MyAnnotation = MyView[0]->Get(/ALL, ISA='IDLitgrAnnotateLayer')
if (N_ELEMENTS(MyAnnotation) GT 0) && obj_valid(MyAnnotation[0]) then $
MyVisLegend = MyAnnotation[0]->Get(/ALL, ISA='IDLitVisLegend')
if (N_ELEMENTS(MyVisLegend) GT 0) && obj_valid(MyVisLegend[0]) then begin
; SaveSelection, and Self.MyLegend[i] are IDLitVisualizations
; In the Init procedure, Self.MyLegend is set equal to OBJARR(2)
for i = 1, N_ELEMENTS(Self.MyLegend)-1 do $
MyVisLegend[0]->AddToLegend, SaveSelection
Self.MyLegend = MyVisLegend[0]->Get(/ALL, ISA='IDLitVisLegendSurfaceItem')
end
end
if (N_ELEMENTS(Self.MyLegend) GT 0) && obj_valid(Self.MyLegend[0]) then $
PropertyChanged = Self->DoSetProperty(Self.MyLegend[0]->GetFullIdentifier(), 'Item_Text', 'Information in first legend')
if (N_ELEMENTS(Self.MyLegend) GT 1) && obj_valid(Self.MyLegend[1]) then $
PropertyChanged = Self->DoSetProperty(Self.MyLegend[1]->GetFullIdentifier(), 'Item_Text', 'Information in second legend')
Self->CommitActions
Regards.
Greg
|