void OverlaysComp::InsertBefore (Iterator i, GraphicComp* comp) { Graphic* g = comp->GetGraphic(); Graphic* parent; Elem(i)->Append(new UList(comp)); if (g != nil) { Iterator j; parent = GetGraphic(); parent->SetGraphic(GetComp(i)->GetGraphic(), j); parent->InsertBefore(j, g); } SetParent(comp, this); }
void OverlaysComp::InsertAfter (Iterator i, GraphicComp* comp) { Graphic* g = comp->GetGraphic(); Graphic* parent; if (Elem(i)) Elem(i)->Prepend(new UList(comp)); else { cerr << "OverlaysComp::InsertAfter -- Iterator has nil value\n"; return; } if (g != nil) { Iterator j; parent = GetGraphic(); GraphicComp* comp = GetComp(i); if (comp) { parent->SetGraphic(comp->GetGraphic(), j); parent->InsertAfter(j, g); } } SetParent(comp, this); }