panels, UiBuilder, etc., I use the deferred command trick you
describe: I'm displaying images that are generally too large for 1:1
(like 200dpi or more) and therefore must be scaled. I give the scaled
image the largest possible screen area I can by drawing everything
first then, using a deferred command, call my image servlet with the
available width and height to get a scaled image. While this works, I
was never happy with my attempts to resize the image area (or other
areas) on browser resize.
As I work on a new app and think about how to rewrite the older one
with UiBuilder, MVP, SVG, etc., I want to improve on browser resizing.
(There are lots of neat features in GWT, more all the time. If anyone
is listening, I'd really like to see XPath and XSLT.)
On Jan 5, 12:33 pm, "Aidan O'Kelly" <aida...@gmail.com> wrote:
> On Thu, Jan 5, 2012 at 2:20 PM, Thad <thad.humphr...@gmail.com> wrote:
> > Here's a follow-up question: When using UiBuilder, how do I implement
> > a panel's onResize() method? I think the answer is to assign the
> > panels' ui:field's in FiltersViewImpl.ui.xml and call their onResize()
> > in my FiltersViewImpl.java. Am I correct?
>
> I think unless you are writing your own Panel that implements
> RequiresResize/ProvidesResize, you shouldn't need to. Existing LayoutPanels
> such as LayoutPanel, SimpleLayoutPanel, etc, already propagate onResize()
> events to any children that need them. (any children that implement
> RequiresResize)
>
> Also, you shouldn't be using/worrying about onResize() in the majority of
> cases, unless you are measuring available space to you for some reason. In
> an ideal setup, all your panels are positioned and sized using
> the constraints system (top/bottom, etc)
>
> If you are, one kinda, 'gotcha' with onResize() is that its not actually
> called when the Panel/Widgets are layed out initially, only when they are
> resized. If you want to do some measuring of pixels/space when your panel
> is initially layed out, you should use a deferred command (
> Scheduler.get().scheduleDeferred(...) ) to call your top level
> LayoutPanel's onResize() method. This allows the browsers layout to finish
> before you measure anything, and should propagate onResize() events to all
> the children widgets (and possibly their children)
> (AFAIK this is how it works anyway!)
>
> Also, just FYI, think you got this anyway but in your initial question, if
> your Menu bar height is static, you can set everything in the UiBinder
> template, rather than calling setWidgetXXX, ie;
>
> <g:layer top="0" bottom="100px" >
> <my:MenuPanel/>
> </g:layer>
> <g:layer top="100px" bottom="0" >
> <g:ScrollBar>
> <my:Content/>
> </g:ScrollBar>
> </g:layer>
--
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