internal void addAChildWithSingleContentToTabContainer(TabControl container, DockingContainer child) { container.TabPages.Add(child.Name, child.Name); child.SetBounds(0, 0, container.Width, container.Height - TITLE_BAR_HEIGHT); container.TabPages[child.Name].Controls.Add(child.Content); container.TabPages[child.Name].Tag = child._id; container.TabPages[child.Name].Width = container.Width; container.TabPages[child.Name].Height = container.Height - 20; _childId.Add(child.Name, child._id); _root.Disconnect(child.Name); }
void addChildOnCenter(DockingContainer child) { child.SetBounds(0, 0, this.Width, this.Height); if (this.getContainerType() == ContainerType.SingleContent) //(Content is TabControl) == false) { _tabContainer.TabPages.Add(this.Name, this.Name); //insert current content to tab this.Content.Dock = DockStyle.Fill; this.Content.SetBounds(0, 0, this.Width, this.Height); _tabContainer.TabPages[this.Name].Controls.Add(this.Content); _tabContainer.TabPages[this.Name].Tag = this._id; _childId.Add(this.Name, this._id); //_childId.Add(child.Name, child._id); if (child.getContainerType() == ContainerType.SingleContent) { addAChildWithSingleContentToTabContainer(_tabContainer, child); } else //else TabContents { addAChildWithTabContentToTabContainer(_tabContainer, child); } //this.Controls.Remove(Content); _tabContainer.Height = this.Height - TITLE_BAR_HEIGHT; _tabContainer.Width = this.Width; _tabContainer.Dock = DockStyle.Fill; Content = _tabContainer; this.Controls.Add(_tabContainer); showTitleBar(true, _tabContainer.TabPages[0].Name); } else //else TabContents { if (child.getContainerType() == ContainerType.SingleContent) { addAChildWithSingleContentToTabContainer(_tabContainer, child); } else //else TabContents { addAChildWithTabContentToTabContainer(_tabContainer, child); } } //_root.Disconnect(child.Name); this.setContainerType(ContainerType.TabContents); //this.Name = child.Name; //가장 최근에 선택된 tab의 이름을 가져온다. //this._id = _childId[child.Name]; showTitleBar(true, child.Name); _tabContainer.SelectTab(child.Name); }