A SERVICE OF

logo

T remove a gadget from your gadget window use the Remove function:o ,
Removing a gadget
virtual TGadget* Remove(TGadget& gadget);
from a gadget
window
where gadget is a reference to the gadget you want to remove from the
window.
This function removes gadget from the gadget window. The gadget is
returned as a TGadget *. The gadget object is not deleted. Remove returns 0 if
the gadget is not in the window.
As with the Insert function, if the gadget window has already been created,
you need to call LayoutSession after calling Remove. Any gadget you remove
will not disappear from the window until the window has been laid out.
Y u can change the margins and the layout direction either before theo
Setting window
window is created or afterwards. T do this, use the SetMargins ando
margins and layout
SetDirection functions:
direction
void SetMargins(TMargins& margins);
virtual void SetDirection(TTileDirection direction);
Both of these functions set the appropriate data members, then call the
function LayoutSession, which is described in the next section.
Y u can find out in which direction the gadgets are laid out by calling theo
GetDirection function:
TTileDirection GetDirection() const;
T lay out a gadget window call the LayoutSession function.o ,
Laying out the
virtual void LayoutSession();
gadgets
The default behavior of the LayoutSession function is to check to see if the
window interface element is already created. If not, the function returns
without taking any further action; the window is laid out automatically
when the window element is created. But if the window element has
already been created, LayoutSession tiles the gadgets and then invalidates
the modified area of the gadget window.
A layout session is typically initiated by a change in margins, inserting or
removing gadgets, or a gadget or gadget window changing size.
The actual work of tiling the gadgets is left to the function TileGadgets:
virtual TRect TileGadgets();
268
OWL P ogrammer’ Guider s