Boost logo

Boost :

From: Alan Gutierrez (alan-boost_at_[hidden])
Date: 2004-12-22 05:41:36

* Reece Dunn <msclrhd_at_[hidden]> [2004-12-22 05:22]:
> Hi All,
> In the "thoughts on a GUI component library" thread there have been
> various discussions about the layout of a rectangle and come relating to
> CSS. Note that point and size are stable.

> I personally like the CSS box model (
> which can be defined as:

> struct css::box_model
> {
> rect margin;
> rect border;
> rect padding;
> size dimensions; // width and height
> // T content;
> };

> The problem with supporting it by default is that we would need:

> class component: public css::box_model;
> class graphics::object: public css::box_model;

> This clearly violates the don't pay for what you don't need rule of C++,
> so for a css_block_layout, it needs to contain the box model properties
> and a pointer to the component/graphical object. Obviously some level of
> support for the CSS box model should be provided, allowing an
> implementation of it to be written.

    I'd imagined a division class that would have the block
    properties. If you don't want to pay for the borders if they are
    not needed, and in many cases, they would be the same from
    division to division, could you use a reference to shared
    set of demenions?

    This may aid in the cascading asepct of the stylesheet.

    struct css::division
        box_model *block;
        size dimensions;

    Each division is going to need it's own size, but the block
    properties, margin, border, padding, are likely to be common for
    many divisions.

Alan Gutierrez - alan_at_[hidden]

Boost list run by bdawes at, gregod at, cpdaniel at, john at