Skip to main content



      Home
Home » Eclipse Projects » NatTable » Scrolling by pixels programmatically
Scrolling by pixels programmatically [message #1219514] Wed, 04 December 2013 06:31 Go to next message
Eclipse UserFriend
Hello all,

i need to synchronize the vertical scroll offset of a NatTable with another SWT component (not NatTable). The other component can be accurately scrolled by pixels (not rows).

To do the synchronization, i managed to set the row height of the NatTable to match the row height of the other component, but i don't know how to scroll the NatTable by pixels, and get the current scroll offset in pixels.

Thanks in advance!
Re: Scrolling by pixels programmatically [message #1219526 is a reply to message #1219514] Wed, 04 December 2013 07:10 Go to previous messageGo to next message
Eclipse UserFriend
Well unfortunately I don't know how to solve that. The scrolling by pixels was introduced in 1.0. There was never a request to scroll a NatTable programmatically by pixels.

You might want to have a look at the ViewportLayer which is responsible for scrolling. If it helps I could introduce getters for the connected IScroller. Not sure if that would help you in any way.
Re: Scrolling by pixels programmatically [message #1219528 is a reply to message #1219526] Wed, 04 December 2013 07:15 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for the answer, i'll investigate the IScrollers to see if they help.
Re: Scrolling by pixels programmatically [message #1219532 is a reply to message #1219528] Wed, 04 December 2013 07:54 Go to previous messageGo to next message
Eclipse UserFriend
To programmatically inspect the current viewport offset you can use ViewportLayer.getOrigin() which returns a PixelCoordinate. If you want to set the offset programmatically you can use the ViewportLayer's setOriginX() and setOriginY() methods to do so.

Cheers,
Edwin
Re: Scrolling by pixels programmatically [message #1240330 is a reply to message #1219532] Thu, 06 February 2014 03:38 Go to previous message
Eclipse UserFriend
Thanks, exactly what i was looking for.
Previous Topic:Reference of row objects
Next Topic:Change Icon in Text editor control decoration
Goto Forum:
  


Current Time: Fri Jul 04 17:04:38 EDT 2025

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

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

Back to the top