Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Associating FigureCanvas with external Sliders
Associating FigureCanvas with external Sliders [message #232969] Fri, 13 April 2007 21:28 Go to next message
Eclipse UserFriend
Originally posted by: alnospammajor.noboxspamspoon.com

i'd like to disable the scrollbars on a FigureCanvas and associate the
viewport rangemodels with a pair of external sliders.

is it sufficient to subclass FigureCanvas and override
getHorizontalBar() and getVerticalBar() to return the appropriate
external Slider widgets? or is a more complex solution required?

thx,

al
Re: Associating FigureCanvas with external Sliders [message #232980 is a reply to message #232969] Fri, 13 April 2007 21:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alnospammajor.noboxspamspoon.com

looks like this "solution" will not work. getHorizontalBar returns a
ScrollBar not a Slider, so it's a no go from the start.

it also looks like there's no way to construct a FigureCanvas without
setting the style bits SWT.V_SCROLL and SWT.H_SCROLL so i'll wind up
with those widgets whether i use them or not. i can probably live with
this, but it'd be nice if there were some way of constructing a
FigureCanvas to a) suppress creation of the standard scroll bars and/or
b) wire it to external sliders.


Al Major wrote:
> i'd like to disable the scrollbars on a FigureCanvas and associate the
> viewport rangemodels with a pair of external sliders.
>
> is it sufficient to subclass FigureCanvas and override
> getHorizontalBar() and getVerticalBar() to return the appropriate
> external Slider widgets? or is a more complex solution required?
>
> thx,
>
> al
Re: Associating FigureCanvas with external Sliders [message #233015 is a reply to message #232980] Mon, 16 April 2007 06:16 Go to previous messageGo to next message
Manuel Selva is currently offline Manuel SelvaFriend
Messages: 189
Registered: July 2009
Location: Grenoble, France
Senior Member
Hi,

On the FigureCanvas you have a methods to set the visibility of both
vertical and horizontal scrollbars. Calling these methods with false
will hide the scrollbars. Then you just have to notify these invisble
scrollbars each time your own sliders change (thumb, selection, increment
....)

Hope this can help

Manuel


Re: Associating FigureCanvas with external Sliders [message #233047 is a reply to message #233015] Mon, 16 April 2007 22:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alnospammajor.noboxspamspoon.com

so it appears i'm not the only person with this use case (not
surprising, but it's nice to have confirmation).

i can fix my own problem in two ways.
i) use glue code around FigureCanvas to attach it to external sliders.
ii) refactor FigureCanvas so that it allows the possibility of external
sliders (egs. doesn't create internal sliders in that case).

ii) will likely be more work and is only worth doing if my changes make
it back into the GEF codebase.

what's the interest level in having this happen? could one of the
committers comment? if there's any interest in this, can someone provide
quick pointers on what to do?

thx,

al


Manuel Selva wrote:
> Hi,
>
> On the FigureCanvas you have a methods to set the visibility of both
> vertical and horizontal scrollbars. Calling these methods with false
> will hide the scrollbars. Then you just have to notify these invisble
> scrollbars each time your own sliders change (thumb, selection,
> increment ...)
>
> Hope this can help
>
> Manuel
>
Re: Associating FigureCanvas with external Sliders [message #233598 is a reply to message #233015] Thu, 26 April 2007 22:06 Go to previous message
Eclipse UserFriend
Originally posted by: alnospammajor.noboxspamspoon.com

it turns out that it is not necessary to fiddle with the invisible
scrollbars. but you do have to wire the sliders to the FigureCanvas
viewport range models.

the invisible scrollbars do seem to cause problems when calculating the
trim. so it would be nice to fix figure canvas to explicitly support
this use case.

Manuel Selva wrote:
> Hi,
>
> On the FigureCanvas you have a methods to set the visibility of both
> vertical and horizontal scrollbars. Calling these methods with false
> will hide the scrollbars. Then you just have to notify these invisble
> scrollbars each time your own sliders change (thumb, selection,
> increment ...)
>
> Hope this can help
>
> Manuel
>
Previous Topic:Selection bounds !
Next Topic:EMF+GMF Learner
Goto Forum:
  


Current Time: Sat Aug 20 02:59:01 GMT 2022

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

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

Back to the top