| 1835 | } |
| 1836 | } |
| 1837 | BOOL CPanel::AddChild(CPanel * pChild) |
| 1838 | { |
| 1839 | if (pChild->Parent != NULL) |
| 1840 | { |
| 1841 | BOOL bOk = pChild->Parent->RemoveChild(pChild); |
| 1842 | if (bOk == FALSE) |
| 1843 | { |
| 1844 | return FALSE; |
| 1845 | } |
| 1846 | } |
| 1847 | pChild->LeftOffset = pChild->left - this->left; |
| 1848 | pChild->TopOffset = pChild->top - this->top; |
| 1849 | pChild->RightOffset = this->right - pChild->right; |
| 1850 | pChild->BottomOffset = this->bottom - pChild->bottom; |
| 1851 | |
| 1852 | pChild->Parent = this; |
| 1853 | |
| 1854 | Children.AddTail( pChild ); |
| 1855 | return TRUE; |
| 1856 | } |
| 1857 | |
| 1858 | BOOL CPanel::RemoveChild(CPanel * pChild) |
| 1859 | { |
no test coverage detected