Exemple #1
0
void DockWindow::DockAsTab(DockCont &target, DockableCtrl &dc)
{
	DockCont *c = GetContainer(dc);
	if (c) {
		if (c->GetCount() == 1)
			CloseContainer(*c);
		else {
			Ctrl *c = dc.GetParent();
			dc.Remove();
			c->Layout();
		}
	}
	target.Add(dc);
}
Exemple #2
0
/*
 * Docking/Undocking helpers
*/
void DockWindow::Undock0(Ctrl &c, bool do_animatehl, int fsz, bool ishighlight)
{
	int al = GetDockAlign(c);
	Ctrl *p = c.GetParent();
	if (p != &dockpane[al]) {
		c.Remove();
		if (p) {
			p->Layout();
			p->RefreshLayout();
		}
	}
	else {
		if (dockpane[al].GetFirstChild() == dockpane[al].GetLastChild())
			fsz = 0;
		dockpane[al].Undock(c, do_animatehl, ishighlight); // TODO: fix nasty hack
		if (fsz >= 0) {
			do_animatehl ? StartFrameAnimate(al, fsz) : dockframe[al].SetSize(fsz);
			if (!do_animatehl && fsz == 0)
				dockframe[al].Hide();
		}

	}
}