2009/9/8 David Given <[email protected]>

>
> Ian Bambury wrote:
> [...]
> > It might be helpful (well it would for me anyway) if you were to
> > describe the effect you were trying to get.
>
> Simple enough, really: I want a progress bar with text over the top.
>
> > To some extent I think I understand, but I don't understand the reason
> > for the problem for absolute positioning.
>
> Using an AbsolutePanel would require me to pick a pixel size for the
> panel. Unfortunately, space is limited. Given that HTML doesn't do
> queryable font metrics, I cannot manually size the panel to fit the text
> inside. The normal solution here is to just make the panel bigger than
> necessary, but I can't do that for space reasons. The progress bar needs
> to tightly wrap the text.
>
> [...]
> > But certainly this time the quick answer is 'out of luck' because the
> > deck panel doesn't do that.
>
> It's an odd omission --- HTML and CSS should be able to produce the
> effect I need using raw DOM. This kind of widget is usually one of the
> primitives in most other widget sets I've seen, so I thought I should
> check before writing my own.


Well, a DeckPanel is designed to show one panel at a time, I don't think its
raison d'etre was to allow layering.

There are a number of options I can think of. The easiest would be to use a
label and move a background image across to get the progressbar effect. Or
you could put 2 labels in an absolutepanel, one for the text and then
increase the size of the other (with a lower z-index and a background
colour) as the progress increases as a percentage of the text label width.

BTW - you can manually query the width of the text if you wish by adding an
inline label to the screen and getting its width. It shouldn't show up
(except in one strange version of FF but you can still set left : -10000px;
if you want)

Ian

http://examples.roughian.com

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

Reply via email to