void DockWindow::Float(DockableCtrl &dc, Point p) { if (dc.GetParent() && p.IsNullInstance()) p = GetScreenRect().TopLeft(); else Register(dc); FloatContainer(*GetReleasedContainer(dc), p); }
void DockWindow::FloatContainer(DockCont &c, Point p) { ASSERT(IsOpen()); if (c.IsFloating()) return; if (p.IsNullInstance()) p = GetScreenRect().CenterPoint(); Detach(c); c.StateFloating(*this); Size best = CtrlBestSize(c, false); c.SetRect(Rect(p, best)); c.Open(this); }