Next: 1.5 The minimum size Up: 1. Renaissance AutoLayout Previous: 1.3 The basics of

Subsections


1.4 Introduction to basic Renaissance autolayout objects

As in most other autolayout toolkits, most of the basic autolayout objects in Renaissance are logical views which group different objects and display them in rows, or columns, or tables. These autolayout views as often called ``containers'' in the literature. They are invisibile, logical objects, which contain other objects, and organize the contained objects in rows, or columns, or tables, depending on the type of container.

In the next few sections we will provide a short description of the basic Renaissance autolayout objects.

1.4.1 Boxes

By far the most common containers are boxes. Boxes are used to layout objects in columns, or rows. A horizontal box can layout objects in a row; a vertical box can layout objects in a column. A box object is invisible; it is only a logical container which lays out the objects it contains, and can be placed in a window wherever you can place a normal object. You add objects in a box, and the box automatically gets bigger to accomodate the objects, and arranges the objects inside itself to be on a row/column.

Naturally, boxes are themselves objects, so you can put boxes inside other boxes. A window usually contains a complete hierarchy of boxes, organizing the objects into lines and columns, one into the other one.

Depending on the logic which the box uses to lay out the objects, it can be of a different type. In Renaissance, there are two basic types of boxes: a ``standard'' box, and a ``proportional'' box. The standard box is the one used most often; the proportional box is normally used only for special effects, when the views contained in the box must be kept with sizes in specified proportions; a typical example is that of the ``Cancel'' and ``OK'' buttons in panels, which should be of the same size (the minimum size of the bigger of the two). This can be easily done by using a proportional box rather than a standard box to layout the buttons (as will be explained in full details later).

In summary, in Renaissance there are four basic types of boxes: horizontal standard boxes, horizontal proportional boxes, vertical standard boxes, and vertical proportional boxes.

1.4.2 Grids

A grid is a container, which can layout its objects as if they were in an invisible table. Grids are much more complex and much rarer than boxes; still, there are cases where the layout can be done using a grid, but can't be done with boxes, no matter how many.

A grid organizes the boxes it contains into rows and columns.

TODO: talk more about grids

1.4.3 Spaces

Spaces are not containers - they are invisible views, with a minimum initial size of zero. When more space is available, the spaces expand, thus consuming space and creating areas of empty space in the window, normally for alignment purposes. They can be needed in some cases, to control where the alignment or borders or spacing of other objects. You can put a space wherever you can put any other view.


Next: 1.5 The minimum size Up: 1. Renaissance AutoLayout Previous: 1.3 The basics of
2008-03-19