sp<Control> GraphicButton::copyTo(sp<Control> CopyParent) { sp<GraphicButton> copy; if (CopyParent) { copy = CopyParent->createChild<GraphicButton>(this->image, this->imagedepressed, this->imagehover); } else { copy = mksp<GraphicButton>(this->image, this->imagedepressed, this->imagehover); } if (this->ScrollBarPrev) { copy->ScrollBarPrev = std::dynamic_pointer_cast<ScrollBar>(ScrollBarPrev->lastCopiedTo.lock()); } if (this->ScrollBarNext) { copy->ScrollBarNext = std::dynamic_pointer_cast<ScrollBar>(ScrollBarNext->lastCopiedTo.lock()); } copy->scrollLarge = scrollLarge; copyControlData(copy); return copy; }
sp<Control> TextEdit::copyTo(sp<Control> CopyParent) { sp<TextEdit> copy; if (CopyParent) { copy = CopyParent->createChild<TextEdit>(this->text, this->font); } else { copy = mksp<TextEdit>(this->text, this->font); } copy->TextHAlign = this->TextHAlign; copy->TextVAlign = this->TextVAlign; copyControlData(copy); return copy; }
sp<Control> TextButton::copyTo(sp<Control> CopyParent) { sp<TextButton> copy; if (CopyParent) { copy = CopyParent->createChild<TextButton>(label->getText(), label->getFont()); } else { copy = mksp<TextButton>(label->getText(), label->getFont()); } copy->TextHAlign = this->TextHAlign; copy->TextVAlign = this->TextVAlign; copy->RenderStyle = this->RenderStyle; copyControlData(copy); return copy; }
sp<Control> Graphic::copyTo(sp<Control> CopyParent) { sp<Graphic> copy; if (CopyParent) { copy = CopyParent->createChild<Graphic>(this->image); } else { copy = mksp<Graphic>(this->image); } copy->ImageHAlign = this->ImageHAlign; copy->ImageVAlign = this->ImageVAlign; copy->ImagePosition = this->ImagePosition; copy->AutoSize = this->AutoSize; copyControlData(copy); return copy; }