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:
- x,y: The position of the object (or you can use "direction commands").
- width,heght: size of the container. If width,heght is replaced by
the ADAPTIVE command the container will be large enough to show all
its content.
- label: an optional text to be displayed as a label of the container.
If omitted (i.e. empty string), then no space is reserved for it in
on the screen.
- options: CT_BORDER and/or CT_OBJECT_TABLE
- CT_BORDER outlines the container with a border line. If a label
is passed the line will be broken to make place for the label.
- CT_OBJECT_TABLE which simply joins the container to the
"tab-chain" as a node. To work correctly it requires that you
put the objects in a tabular form. It is only possible to make
a CT_OBJECT_TABLE in one level of nesting.
See also:
EndContainer,
JoinTabChain,
Direction commands for object positioning,
Containers.
Closes a contaioner created by `StartContainer'.
See also:
StartContainer.
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.
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.
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.
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