| Need help to control scrolling in the gallery [message #51775] | 
Tue, 22 April 2008 03:27   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Hi, 
 
I am using a Gallery and am adding (using drag & drop) images into the  
gallery but don't seem to be able to stop the gallery repositioning itself  
to the top. 
 
I am using SWT.VIRTUAL and gallery.clearAll(); each time I add one or more  
items into the middle of the "list"; 
 
I have tried: gallery.getVerticalBar().setSelection(scrollPosition); 
but that didn't quite work.  The scrollbar was set but the gallery was  
still positioned at the top. 
 
I also tried gallery.showItem(item);  That works pretty well but the shown  
Item can be anywhere ( top or bottom) so the page jumps about a bit  
unexpectedly for the user. 
 
Any help would be appreciated 
Thanks
 |  
 |  
  | 
| Re: Need help to control scrolling in the gallery [message #51994 is a reply to message #51775] | 
Thu, 24 April 2008 04:29   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Hi, 
 
If you want to use setSelection on a scrollbar, just send a selection  
event right after that,  
 http://sharemedia.svn.sourceforge.net/viewvc/sharemedia/trun k/org.sharemedia.ui.sat/src/org/sharemedia/ui/sat/effects/Mo veScrollBarEffect.java?revision=802&view=markup 
 
But clearAll is not supposed to reset position if Table or Tree does not  
do it. 
 
Please fill a bug if the behavior is not the same as Table. 
 
-- 
Nicolas 
 
Trevor Campbell a écrit : 
> Hi, 
>  
> I am using a Gallery and am adding (using drag & drop) images into the  
> gallery but don't seem to be able to stop the gallery repositioning  
> itself to the top. 
>  
> I am using SWT.VIRTUAL and gallery.clearAll(); each time I add one or  
> more items into the middle of the "list"; 
>  
> I have tried: gallery.getVerticalBar().setSelection(scrollPosition); 
> but that didn't quite work.  The scrollbar was set but the gallery was  
> still positioned at the top. 
>  
> I also tried gallery.showItem(item);  That works pretty well but the  
> shown Item can be anywhere ( top or bottom) so the page jumps about a  
> bit unexpectedly for the user. 
>  
> Any help would be appreciated 
> Thanks 
>
 |  
 |  
  | 
| Re: Need help to control scrolling in the gallery [message #589462 is a reply to message #51775] | 
Thu, 24 April 2008 04:29   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Hi, 
 
If you want to use setSelection on a scrollbar, just send a selection  
event right after that,  
 http://sharemedia.svn.sourceforge.net/viewvc/sharemedia/trun k/org.sharemedia.ui.sat/src/org/sharemedia/ui/sat/effects/Mo veScrollBarEffect.java?revision=802&view=markup 
 
But clearAll is not supposed to reset position if Table or Tree does not  
do it. 
 
Please fill a bug if the behavior is not the same as Table. 
 
-- 
Nicolas 
 
Trevor Campbell a écrit : 
> Hi, 
>  
> I am using a Gallery and am adding (using drag & drop) images into the  
> gallery but don't seem to be able to stop the gallery repositioning  
> itself to the top. 
>  
> I am using SWT.VIRTUAL and gallery.clearAll(); each time I add one or  
> more items into the middle of the "list"; 
>  
> I have tried: gallery.getVerticalBar().setSelection(scrollPosition); 
> but that didn't quite work.  The scrollbar was set but the gallery was  
> still positioned at the top. 
>  
> I also tried gallery.showItem(item);  That works pretty well but the  
> shown Item can be anywhere ( top or bottom) so the page jumps about a  
> bit unexpectedly for the user. 
>  
> Any help would be appreciated 
> Thanks 
>
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.05243 seconds