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 11:31 Go to next message
Istvan Meszaros is currently offline Istvan MeszarosFriend
Messages: 46
Registered: October 2009
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 12:10 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1434
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 12:15 Go to previous messageGo to next message
Istvan Meszaros is currently offline Istvan MeszarosFriend
Messages: 46
Registered: October 2009
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 12:54 Go to previous messageGo to next message
Edwin Park is currently offline Edwin ParkFriend
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 08:38 Go to previous message
Istvan Meszaros is currently offline Istvan MeszarosFriend
Messages: 46
Registered: October 2009
Member
Thanks, exactly what i was looking for.
Previous Topic:Mouse Event handling problem
Next Topic:SummaryRow numbers change 'randomly'
Goto Forum:
  


Current Time: Sun Dec 21 02:50:05 GMT 2014

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

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