Skip to main content



      Home
Home » Eclipse Projects » GEF » How to remove scrollbars from FigureCanvas?
How to remove scrollbars from FigureCanvas? [message #87538] Wed, 16 July 2003 07:41 Go to next message
Eclipse UserFriend
Originally posted by: jan.odvarko.schemantix.com

Hi All!

The FigureCanvas class uses default styles for the underlying control...
See the constructor of the class...

public FigureCanvas(Composite parent, LightweightSystem lws) {
super(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_REDRAW_RESIZE
|SWT.NO_BACKGROUND);
this.lws = lws;
lws.setControl(this);
hook();
}

The figure canvas is instanciated by e.g. ScrollingGraphicalViewer...

But even if the scrollbars aren't neccessary they are visible (and
disabled)

The question is - How can I remove the scrollbars?

Noice that if I create the control within a dialog and then resize the
dialog by mouse the scrollbars disappears...

How could I do that programatically?

Thanks for any help!

Honza
Re: How to remove scrollbars from FigureCanvas? [message #87553 is a reply to message #87538] Wed, 16 July 2003 08:33 Go to previous messageGo to next message
Eclipse UserFriend
The scrollbars shouldn't show up unless needed. The GraphicalEditor uses a
FigureCanvas and it works as expected (see the logic example). I've never used
one in a dialog before. I'll try it out and see what I can find.

Eric


Jan Odvárko wrote:
> Hi All!
>
> The FigureCanvas class uses default styles for the underlying control...
> See the constructor of the class...
>
> public FigureCanvas(Composite parent, LightweightSystem lws) {
> super(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_REDRAW_RESIZE
> |SWT.NO_BACKGROUND);
> this.lws = lws;
> lws.setControl(this);
> hook();
> }
>
> The figure canvas is instanciated by e.g. ScrollingGraphicalViewer...
>
> But even if the scrollbars aren't neccessary they are visible (and
> disabled)
>
> The question is - How can I remove the scrollbars?
>
> Noice that if I create the control within a dialog and then resize the
> dialog by mouse the scrollbars disappears...
>
> How could I do that programatically?
>
> Thanks for any help!
>
> Honza
>
>
>
>
Re: How to remove scrollbars from FigureCanvas? [message #87627 is a reply to message #87538] Wed, 16 July 2003 10:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Have you tried FigureCanvas.setScrollBarVisibility(FigureCanvas.NEVER)?
Re: How to remove scrollbars from FigureCanvas? [message #87640 is a reply to message #87627] Wed, 16 July 2003 11:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jan.odvarko.schemantix.com

Yes, it doesn't work....

"Randy Hudson" <none@us.ibm.com> wrote in message
news:bf3m8v$9t9$1@eclipse.org...
> Have you tried FigureCanvas.setScrollBarVisibility(FigureCanvas.NEVER)?
>
>
Re: How to remove scrollbars from FigureCanvas? [message #87654 is a reply to message #87640] Wed, 16 July 2003 15:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

This is a bug that was in GEF 2.1.0, but is fixed in GEF 2.1.1.

In 2.1.0 we had a workaround for an SWT problem in GTK. Instead of always
calling scrollbar.setVisible(value), we did:
if (scrollbar.isVisible() != value)
scrollbar.setVisible(value)

The problem with this is that SWT does not use normal Java naming
conventions, and isVisible() is not the inverse to setVisible(). And,
because your dialog is hidden at the time when you call pack(), isVisible()
returns false even though the scrollbars ARE visible.

"Jan Odv
Re: How to remove scrollbars from FigureCanvas? [message #87729 is a reply to message #87654] Thu, 17 July 2003 10:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jan.odvarko.schemantix.com

Is there a workaround for that?

(I can't use the version 2.1.1 write now, even if I am planning to do
that... )

E.g. Can I call pack() after the dialog is visible?
When I could do that?
Is there any event that I can listen to?

Thanks!

Honza


"Randy Hudson" <none@us.ibm.com> wrote in message
news:bf47fc$oq$1@eclipse.org...
> This is a bug that was in GEF 2.1.0, but is fixed in GEF 2.1.1.
>
> In 2.1.0 we had a workaround for an SWT problem in GTK. Instead of always
> calling scrollbar.setVisible(value), we did:
> if (scrollbar.isVisible() != value)
> scrollbar.setVisible(value)
>
> The problem with this is that SWT does not use normal Java naming
> conventions, and isVisible() is not the inverse to setVisible(). And,
> because your dialog is hidden at the time when you call pack(),
isVisible()
> returns false even though the scrollbars ARE visible.
>
> "Jan Odv
Re: How to remove scrollbars from FigureCanvas? [message #87744 is a reply to message #87729] Thu, 17 July 2003 11:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You can call FigureCanvas.getVerticalBar().setVisible(false);
similar for horizontal.

"Jan Odv
Re: How to remove scrollbars from FigureCanvas? [message #87759 is a reply to message #87744] Thu, 17 July 2003 12:34 Go to previous message
Eclipse UserFriend
Originally posted by: jan.odvarko.schemantix.com

OK, It works...

Thanks

Honza

"Randy Hudson" <none@us.ibm.com> wrote in message
news:bf6g50$7du$1@eclipse.org...
> You can call FigureCanvas.getVerticalBar().setVisible(false);
> similar for horizontal.
>
> "Jan Odv
Previous Topic:ScrollableGraphicalViewer and key accelerations
Next Topic:NPE in logic
Goto Forum:
  


Current Time: Tue Jul 22 15:30:56 EDT 2025

Powered by FUDForum. Page generated in 0.08973 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top