Esempio n. 1
0
        protected void AddMaximizeInterface(IZoneMaximizeWindow zmw)
        {
            // Has the maximize button already been created?
            if (_maxInterface == null)
            {
                // Create the InertButton
                _maxButton = new InertButton(_images, 0);

                // Hook into button events
                _maxButton.Click    += new EventHandler(OnButtonMax);
                _maxButton.GotFocus += new EventHandler(OnButtonGotFocus);

                // Define the default remapping
                _maxButton.ImageAttributes = _inactiveAttr;

                OnAddMaximizeInterface();

                Controls.Add(_maxButton);

                // Remember the interface reference
                _maxInterface = zmw;

                // Hook into the interface change events
                _maxInterface.RefreshMaximize += new EventHandler(OnRefreshMaximize);

                RecalculateButtons();
            }
        }
Esempio n. 2
0
        protected void RemoveMaximizeInterface()
        {
            if (_maxInterface != null)
            {
                // Unhook from the interface change events
                _maxInterface.RefreshMaximize -= new EventHandler(OnRefreshMaximize);

                // Remove the interface reference
                _maxInterface = null;

                // Use helper method to circumvent form Close bug
                ControlHelper.Remove(this.Controls, _maxButton);

                OnRemoveMaximizeInterface();

                // Unhook into button events
                _maxButton.Click    -= new EventHandler(OnButtonMax);
                _maxButton.GotFocus -= new EventHandler(OnButtonGotFocus);

                // Kill the button which is no longer needed
                _maxButton.Dispose();
                _maxButton = null;

                RecalculateButtons();
            }
        }
Esempio n. 3
0
        public WindowDetailCaption(DockingManager manager,
                                   Size fixedSize,
                                   EventHandler closeHandler,
                                   EventHandler restoreHandler,
                                   EventHandler invertAutoHideHandler,
                                   ContextHandler contextHandler)
            : base(manager)
        {
            // Setup correct color remapping depending on initial colors
            DefineButtonRemapping();

            // Default state
            _maxButton        = null;
            _hideButton       = null;
            _maxInterface     = null;
            _redocker         = null;
            _showCloseButton  = true;
            _showHideButton   = true;
            _ignoreHideButton = false;
            _pinnedImage      = false;

            // Prevent flicker with double buffering and all painting inside WM_PAINT
            SetStyle(ControlStyles.DoubleBuffer |
                     ControlStyles.AllPaintingInWmPaint |
                     ControlStyles.UserPaint, true);

            // Our size is always fixed at the required length in both directions
            // as one of the sizes will be provided for us because of our docking
            this.Size = fixedSize;

            if (closeHandler != null)
            {
                this.Close += closeHandler;
            }

            if (restoreHandler != null)
            {
                this.Restore += restoreHandler;
            }

            if (invertAutoHideHandler != null)
            {
                this.InvertAutoHide += invertAutoHideHandler;
            }

            if (contextHandler != null)
            {
                this.Context += contextHandler;
            }

            // Let derived classes override the button creation
            CreateButtons();

            // Need to hook into message pump so that the ESCAPE key can be
            // intercepted when in redocking mode
            Application.AddMessageFilter(this);
        }
Esempio n. 4
0
        public WindowDetailCaption(DockingManager manager, 
                                   Size fixedSize, 
                                   EventHandler closeHandler, 
                                   EventHandler restoreHandler, 
                                   EventHandler invertAutoHideHandler, 
                                   ContextHandler contextHandler)
            : base(manager)
        {
            // Setup correct color remapping depending on initial colors
            DefineButtonRemapping();

            // Default state
            _maxButton = null;
            _hideButton = null;
            _maxInterface = null;
            _redocker = null;
            _showCloseButton = true;
            _showHideButton = true;
            _ignoreHideButton = false;
            _pinnedImage = false;
            
            // Prevent flicker with double buffering and all painting inside WM_PAINT
			SetStyle(ControlStyles.DoubleBuffer | 
					 ControlStyles.AllPaintingInWmPaint |
					 ControlStyles.UserPaint, true);

            // Our size is always fixed at the required length in both directions
            // as one of the sizes will be provided for us because of our docking
            this.Size = fixedSize;

            if (closeHandler != null)
                this.Close += closeHandler;	

            if (restoreHandler != null)
                this.Restore += restoreHandler;	

            if (invertAutoHideHandler != null)
                this.InvertAutoHide += invertAutoHideHandler;
    
            if (contextHandler != null)
                this.Context += contextHandler;	

            // Let derived classes override the button creation
            CreateButtons();

            // Need to hook into message pump so that the ESCAPE key can be 
            // intercepted when in redocking mode
            Application.AddMessageFilter(this);
        }
Esempio n. 5
0
        protected void RecalculateMaximizeButton()
        {
            // Are we inside a Zone?
            if (this.ParentZone != null)
            {
                // Does the Zone support the maximizing of a Window?
                IZoneMaximizeWindow zmw = this.ParentZone as IZoneMaximizeWindow;

                if (zmw != null)
                {
                    AddMaximizeInterface(zmw);
                    return;
                }
            }

            RemoveMaximizeInterface();
        }
        protected void RemoveMaximizeInterface()
        {
            if (_maxInterface != null)
            {
                // Unhook from the interface change events
                _maxInterface.RefreshMaximize -= new EventHandler(OnRefreshMaximize);

                // Remove the interface reference
                _maxInterface = null;

                // Use helper method to circumvent form Close bug
                ControlHelper.Remove(this.Controls, _maxButton);

                OnRemoveMaximizeInterface();

                // Unhook into button events
                _maxButton.Click -= new EventHandler(OnButtonMax);
                _maxButton.GotFocus -= new EventHandler(OnButtonGotFocus);

                // Kill the button which is no longer needed
                _maxButton.Dispose();
                _maxButton = null;

                RecalculateButtons();
            }
        }
        protected void AddMaximizeInterface(IZoneMaximizeWindow zmw)
        {
            // Has the maximize button already been created?
            if (_maxInterface == null)
            {
                // Create the InertButton
                _maxButton = new InertButton(_images, 0);

                // Hook into button events
                _maxButton.Click += new EventHandler(OnButtonMax);
                _maxButton.GotFocus += new EventHandler(OnButtonGotFocus);

                // Define the default remapping
                _maxButton.ImageAttributes = _inactiveAttr;

                OnAddMaximizeInterface();

                Controls.Add(_maxButton);

                // Remember the interface reference
                _maxInterface = zmw;

                // Hook into the interface change events
                _maxInterface.RefreshMaximize += new EventHandler(OnRefreshMaximize);

                RecalculateButtons();
            }
        }