Example #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();
        }
Example #2
0
        public WindowContent AddContentToWindowContent(Content c, WindowContent wc)
        {
            // Validate the incoming Content instance is a valid reference
            // and is a current instance within our internal collection
            if ((c == null) || !_contents.Contains(c))
                return null;

            // Validate the incoming WindowContent instance is a valid reference
            if (wc == null)
                return null;

            // Is Content already part of given Window then nothing to do
            if (c.ParentWindowContent == wc)
                return wc;
            else
            {
                // Do not generate hiding/hidden/shown events
                _surpressVisibleEvents++;

                // Manageing Zones should remove display AutoHide windows
                RemoveShowingAutoHideWindows();

                if (c.ParentWindowContent != null)
                {
                    // Is there a change in docking state?
                    if (c.ParentWindowContent.ParentZone.State != wc.ParentZone.State)
                    {
                        // If it used to be in a floating mode, then record state change
                        if (c.ParentWindowContent.ParentZone.State == State.Floating)
                            c.ContentLeavesFloating();
                        else
                            c.ContentBecomesFloating();
                    }

                    // Remove the Content from its current WindowContent
                    c.ParentWindowContent.Contents.Remove(c);
                }
                else
                {
                    // If adding to a floating window then it is not docked
                    if (wc.ParentZone.State == State.Floating)
                        c.Docked = false;
                }

                // Add the existing Content to this instance
                wc.Contents.Add(c);

                // Enable generation hiding/hidden/shown events
                _surpressVisibleEvents--;

                // Generate event to indicate content is now visible
                OnContentShown(c);

                return wc;
            }
        }
Example #3
0
        protected void InternalConstruct(DockingManager manager, 
                                         Control control, 
                                         string title, 
                                         ImageList imageList, 
                                         int imageIndex)
        {
            // Must provide a valid manager instance
            if (manager == null)
                throw new ArgumentNullException("DockingManager");

            // Define the initial object state
            _control = control;
            _title = title;
            _imageList = imageList;
            _imageIndex = imageIndex;
            _manager = manager;
            _parentWindowContent = null;
            _order = _counter++;
            _visible = false;
            _displaySize = new Size(_defaultDisplaySize, _defaultDisplaySize);
            _autoHideSize = new Size(_defaultAutoHideSize, _defaultAutoHideSize);
            _floatingSize = new Size(_defaultFloatingSize, _defaultFloatingSize);
            _displayLocation = new Point(_defaultLocation, _defaultLocation);
			_defaultRestore = new RestoreContentState(State.DockLeft, this);
			_floatingRestore = new RestoreContentState(State.Floating, this);
            _autoHideRestore = new RestoreAutoHideState(State.DockLeft, this);
            _dockingRestore = _defaultRestore;
            _autoHidePanel = null;
			_docked = true;
            _captionBar = true;
            _closeButton = true;
            _hideButton = true;
            _autoHidden = false;
            _fullTitle = title;
        }
 public RedockerContent(Control callingControl, WindowContent wc, Point offset)
 {
     InternalConstruct(callingControl, Source.WindowContent, null, wc, null, wc.DockingManager, offset);
 }
 public RedockerContent(Control callingControl, Content c, WindowContent wc, Point offset)
 {
     InternalConstruct(callingControl, Source.ContentInsideWindow, c, wc, null, c.DockingManager, offset);
 }