CSS for Draw Objects

[This is reposted from ‘Issues and Bug’ at the suggestion of Mr. Bob Cusick, so it’ll get added to the feature wishlist. Just call me a squeaky wheel in need of some grease… :wink: ]

The StyleClass property is exposed for Rectangle objects, but doesn’t seem to be implemented. The Servoy Developer Guide’s CSS documentation doesn’t mention Rectangles at all that I can see. I’ve experimented with trying to get it working with various CSS stylesheet elements, to no effect. Is there an as-yet-undocumented way to get this to work? If not, might it be fixed anytime soon?

This would be extremely useful, as I frequently use box objects to “frame” different groups of elements in a window, and having to change each one individually as designs evolve is, as you can imagine, quite tedious.

Hi,

I have had the same wish, until I figured out, that you can easily use labels for that. Instead of a drawing rectangles just draw a rectangle with a lable and attach the style you want. You can manipulate everything you ever want to on a rectangle like border and color with a lable.

Patrick

Thanks, Patrick.

I got a similar response from Jan over on the bugs board. A textless label with a border pretty much defines a box, doesn’t it?

How can I draw rounded rectangles using lable with style sheet (without using rectangle object)?

Thanks

The radius isn’t supported in the CSS styles - because it’s not a CSS property.

If you want the rounded look - you need to select your label(s) and use the “Special Matte” in the “border” property to set the radius.

NOTE: You will WANT to use labels for shapes (where possible) if you’re planning on having them show up in the Web Client.