예제 #1
0
        protected void InternalConstruct(Control callingControl,
                                         Source source,
                                         Content c,
                                         WindowContent wc,
                                         FloatingForm ff,
                                         DockingManager dm,
                                         Point offset)
        {
            // Store the starting state
            _callingControl = callingControl;
            _source         = source;
            _content        = c;
            _windowContent  = wc;
            _dockingManager = dm;
            _container      = _dockingManager.Container;
            _floatingForm   = ff;
            _hotZones       = null;
            _currentHotZone = null;
            _insideRect     = new Rectangle();
            _outsideRect    = new Rectangle();
            _offset         = offset;

            // Begin tracking straight away
            EnterTrackingMode();
        }
예제 #2
0
        protected void GenerateHotZones()
        {
            // Need the client rectangle for the whole Form
            Rectangle formClient = _container.RectangleToScreen(_container.ClientRectangle);

            // Create a fresh collection for HotZones
            _hotZones = new HotZoneCollection();

            // We do not allow docking in front of the outer index entry
            int outerIndex = FindOuterIndex();

            // Create lists of Controls which are docked against each edge
            ArrayList topList    = new ArrayList();
            ArrayList leftList   = new ArrayList();
            ArrayList rightList  = new ArrayList();
            ArrayList bottomList = new ArrayList();
            ArrayList fillList   = new ArrayList();

            PreProcessControlsCollection(topList, leftList, rightList, bottomList, fillList, outerIndex);

            int vectorH;
            int vectorV;

            // Find the vectors required for calculating new sizes
            VectorDependsOnSourceAndState(out vectorH, out vectorV);

            GenerateHotZonesForTop(topList, formClient, vectorV, outerIndex);
            GenerateHotZonesForLeft(leftList, formClient, vectorH, outerIndex);
            GenerateHotZonesForRight(rightList, formClient, vectorH, outerIndex);
            GenerateHotZonesForBottom(bottomList, formClient, vectorV, outerIndex);
            GenerateHotZonesForFill(fillList, outerIndex);
            GenerateHotZonesForFloating(SizeDependsOnSource());
        }
예제 #3
0
        public void AddHotZones(Redocker redock, HotZoneCollection collection)
        {
            RedockerContent redocker = redock as RedockerContent;

            // Allow the contained Zone a chance to expose HotZones
            foreach (Control c in this.Controls)
            {
                IHotZoneSource ag = c as IHotZoneSource;

                // Does this control expose an interface for its own HotZones?
                if (ag != null)
                {
                    ag.AddHotZones(redock, collection);
                }
            }
        }
예제 #4
0
        public void AddHotZones(Redocker redock, HotZoneCollection collection)
        {
            RedockerContent redocker = redock as RedockerContent;

            bool itself   = false;
            bool nullZone = false;

            // We process differently for WindowContent to redock into itself!
            if ((redocker.WindowContent != null) && (redocker.WindowContent == this))
            {
                itself = true;
            }

            // We do not allow a Content to redock into its existing container
            if (itself && !_contents.Contains(redocker.Content))
            {
                nullZone = true;
            }

            Rectangle newSize = this.RectangleToScreen(this.ClientRectangle);
            Rectangle hotArea = _tabControl.RectangleToScreen(_tabControl.ClientRectangle);;

            // Find any caption detail and use that area as the hot area
            foreach (WindowDetail wd in _windowDetails)
            {
                WindowDetailCaption wdc = wd as WindowDetailCaption;

                if (wdc != null)
                {
                    hotArea = wdc.RectangleToScreen(wdc.ClientRectangle);
                    hotArea.Inflate(_hotAreaInflate, _hotAreaInflate);
                    break;
                }
            }

            if (nullZone)
            {
                collection.Add(new HotZoneNull(hotArea));
            }
            else
            {
                collection.Add(new HotZoneTabbed(hotArea, newSize, this, itself));
            }
        }