Containers

About Container objects: "Container" is a recursive (or "nested") construct. This means that a container may contain an arbitrary number of objects that themselves may be containers or "simple" objects like push-buttons etc.
The nesting may be done in arbitrary number of levels.
A container is just a rectangular fraction of its parent window (or container), normally used to group together some objects to make the window more attractive for the user.
Sometimes you may want it simply for grouping objects without seeing the container itself. Another time it may be used to make a more distinct group of objects with a frame and a label informing user about its content. Yet another time it may be used just to force a sequence of objects to be of the same size.
See also: Objects, Windows, Menus, Listboxes, Tabwindows.
int StartContainer(int x, int y, int width, int height, char *label, int options);

The objects in a window may be grouped into containers. Objects created between StartContainer and EndContainer will refer to the co-ordinates of the container. This also applies to direction commands (like TOPLEFT, DOWNLEFT, RIGHT..) as well as explicit x,y-co-ordinates. The objects will "belong" to the container. This means that if the container later on is deleted (by a call to `Destroy') all the objects in the container will also be destroyed. After `EndContainer' has been called, all subsequently added objects will be put into the same window or sub-window as where the container is (it works like "closing" the container for input).
Return value is the id of the container.
Parameters:
See also: EndContainer, JoinTabChain, Direction commands for object positioning, Containers.
void EndContainer(void);

Closes a contaioner created by `StartContainer'.
See also: StartContainer.
void SelectContainer(int id);

This function will select the container (node) `id' as input for subsequently created objects. If the node `id' is not in the currently operating window, the window of `id' will be set to operating.
See also: StartContainer, SetOperatingWindow.
void SetDistance(int xdist, int ydist);

Set the default distance used when positioning objects with the "direction-commands". This will be used as the distance between objects as well as between objects and the window-borders.
See also: StartContainer.
void ReBuildContainer(int id);

This function will re-build a node. This is necessary if you add objects into a container later on when the window has already been displayed (with a call to DisplayWin)
See also: StartContainer, DisplayWin, EmptyContainer.
void EmptyContainer(int id);

This function will destroy all objects within the specified container. The image of the objects will not be removed (the pixels will remain unchanged in the bitmap of the node). To remove their appearance from the window you must also re-build the node, e.g. by a call to DisplayWin();. This is preferably done after inserting new objects into the node (the need to insert new objects is probably the reason why 'EmptyContainer' was called).

May be useful if minor changes needs to be made to a window (typically extending or shrinking the window).

See also: StartContainer, ReBuildContainer, DisplayWin.

Back to contents