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

Home » Public Forums » archive » Re: IDLgrLegend geometry
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 geometry [message #23887 is a reply to message #23880] Mon, 26 February 2001 16:17 Go to previous messageGo to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"David Fanning" <davidf@dfanning.com> wrote in message
news:MPG.150498b583111c38989d69@news.frii.com...
> George Constantinides (gconstantinides@mhl.nsw.gov.au) writes:
>
>> I was resizing an IDLgrWindow object and noticed that objects such as
>> IDLgrAxis, IDLgrPlot,IDLgrText resized correctly to fit the new
>> dimensions, but IDLgrLegend did not.
>> [...]
>
> Humm. It's pretty clear that the author of IDLgrLegend
> was *trying* to solve this problem in the ComputeDimensions
> method. Have you tried using this when you resize or change
> to another destination device? It looks to me like this
> would solve all your problems, although I confess I've
> never used IDLgrLegend.

From my reading of the IDLgrLegend code in version 5.4, ComputeDimensions is
called every time the legend is re-drawn, so there should be no need to call
it manually. ComputeDimensions recalculates the dimensions of the legend's
atoms based on the character size of the legend text, and since the text
objects are created with RECOMPUTE_DIMENSIONS = 2, the legend should be
resized every time it is drawn.

In fact on my system legends do get resized as the size of the destination
device changes! I wonder why they don't on yours, George. What version are
you using? Do you have a line that looks like this in the CreateGlyphs
method in idlgrlegend__define.pro?

(*self.pTexts)[index] = OBJ_NEW('IDLgrText', $
FONT = self.oFont, $
COLOR = (*self.pText_Color), $
STRINGS = (*self.pItem_Name)[index],$
RECOMPUTE_DIMENSIONS = 2)

If you want to debug this you could put a break in ComputeDimensions and see
what's happening. (Warning: you may be surprised how often a model's Draw
method is called.)

---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield
National Institute for Water and Atmospheric Research
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: string manipulation
Next Topic: Re: Frustrating array in structure. Please help

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

Current Time: Wed Oct 08 19:04:02 PDT 2025

Total time taken to generate the page: 0.00478 seconds