| 839 | } |
| 840 | |
| 841 | bool Control::replaceChildByName(sp<Control> ctrl) |
| 842 | { |
| 843 | for (auto c = Controls.begin(); c != Controls.end(); c++) |
| 844 | { |
| 845 | if ((*c)->Name == ctrl->Name) |
| 846 | { |
| 847 | (*c) = ctrl; |
| 848 | ctrl->owningControl = shared_from_this(); |
| 849 | setDirty(); |
| 850 | return true; |
| 851 | } |
| 852 | } |
| 853 | |
| 854 | return false; |
| 855 | } |
| 856 | |
| 857 | sp<Control> Control::getParent() const { return owningControl.lock(); } |
| 858 |