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

Home » Public Forums » archive » 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
IDLgrLegend geometry [message #23896] Mon, 26 February 2001 14:53 Go to previous message
George Constantinides is currently offline  George Constantinides
Messages: 16
Registered: July 2000
Junior Member
Hi all,

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.
This topic has been discussed in the past but with the demise of the
DejaNews news group database, I could not find any references.
So here is a work around that works well on the screen (IDLgrWindow) but
when you send the View to another output object such as IDLgrPrinter,
the fixed geometry of IDLgrLegend becomes a problem again.


;----------------------------------------------------------- -------------




PRO Resize_Events, event

; resize event handler.

Widget_Control, event.top, Get_UValue=info

; Get old window dimension

info.thisWindow->GetProperty, Dimension=WDimOld

; Resize the draw widget.

info.thisWindow->SetProperty, Dimension=[event.x, event.y]

; Resize the Legend. Calculate the size based on the x-width of the
window
; This is a workaround to get the legend font to resize.
; It works well on the screen (IDLgrWindow) but not on the printer
(IDLgrPrinter).

info.oLegend->GetProperty, Font=lFont
Font->GetProperty, Size=lChar
lFont->SetProperty, Size=lChar*event.x/WDimOld[0]

; Redisplay the graphic.

Widget_Control, Hourglass=1
info.thisWindow->Draw, info.oScene
Widget_Control, Hourglass=0

;Put the info structure back.

Widget_Control, event.top, Set_UValue=info, /No_Copy

END


;----------------------------------------------------------- -------------




Does anyone else have the same problem ?
If not, then what is the "proper" way to resize legends ?
If yes, then I am glad that I am not the only one. Did you solve the
problem irrespective of the output destination object, or you gave up in
discussed ?


George Constantinides
Manly Hydraulics Laboratory
email: GeorgeC@mhl.nsw.gov.au
URL http://www.mhl.nsw.gov.au
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Repeats and Triangulation
Next Topic: Ringing the bell?

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

Current Time: Wed Oct 08 15:59:56 PDT 2025

Total time taken to generate the page: 0.00196 seconds