Prev: box.html Up Next: canvas-pad.html
Containers

Containers are object which can hold other objects. In fact, all objects must be placed into a container, when building up the object hierarchy in your plot (the topmost container is the canvas, which is not placed into any other container). All containers set up their own coordinate system, which is a rectangular area. The origin of this coordinate system is the lower-left corner of this area. For an object stored in a container, and placed to the position x and y, these positions will be interpreted as relative distances to the origin of the container.

Containers provide member functions to access the information about their own coordinate system. These are:

const length &cleft() const;
const length &cright() const;
const length &cwidth() const;
The first two functions return the (horizontal) coordinates of the left and right edges of the container's own coordinate system, in the coordinate system of the parent of this container. The third function returns the width of this coordinate system (The initial 'c' stands for 'coordinate-system')
const length &cbottom() const;
const length &ctop() const;
const length &cheight() const;
The first two functions return the (vertical) coordinates of the bottom and top edges of the container's own coordinate system, in the coordinate system of the parent of this container. The third function returns the height of this coordinate system (The initial 'c' stands for 'coordinate-system')

Objects can be added to or removed from containers using the remove(grob *) and add(grob *) member functions of containers. The user usually doesn't have to call these functions, since these are called by the utility functions of blop.

In order to simplify the user's script, a current

The available containers are:


Source files:
   container.h
   container.cc

Prev: box.html Up Next: canvas-pad.html