Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » [Grid] Smooth scrolling
[Grid] Smooth scrolling [message #710704] Fri, 05 August 2011 10:22 Go to next message
Daniel MacDonald is currently offline Daniel MacDonaldFriend
Messages: 15
Registered: July 2009
Junior Member
Hi,

I'm using the Grid widget to show a number of image thumbnails, with some columns to edit information for each image. Each thumbnail is 200x150 in size.

However due to the height of each image (and depending on screen resolutions / other controls on screen) there is sometimes only space to show 3-4 rows on screen at once. This will usually result in scroll bars showing.

The annoyance in this case is that the top row is always shown as a complete cell. When scrolling, it jumps 3 cells (assuming this is based on Windows scroll settings), which can be a bit confusing when only 3-4 rows are able to be shown, as the entire screen will change.

I guess my usage of the Grid isn't all that common, and the SWT Table / Tree will always show the top row as complete too. Essentially the behaviour I'm after is similar to that of the Gallery, where scrolling is smooth, and the top of the control can be a partial image.

Does this sound possible? And does anyone have any hints where changes would be required? I've been looking within the Grid / Gallery source, but it's quite daunting with 10700 and 2600 lines of code respectively, plus supporting classes!

Thanks,
Daniel
Re: [Grid] Smooth scrolling [message #710730 is a reply to message #710704] Fri, 05 August 2011 10:50 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

I guess you want the same feature one can turn on for column
setColumnScrolling().

So essentially you'll have to take a look how this implemented but it
looks like this is not really a trivial thing to change.

Tom

Am 05.08.11 12:22, schrieb Daniel MacDonald:
> Hi,
>
> I'm using the Grid widget to show a number of image thumbnails, with
> some columns to edit information for each image. Each thumbnail is
> 200x150 in size.
>
> However due to the height of each image (and depending on screen
> resolutions / other controls on screen) there is sometimes only space to
> show 3-4 rows on screen at once. This will usually result in scroll bars
> showing.
>
> The annoyance in this case is that the top row is always shown as a
> complete cell. When scrolling, it jumps 3 cells (assuming this is based
> on Windows scroll settings), which can be a bit confusing when only 3-4
> rows are able to be shown, as the entire screen will change.
>
> I guess my usage of the Grid isn't all that common, and the SWT Table /
> Tree will always show the top row as complete too. Essentially the
> behaviour I'm after is similar to that of the Gallery, where scrolling
> is smooth, and the top of the control can be a partial image.
>
> Does this sound possible? And does anyone have any hints where changes
> would be required? I've been looking within the Grid / Gallery source,
> but it's quite daunting with 10700 and 2600 lines of code respectively,
> plus supporting classes!
>
> Thanks,
> Daniel
>
Re: [Grid] Smooth scrolling [message #710743 is a reply to message #710730] Fri, 05 August 2011 11:14 Go to previous messageGo to next message
Daniel MacDonald is currently offline Daniel MacDonaldFriend
Messages: 15
Registered: July 2009
Junior Member
Thanks for the reply, Tom

I figured it wouldn't be too easy if it didn't already exist, but thanks for the pointer in the right direction.

Might be quite a nice feature for Grid v2...

Cheers
Daniel
Re: [Grid] Smooth scrolling [message #710752 is a reply to message #710704] Fri, 05 August 2011 11:28 Go to previous messageGo to next message
Nicolas Richeton is currently offline Nicolas RichetonFriend
Messages: 179
Registered: July 2009
Senior Member
Hi Daniel,

You can apply the smooth scrolling of Gallery on most widgets.
See : http://eclipse.org/nebula/widgets/gallery/r_0_20110516/javadoc/org/eclipse/nebula/animation/ScrollingSmoother.html

But if the widget only allow do display complete cells like Grid, this will may look strange.

You have 2 options to implement what you describe :
- Change grid to support partial cell display

- Switch to gallery and implement a custom renderer. You'll have to add support for editable text field which are not supported currently (this will probably not be easy).

Re: [Grid] Smooth scrolling [message #710788 is a reply to message #710752] Fri, 05 August 2011 12:13 Go to previous messageGo to next message
Daniel MacDonald is currently offline Daniel MacDonaldFriend
Messages: 15
Registered: July 2009
Junior Member
Thanks for the reply, Nicolas

I hadn't thought of using the ScrollingSmoother for this, I remember playing around with it for the Gallery though.

As you suggest, it does look strange - using the BounceOut movement for example just causes a delay in the scrolling.

Switching to the Gallery sounds even trickier (I'm using lots of different types of cell editor for different columns, plus making use of column groups), so it looks like partial cell display will be the way to go

Thanks
Daniel
Re: [Grid] Smooth scrolling [message #754403 is a reply to message #710788] Wed, 02 November 2011 12:57 Go to previous message
ana.sipos is currently offline ana.siposFriend
Messages: 1
Registered: November 2011
Location: Timisoara
Junior Member
A workaround to obtain a similar looking partial cell scrolling functionality could be to place a Grid inside a ScrolledComposite (do not use the grid's scrolling mechanism and set the scrolled composite's minimum height to something very large so the scroll bar appears from the start around the grid).

Previous Topic:Module name required
Next Topic:Grid cell selection
Goto Forum:
  


Current Time: Fri Mar 29 05:54:42 GMT 2024

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

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

Back to the top