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

Home » Public Forums » archive » Re: forcing scroll bars in widget_draw
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: forcing scroll bars in widget_draw [message #39267] Mon, 10 May 2004 13:29 Go to next message
btt is currently offline  btt
Messages: 345
Registered: December 2000
Senior Member
David Fanning wrote:

> Ben Tupper writes:
>
>
>> It doesn't work to make the canvas equal to or smaller than
>> the viewport (in fact, I think the canvas must be quite a bit larger
>> than the viewport to get scroll bars.)
>
>
> In my tests on Windows, just a single pixel larger than the
> viewport was required to keep scroll bars around.
>

Hi David,

Hmmph, not on MaxOSX and I feel snookered. Did you try making the
canvas and viewport the same size? I wonder if the other Benjamin could
just use TVImage (etc) to center the small image on a viewport-sized
canvas?

Cheers,
The other other Benjamin
Re: forcing scroll bars in widget_draw [message #39268 is a reply to message #39267] Mon, 10 May 2004 13:16 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ben Tupper writes:

> It doesn't work to make the canvas equal to or smaller than
> the viewport (in fact, I think the canvas must be quite a bit larger
> than the viewport to get scroll bars.)

In my tests on Windows, just a single pixel larger than the
viewport was required to keep scroll bars around.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: forcing scroll bars in widget_draw [message #39269 is a reply to message #39268] Mon, 10 May 2004 13:09 Go to previous messageGo to next message
btt is currently offline  btt
Messages: 345
Registered: December 2000
Senior Member
Benjamin Hornberger wrote:
> Hi all,
>
> is there a way to force scroll bars in a draw widget even if the draw
> size is smaller than or as big as the viewport (the scroll bar should be
> inactive then)? I would like to have that because eventually the size of
> the draw area will be increased, and if the scroll bars appear just
> then, the size of the base widget would change, which is kind of ugly.
>


Hi,

You can define a 'big' drawing canvas (see XSIZE and YSIZE keywords)
with a 'small' viewing port (see X_SCROLL_SIZE and Y_SCROLL_SIZE
keywords). It doesn't work to make the canvas equal to or smaller than
the viewport (in fact, I think the canvas must be quite a bit larger
than the viewport to get scroll bars.)

The following example defines the viewport size as the image size but
defines the drawing canvas as 3 times bigger than the image size. Note
the call to WIDGET_CONTROL to change the coordinates of the viewport.

Ben


PRO ScrollTest

base = Widget_Base()

dim = [200,200]
img = BYTSCL(Hanning(Dim[0], dim[1]), top= 200B) + 55B
draw = Widget_Draw(base, $
Retain = 2, $
Xsize = dim[0] * 3, $
Ysize = dim[1] * 3, $
X_Scroll_Size = dim[0], $
Y_Scroll_Size = dim[1])

Widget_Control, base, /realize
Widget_Control, draw, Set_Draw_View = [dim[0], dim[1]]

TV, img, dim[0], dim[1]

XMANAGER, 'ScrollTest', base

END
Re: forcing scroll bars in widget_draw [message #39271 is a reply to message #39269] Mon, 10 May 2004 12:26 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Benjamin Hornberger writes:

> is there a way to force scroll bars in a draw widget even if the draw
> size is smaller than or as big as the viewport (the scroll bar should be
> inactive then)? I would like to have that because eventually the size of
> the draw area will be increased, and if the scroll bars appear just
> then, the size of the base widget would change, which is kind of ugly.

Alas, this is out of our control, I'm afraid. :-(

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: forcing scroll bars in widget_draw [message #39411 is a reply to message #39267] Mon, 10 May 2004 14:12 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ben Tupper writes:

> Hmmph, not on MaxOSX and I feel snookered. Did you try making the
> canvas and viewport the same size?

Yep. Same size doesn't work. On Windows, the canvas must
be *at least* one pixel larger than the viewport to retain
scroll bars. Or else they just disappear! :-(

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Call_External - memory problems?
Next Topic: Call_External - memory problems?

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

Current Time: Wed Oct 08 18:53:22 PDT 2025

Total time taken to generate the page: 0.00524 seconds