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()); } CopyControlData(copy); return copy; }
sp<Control> ListBox::CopyTo(sp<Control> CopyParent) { sp<ListBox> copy; sp<ScrollBar> scrollCopy; if (!scroller_is_internal) { scrollCopy = std::dynamic_pointer_cast<ScrollBar>(scroller->lastCopiedTo.lock()); } if (CopyParent) { copy = CopyParent->createChild<ListBox>(scrollCopy); } else { copy = mksp<ListBox>(scrollCopy); } copy->ItemSize = this->ItemSize; copy->ItemSpacing = this->ItemSpacing; copy->ListOrientation = this->ListOrientation; copy->HoverColour = this->HoverColour; copy->SelectedColour = this->SelectedColour; CopyControlData(copy); return copy; }
Control *CheckBox::CopyTo(Control *CopyParent) { CheckBox *copy = new CheckBox(fw, CopyParent); copy->Checked = this->Checked; CopyControlData((Control *)copy); return (Control *)copy; }
Control *HScrollBar::CopyTo(Control *CopyParent) { HScrollBar *copy = new HScrollBar(fw, CopyParent); copy->Value = this->Value; copy->Maximum = this->Maximum; copy->Minimum = this->Minimum; copy->GripperColour = this->GripperColour; copy->LargeChange = this->LargeChange; CopyControlData((Control *)copy); return (Control *)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> Label::CopyTo(sp<Control> CopyParent) { sp<Label> copy; if (CopyParent) { copy = CopyParent->createChild<Label>(this->text, this->font); } else { copy = mksp<Label>(this->text, this->font); } copy->TextHAlign = this->TextHAlign; copy->TextVAlign = this->TextVAlign; copy->WordWrap = this->WordWrap; CopyControlData(copy); return copy; }
sp<Control> ScrollBar::CopyTo(sp<Control> CopyParent) { sp<ScrollBar> copy; if (CopyParent) { copy = CopyParent->createChild<ScrollBar>(); } else { copy = mksp<ScrollBar>(); } copy->Value = this->Value; copy->Maximum = this->Maximum; copy->Minimum = this->Minimum; copy->GripperColour = this->GripperColour; copy->LargeChange = this->LargeChange; copy->RenderStyle = this->RenderStyle; CopyControlData(copy); return copy; }