Sunday, March 27, 2011

Re: Elegant scrolling control

Hmm, nevermind, I didn't know, that ScrollPanel already has a method
to ensure that items are shown :-)
That's cool, so it was enough to add a ensureVisible(WidgetInterface)
method to my view, and then cast the objects to UiObject and use
ensureVisible with the respective ScrollPanel :-)
Now it works like a charm...


On Mar 27, 9:58 pm, pete <superp...@geekcity.de> wrote:
> Hallo,
>
> I have a problem, I needed a somewhat more customizable way to choose
> different labels out of two lists (select various ones, etc.), so I
> implemented my own kind of dual listbox, by using Flowpanel in a
> Scrollpanel, which have special types of labels, that can be set to
> marked. It also has a key handler to move the selection, and it's
> created following MVP.
> So everything works perfectly, only that now after the request of key
> handling came up, and the key handling is implemented, the panel is
> not scrolling, when I leave the bottom, typing down (I need only
> scrolling down and up, not left and right)... Naturally I want it to
> scroll accordingly to keep the last selection change always in the
> visible area. (just like listbox does)
> Just that somehow I don't see a clean solution to accomplish that. I'm
> sure I could somehow set the scrolling manually, but I don't know on
> how to keep track when I leave the visible area with my cursor.
> Because the panel is completely variable in size, I can't really say
> "after ten times clicking down I will leave the visible area". I would
> need a way to check if the selected widget (of which I have a hold in
> my presenter) is still fully visible. And if not to determine how to
> change the scrolling (I take it there is an option to manually scroll
> a ScrollPanel without using the scroll bar).
>
> Does anyone know how to achieve that in the cleanest way? WIthout
> breaking MVP preferably?
>
> Many thanks for any suggestion :-)

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment