Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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
Istvan Meszaros is currently offline Istvan Meszaros
Messages: 28
Registered: October 2009
Junior Member
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
Dirk Fauth is currently offline Dirk Fauth
Messages: 1066
Registered: July 2012
Senior Member
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
Istvan Meszaros is currently offline Istvan Meszaros
Messages: 28
Registered: October 2009
Junior Member
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
Edwin Park is currently offline Edwin Park
Messages: 124
Registered: July 2009
Senior Member
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
Istvan Meszaros is currently offline Istvan Meszaros
Messages: 28
Registered: October 2009
Junior Member
Thanks, exactly what i was looking for.
Previous Topic:Mouse Event handling problem
Next Topic:SummaryRow numbers change 'randomly'
Goto Forum:
  


Current Time: Sat Apr 19 23:28:29 EDT 2014

Powered by FUDForum. Page generated in 0.05589 seconds