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);
        }
Example #2
0
 void addToTab(Sides side, DockingContainer child)
 {
     if (child.getContainerType() == ContainerType.SingleContent)
     {
         addAChildWithSingleContentToTabContainer(_tabSide[(int)side], child);
     }
     else //tabContents
     {
         addAChildWithTabContentToTabContainer(_tabSide[(int)side], child);
     }
 }
Example #3
0
        internal void Dragging(DockingContainer movingObj, int x, int y)
        {
            int maxDepth = 0;
            int depth;
            DockingContainer selectedSuccessor = null;

            this.Invalidate();
            foreach (DockingContainer d in _successors.Values)
            {
                //for (int i = 0; i < _successors.Count; i++)
                //{

                if (CoodinateHandling.isEntered(d, 0, 0) && d.isInPopup() == false)
                {
                    if ((depth = d.getDepth()) > maxDepth)
                    {
                        maxDepth          = depth;
                        selectedSuccessor = d;
                    }
                }
            }
            if (maxDepth > 0)
            {
                Rectangle rect   = CoodinateHandling.FromClientToClient(selectedSuccessor, this);
                Point     center = CoodinateHandling.getCenter(rect, _iconCenter.Width, _iconCenter.Height);

                ShowSelection(checkIfOverCenterBtns(), selectedSuccessor, movingObj);
                _iconCenter.SetBounds(center.X, center.Y, 0, 0, BoundsSpecified.Location);
                _iconCenter.Show();
                _iconCenter.BringToFront();
                _iconCenter.label1.Text = "" + selectedSuccessor.getDepth() + "/" + selectedSuccessor.Name + "/" + selectedSuccessor.getContainerType().ToString();
            }
            else
            {
                _selection.Hide();
            }
        }