Re: axis on a widget draw [message #37932] |
Mon, 09 February 2004 10:47  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Valerio Pace writes:
> I have created a widget base in which there is a widget draw.
> Now, I wanna display x-axis and y-axis on the left side and on the upper
> size of the widget draw, but out of it. The axis must be displayed on the
> widget base.
> How can I do it?
Well, you can't. At least not if you insist on the axes
being drawn on a widget base. :-)
But you could fake it easy enough. Create a compound
widget consisting of three draw widgets. Be sure to use
no xpadding, ypadding or space for your widgets as you
put these together. The top and side draw widgets are
for your axes, and are thin, narrow widgets nestled up
against the draw widget you will use for graphics.
Make the background color of the axes draw widgets
the same color as an empty base widget. For example,
WSet, leftAxisWid
Erase, Color=FSC_COLOR('face')
Now draw your axes on these two widgets.
They should look *exactly* like they are drawn on a
base widget. :-)
As a compound widget, you will have control of
how you put things into the main draw window, so
you can suppress axes there, etc. Neat.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: axis on a widget draw [message #38013 is a reply to message #37932] |
Tue, 10 February 2004 05:08  |
Valerio Pace
Messages: 9 Registered: October 2003
|
Junior Member |
|
|
Thank you David !
Valerio
"David Fanning" <david@dfanning.com> ha scritto nel messaggio
news:MPG.1a9183b76833b2fb989681@news.frii.com...
> Valerio Pace writes:
>
>> I have created a widget base in which there is a widget draw.
>> Now, I wanna display x-axis and y-axis on the left side and on the upper
>> size of the widget draw, but out of it. The axis must be displayed on
the
>> widget base.
>> How can I do it?
>
> Well, you can't. At least not if you insist on the axes
> being drawn on a widget base. :-)
>
> But you could fake it easy enough. Create a compound
> widget consisting of three draw widgets. Be sure to use
> no xpadding, ypadding or space for your widgets as you
> put these together. The top and side draw widgets are
> for your axes, and are thin, narrow widgets nestled up
> against the draw widget you will use for graphics.
>
> Make the background color of the axes draw widgets
> the same color as an empty base widget. For example,
>
> WSet, leftAxisWid
> Erase, Color=FSC_COLOR('face')
>
> Now draw your axes on these two widgets.
>
> They should look *exactly* like they are drawn on a
> base widget. :-)
>
> As a compound widget, you will have control of
> how you put things into the main draw window, so
> you can suppress axes there, etc. Neat.
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|