diff -b Controls4U/Controls4U.cpp Controls4U_changed/Controls4U.cpp 74a75 > case BackgroundFit: 77a79 > case BackgroundFill: 85,92d86 < { < Ctrl *p = GetParent(); < if (p->GetFirstChild() != this) { < p->RemoveChild(this); < p->AddChildBefore(this, p->GetFirstChild()); < } < } < SizePos(); 146a141,159 > bool SetFirstChild(Ctrl *ctrl) { > if (Ctrl *p = ctrl->GetParent()) { > if (p->GetFirstChild() != ctrl) { > p->RemoveChild(ctrl); > p->AddChildBefore(ctrl, p->GetFirstChild()); > } > return true; > } else > return false; > } > > void StaticImage::Layout() { > if((fit==Background)||(fit==BackgroundFit)||(fit==BackgroundFill)){ > SetFirstChild(this); //check everytime, just in case something changed > SizePos(); > } > Ctrl::Layout(); > } > diff -b Controls4U/Controls4U.h Controls4U_changed/Controls4U.h 113c113 < enum ImageFit {BestFit, FillFrame, NoScale, RepeatToFill, Background}; --- > enum ImageFit {BestFit, FillFrame, NoScale, RepeatToFill, Background,BackgroundFit,BackgroundFill}; 131a132,133 > virtual void Layout(); >