Exemple #1
0
        protected void AddAutoHidePanels()
        {
            // Create an instance for each container edge (they default to being hidden)
            _ahpTop = new AutoHidePanel(this, DockStyle.Top);
            _ahpLeft = new AutoHidePanel(this, DockStyle.Left);
            _ahpBottom = new AutoHidePanel(this, DockStyle.Bottom);
            _ahpRight = new AutoHidePanel(this, DockStyle.Right);

            _ahpTop.Name = "Top";
            _ahpLeft.Name = "Left";
            _ahpBottom.Name = "Bottom";
            _ahpRight.Name = "Right";

            // Add to the end of the container we manage
            _container.Controls.AddRange(new Control[]{_ahpBottom, _ahpTop, _ahpRight, _ahpLeft});
        }
Exemple #2
0
        internal void RemoveShowingAutoHideWindowsExcept(AutoHidePanel except)
        {
            if (except != _ahpLeft)
                _ahpLeft.RemoveShowingWindow();

            if (except != _ahpRight)
                _ahpRight.RemoveShowingWindow();

            if (except != _ahpTop)
                _ahpTop.RemoveShowingWindow();

            if (except != _ahpBottom)
                _ahpBottom.RemoveShowingWindow();
        }
Exemple #3
0
        public Content(XmlTextReader xmlIn, int formatVersion)
        {
            // Define the initial object state
            _control = null;
            _title = "";
            _fullTitle = "";
            _imageList = null;
            _icon = null;
            _imageIndex = -1;
            _manager = null;
            _parentWindowContent = null;
            _displaySize = new Size(_defaultDisplaySize, _defaultDisplaySize);
            _autoHideSize = new Size(_defaultAutoHideSize, _defaultAutoHideSize);
            _floatingSize = new Size(_defaultFloatingSize, _defaultFloatingSize);
            _displayLocation = new Point(_defaultLocation, _defaultLocation);
            _order = _counter++;
            _tag = null;
            _visible = false;
            _defaultRestore = null;
            _autoHideRestore = null;
            _floatingRestore = null;
            _dockingRestore = null;
            _autoHidePanel = null;
            _docked = true;
            _captionBar = true;
            _closeButton = true;
            _hideButton = true;
            _autoHidden = false;
            _closeOnHide = false;

            // Overwrite default with values read in
            LoadFromXml(xmlIn, formatVersion);
        }
Exemple #4
0
        protected void InternalConstruct(DockingManager manager, 
            Control control,
            string title,
            ImageList imageList,
            int imageIndex,
            Icon icon)
        {
            // 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;
            _icon = icon;
            _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;
            _tag = null;
            _docked = true;
            _captionBar = true;
            _closeButton = true;
            _hideButton = true;
            _autoHidden = false;
            _closeOnHide = false;
            _fullTitle = title;
        }
            public AutoHostPanel(DockingManager manager, AutoHidePanel autoHidePanel, Edge borderEdge)
            {
                // Remember parameters
                _manager = manager;
                _autoHidePanel = autoHidePanel;
                _borderEdge = borderEdge;

                Direction direction;

                if ((borderEdge == Edge.Left) || (borderEdge == Edge.Right))
                    direction = Direction.Horizontal;
                else
                    direction = Direction.Vertical;

                // Create a resizing bar
                _resizeAutoBar = new ResizeAutoBar(direction, this);

                // Add to the display
                Controls.Add(_resizeAutoBar);

                // Define correct position based on Edge
                switch(_borderEdge)
                {
                    case Edge.Left:
                        _resizeAutoBar.Dock = DockStyle.Left;
                        break;
                    case Edge.Right:
                        _resizeAutoBar.Dock = DockStyle.Right;
                        break;
                    case Edge.Top:
                        _resizeAutoBar.Dock = DockStyle.Top;
                        break;
                    case Edge.Bottom:
                        _resizeAutoBar.Dock = DockStyle.Bottom;
                        break;
                }
            }