Friday, September 10, 2010

Re: Variable UI

Yes, worldofsolitaire.com seems to handle the problems I'm
encountering, no ugly wrong layout and no need to refresh. But I
couldn't find a clue how this page was created... (doesn't look like
GWT, does it? No obfuscated javascript...)
I have firebug installed, and the way the cards are handled there is
exactly the way I do it in my app, scale them to the correct size by
<img> on refresh. And it also works on refresh, my problem is only,
that it doesn't work on the first page load. After the first load it
works perfectly fine after each refresh. So this is my only problem, I
guess...
I'm always confused by GWT in matter of when I can take the size,
since stuff needs to be attached and visible to get correct output, I
guess (which makes sense, since in the end it just wraps
Javascript...)
My app already features resize on refresh, just that I don't want to
refresh every variable layout once in the beginning, to get it
working, and it confuses me, that only for the first load it doesn't
work, while it works perfectly fine after refresh... Maybe I need to
go through the code piece by piece and make sure that I never call
getWidth() on anything that is not attached to the RootPanel yet...
Besides that I have no clue why it doesn't work on the first load :-(
Very frustrating... But I'm grateful for the many tips you provide :-)


On Sep 10, 2:45 am, lineman78 <linema...@gmail.com> wrote:
> What you are describing is very similar to worldofsolitaire.com.  I
> suggest that you play around with it for a bit and use firebug to
> inspect how he does things in html.  I believe he is using just one
> image for each card and letting the browser scale it.  This way you
> only need one image for each card and you just let the browser handle
> the sizing.  He is also doing some stuff that I have had difficulty
> getting to work in the past, but is a necessity with such an
> application.  You need to be able to sense both when the browser
> resizes(easy) or when the layout is changed on the screen(more
> difficult as this requires you to set up your own eventing for
> whenever the size of anything changes and therefore becomes very
> heavy).  I do however believe you will be able to get away with just
> one set of cards letting the browser resize it for you.  Like I said
> in order to do so you will need to use the img tag, therefore
> ImageBundle is not a good solution because it creates an image with
> the background therefore not allowing for client side resizing.
> Firebug is your friend with GWT development, so if you aren't sure
> what the Java code is producing inspect it with firebug and make sure
> it's what you want.
>
> On Sep 9, 5:46 pm, pete <bobobo...@hotmail.com> wrote:
>
> > This one app is a card game, with approx. some hundred cards when
> > fully designed. So each card has a small image shown in the UI
> > (dragable, if possible 2 rows a 5 small cards independent of the
> > resolution) and on click shows a popup with the full image including
> > card description. Furthermore 5 small views of stacks to the left on
> > top of each other, which mainly consist of smaller versions of the
> > same cards. The popups from the small stacks are the same images in
> > different sizes once again...
>
> > I created widgets for this card type, to take care of presenting the
> > small image with possibility to display the full one, etc. Furthermore
> > options to automatically scale the card to a certain height (by using
> > the setHeight() , setWidth() methods). It all works, once the browser
> > was refreshed. I also dynamically create the playfield, left an area
> > for card stacks, right side a play field with drag and drop support.
> > But even the play area is not proportioned correctly until refresh...
> > (I set 1/5 percentage of Window.getClientWidth() for the card stack
> > area)
>
> > The caching of the images is right now to present each card image once
> > on the screen, cause I only know that way to cache the images in the
> > browser (since ImageBundle doesn't work for my case I guess...). So I
> > have a timer running switching through every possible card with a
> > certain speed low enough to show the cards on screen...
>
> > So this all together is everything but satisfying... For the cards I
> > either need different resolutions on the server, so I can adjust to
> > the client window size, or I have to create them dynamically...
> > I want this to run on the GAE for now, so the more work the client
> > does, the better, right? (With respect to quotas)
>
> > Anyway, I really appreciate your help :-) You're quite right that I
> > don't have much experience in web development ;-)

--
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