A tile is an object that manages the area of a rectangular object, such as a graphical or window. Tiles are used by class frame to manage the layout of the windows in the frame.
Normal users hardly ever need to be aware of the existence of
tile objects. Tiles are
managed by and manages window
objects and frame
objects. The only relevant messages that are directly delegated to from
class window are tile->hor_stretch, tile->hor_shrink,
tile->ver_stretch and tile->ver_shrink
that determine how easily the managed window
object can grow bigger or smaller.
Tiles are organised in a consists-of hierarchy. The leafs of this tree are connected to the actually managed objects (for frames, these are the windows). The root of the tree is associated with the total area over which the objects must be distributed (the frame).
A tile describes the ideal size as well as the merits to be larger (stretch) or get smaller (shrink). A tile negotiates with its super-tile in the consists-of hierarchy to get a size that is a close as possible to its ideal size, but it is always the super-tile that decides on the size.
Leaf-tiles communicate with the actual object by means of the methods
tile <-width, tile<-heightTo set the initial ideal size tile ->set: X, Y, W, HTo resize/move the object
The non-leaf tiles are either horizontal or vertical. Horizontal tiles manage a set of sub-tiles that are next to one-another. Vertical tiles manage a set of sub-tiles that are above one-another.
A tile-hierarchy is build inwards-out. First of all, all objects that
need to be tiled are given a tile (the leaf-tiles). Next, the
deepest-nested adjacent tiles that must have the same width or height
are connected to one another, etc. This is done using the tile->left, tile->above,
etc. behaviour. The creation messages are always sent to the leaf-tiles,
who create and maintain tiles higher in the hierarchy whenever needed.
<-can_resize
sets it to @on
if this tile is stretchable in the direction of its tile<-super
and there is at least one stretchable tile below or right of this tile.
See also tile->hor_stretch, tile->hor_shrink, tile->ver_stretch
and
tile->ver_shrink.
<-ideal_width’s
of the stacked tiles. If this sum is equal to the desired total width
the stretch- and shrink-parameters are ignored. If the sum is smaller
than the desired width tile<-hor_stretch
is considered. Finally, if the sum is larger than the desired total
width the system first attempts to shrink all windows that have tile<-hor_shrink >
0 proportional to their tile<-hor_shrink
value. If this does not make the total width small enough, all windows
with tile<-hor_shrink
== 0 are made equally less wide.
Defaults: The default value is 100.
-hor_shrink-hor_shrinkleaf-tile) it
is managing a horizontal or vertical stack of subtiles. These subtiles
are in the chain tile<-members.
Each of the subtiles’ tile<-super
points to this
tile object. The
variable tile<-orientation
is set to either horizontal or vertical.
A tile that manages a number of sub-tiles is normally created by its sub-tiles:
?- new(X, tile(box(100, 100))), new(Y, tile(box(200, 100))), send(X, right, Y).
Will create two tiles and a third, which is a tile with tile<-orientation:
horizontal and tile<-members
the X and Y tiles.
<-width, tile<-height
and tile->set.none, the tile is a
leaf tile controlling an tile<-object.
If horizontal, the
tile<-members
are places left-to-right. If vertical they are placed
top-to-bottom.-members
<-enforced, it
will force its subtitles to fit the computed tile<-ideal_width
and tile<-ideal_height of the tile using
tile->layout.
If the argument is @off,
the tile<-enforced argument will be set to
@off on this
tile and all subtiles, after which the ideal sizes are recomputed. See
also frame->fit.
<-ideal_width
and tile<-ideal_height. Otherwise these
values will be extracted from the object using
graphical<-width and graphical<-height.<-orientation
horizontal or vertical this implies setting the
tile<-area of the tile and distributing
the tile<-members
over the given area. For tiles with tile<-orientation
none (leaf-tiles) this implies setting tile<-area
and sending tile->geometry to the
controlled tile<-object.
If the tile has an tile<-adjuster, call tile->update_adjuster_position
to update the location of the small buttons to control the distribution
of stretchable subwindows.
<-enforced.
If the tile is not yet tile<-enforced,
the width and height components are used to set tile<-ideal_width
and tile<-ideal_heigth and the ideal sizes
are propagated over the tile hierarchy using tile->compute.
If the tile is already enforced, it will set the ideal size of this
tile. Next, it will change the stretch/shrink properties of all members
of the tile<-super
tile, such that all members before and upto (above, left of) this tile
have fixed size and all members after (below, right of) can be resized.
Used by
frame->event
to realise resizable subwindows.
<-tile<-root
of a tile hierarchy. If point is on the border between any
two tiled object in the tile hierarchy, return the tile above or left of
the given position.
Used by frame->event
to implement resizing of subwindows.