/* Adjust graphical dimensions of the GraphicObject childs of 'this' GraphicObject
according to the GOB_ tags defined in GraphicObject.h, depending on the dimensions
of 'this'. The adjustment of each child will cause adjustments of all its GraphicObject
childs down the IntuiObject tree.
'adjustChilds' needs to be invoked on every window since each invokation only
regards non-window childs.
*/
{
GraphicObject *relative = NULL;
GraphicObject *pred = NULL;
WHVAL widthSum=0;
int numberOfChilds=0;
// enclose the two FOREACHOF loops in their own scope to allow the
// declaration of variable 'node' twice.
{
// first run: sum up the width of all childs
FOREACHOF(GraphicObject,this)
{
if (ptr_cast(GadgetCV,node))
{
widthSum += node->width();
numberOfChilds++;
pred = node;
_dprintf("adjustChild to: (%ld/%ld,%ld/%ld,%ld/%ld,%ld/%ld)\n",node->left(),node->iLeft(),node->top(),node->iTop(),node->right(),node->iRight(),node->bottom(),node->iBottom());
}
}
}
WHVAL space = 0;
if (numberOfChilds > 1)
space = ((iWidth()-widthSum)>0 ?(iWidth()-widthSum):0 )/(numberOfChilds-1);