PDA

View Full Version : Simple Box Question



hmaugans
5 Jun 2007, 2:12 PM
Okay, a simple question.

How can I create a themed box like in the example forms, with the silver background and rounded corners... without employing the entire form code? I just need some text inside it, so is it possible to just create a normal DIV and set the class, or something?

Thanks in advance. :)

brian.moeskau
5 Jun 2007, 2:16 PM
Ext.get('your-id').boxWrap();

It's not in the current released docs, but it is documented in SVN and should work with version 1.0+ code.

hmaugans
5 Jun 2007, 3:11 PM
Ext.get('your-id').boxWrap();

It's not in the current released docs, but it is documented in SVN and should work with version 1.0+ code.

Ah, thank you! That worked great.

And maybe I'm just being picky here, but I have a blue background behind that rounded div, and the rounded corners are pixelated and don't look too good (they look like they were made for a white background). Any thoughts on this?

brian.moeskau
5 Jun 2007, 3:31 PM
Yeah, the images were created against a light background. Not much you can do with GIFs and anti-aliasing. PNGs might be better, but the boxWrap method was originally included as sort of a "bonus" method and was implemented to be simple. We haven't had the need yet to try and engineer it to be more robust (e.g., using PNGs and working around IE 6 alpha channel issues). Maybe in the future...

To fix it now you would have to redo the graphics against your background of choice unfortunately. We've been considering moving to a source image format like PSD to preserve layers, I guess this example would be a good reason to do that. At the moment, most graphics are created and edited by hand as GIFs.