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

Home » Public Forums » archive » Re: IDLgrLegend and ENABLE_FORMATTING
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: IDLgrLegend and ENABLE_FORMATTING [message #48944] Thu, 08 June 2006 07:39
Jim Pendleton, RSI is currently offline  Jim Pendleton, RSI
Messages: 3
Registered: March 2005
Junior Member
"Jamie Wheeler" <jamiedotwheeleratatmoxacuk@dummy.com> wrote in message
news:Pine.LNX.4.58.0606080406300.14281@ellinga.atm.ox.ac.uk. ..
> Hi all,
>
> I'd like to create a legend using the IDLgrLegend object but I need to be
> able to use subscripts and superscripts in the ITEM_NAMES. From my
> attempts thus far, I gather this is impossible. Please, someone... prove
> me wrong.
>



Here's a perfect instance for subclassing. The IDLgrLegend class does

almost everything you want it to do, but it lacks one small feature.

Don't edit the base class. Instead, create your own class and extend

the method that creates the IDLgrText objects.



Pro YourLegend::CreateGlyphs

Compile_Opt StrictArr

On_Error, 2

;

; Call the superclass method first.

;

self->IDLgrLegend::CreateGlyphs

;

; Now enable formatting on all your text objects.

;

For Index = 0L, N_elements(*self.pItem_Name) - 1 Do Begin

(*self.pTexts)[index]->SetProperty, Enable_Formatting = 1

EndFor

;

; That's it!

;

End





Pro YourLegend__Define

Compile_Opt StrictArr

On_Error, 2

YourLegend = {YourLegend, $

Inherits IDLgrLegend $

}

End



Instead of calling OBJ_NEW('IDLgrLegend'), call OBJ_NEW('YourLegend').

The behavior should be identical except it'll now recognize formatting

commands in your strings.



Jim P.






> Thanks!
> Jamie
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Finding a Filename
Next Topic: Re: End Statement Syntax Problem

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

Current Time: Fri Oct 10 16:07:59 PDT 2025

Total time taken to generate the page: 1.84025 seconds