Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 215817

Summary: Gallery: how to implement pagewise keyboard scrolling
Product: z_Archived Reporter: Robert Handschmann <robert.handschmann>
Component: NebulaAssignee: Nicolas Richeton <nicolas.richeton>
Status: CLOSED FIXED QA Contact:
Severity: minor    
Priority: P1 Keywords: plan
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Changed classes based on a nightly build from 18.1.2008
nicolas.richeton: iplog+
mylyn/context/zip
none
mylyn/context/zip none

Description Robert Handschmann CLA 2008-01-18 10:26:39 EST
I would like to implement a KeyListener on a Gallery for scrolling by page using the keys SWT.PAGE_DOWN and SWT.PAGE_UP.
How can I determine the last completely visible gallery item of the page? Or better: the first item of the last completely visible row?
Comment 1 Peter Centgraf CLA 2008-01-18 13:13:39 EST
I'd love to see this feature myself.  I don't think there is a high-level method for exactly what you want, but it won't be hard to write.  Look at Gallery.getVisibleItems(Rectangle) for inspiration.

Also, keep in mind that the scroll bar scale is exact pixels.  If all you want to do is move the scroll bar by one page, you could manipulate the scroll bar directly.  If you want to move the selection (which is probably a better idea), find the current selection and iterate over the items until you find one at the appropriate distance.
Comment 2 Robert Handschmann CLA 2008-01-21 12:39:28 EST
I implemented the keys HOME, END, PAGE_UP and PAGE_DOWN. I tested it in my application that uses the NoGroupRenderer.
The changed classes are attached.
Comment 3 Robert Handschmann CLA 2008-01-21 12:40:39 EST
Created attachment 87419 [details]
Changed classes based on a nightly build from 18.1.2008
Comment 4 Nicolas Richeton CLA 2008-11-02 13:24:45 EST
Ok, I've applied the patch. It works great but with several groups (DefaultGroupRenderer), we cannot reach the top or the bottom of the gallery using only PageUp and PageDown. 
This has yet to be fixed.

Robert : Thanks for the patch.
Comment 5 Nicolas Richeton CLA 2008-11-02 13:24:48 EST
Created attachment 116729 [details]
mylyn/context/zip
Comment 6 Nicolas Richeton CLA 2009-04-17 09:00:57 EDT
Fixed the remaining issues with DefaultGroupRenderer. 
CVS > 20090417.
Comment 7 Nicolas Richeton CLA 2009-04-17 09:01:01 EDT
Created attachment 132232 [details]
mylyn/context/zip
Comment 8 Nicolas Richeton CLA 2009-06-17 06:21:50 EDT
Closing this bug