示例#1
0
        internal RibbonPanelPopup(RibbonPanel panel)
        {
            DoubleBuffered = true;

            _sensor = new RibbonMouseSensor(this, panel.Owner, panel.Items);
            _sensor.PanelLimit = panel;
            _panel = panel;
            _panel.PopUp = this;
            panel.Owner.SuspendSensor();

            using (Graphics g = CreateGraphics())
            {
                panel.overflowBoundsBuffer = panel.Bounds;
                Size s = panel.SwitchToSize(this, g, GetSizeMode(panel));
                s.Width += 100;
                s.Height += 100;
                Size = s;
                
            }

            foreach (RibbonItem item in panel.Items)
            {
                item.SetCanvas(this);
            }
        } 
示例#2
0
        internal RibbonPanelPopup(RibbonPanel panel)
        {
            SetStyle(ControlStyles.Opaque, false);
            DoubleBuffered = true;

            Sensor = new RibbonMouseSensor(this, panel.Owner, panel.Items)
            {
                PanelLimit = panel
            };
            Panel       = panel;
            Panel.PopUp = this;
            panel.Owner.SuspendSensor();

            using (Graphics g = CreateGraphics())
            {
                panel.overflowBoundsBuffer = panel.Bounds;
                Size s = panel.SwitchToSize(this, g, GetSizeMode(panel));
                //s.Width += 100;
                //s.Height += 100;
                Size = s;
            }

            foreach (RibbonItem item in panel.Items)
            {
                item.SetCanvas(this);
            }
        }
示例#3
0
        internal RibbonDropDown(RibbonItem parentItem, IEnumerable <RibbonItem> items, Ribbon ownerRibbon, RibbonElementSizeMode measuringSize)
            : this()
        {
            _items            = items;
            _ownerRibbon      = ownerRibbon;
            _sizingGripHeight = 12;
            _parentItem       = parentItem;
            _sensor           = new RibbonMouseSensor(this, OwnerRibbon, items);
            _MeasuringSize    = measuringSize;
            _scrollBarSize    = 16;

            if (Items != null)
            {
                foreach (RibbonItem item in Items)
                {
                    item.SetSizeMode(RibbonElementSizeMode.DropDown);
                    item.SetCanvas(this);

                    //If item is a RibbonHost, the MouseSensor will not detect the mouse move event, so manually hook into the event.
                    if (item is RibbonHost)
                    {
                        ((RibbonHost)item).ClientMouseMove += new MouseEventHandler(OnRibbonHostMouseMove);
                    }
                }
            }

            UpdateSize();
        }
        /// <summary>
        /// Refreshes the sensor
        /// </summary>
        private void UpdateSensor()
        {
            if (_sensor != null)
            {
                _sensor.Dispose();
            }

            _sensor = new RibbonMouseSensor(this, Ribbon, AllItems);
        }
        internal RibbonQuickAccessToolbar(Ribbon ownerRibbon)
        {
            if (ownerRibbon == null) throw new ArgumentNullException("ownerRibbon");

             SetOwner(ownerRibbon);

             _dropDownButton = new RibbonButton();
             _dropDownButton.SetOwner(ownerRibbon);
             _dropDownButton.SmallImage = CreateDropDownButtonImage();

             _margin = new Padding(9);
             _padding = new Padding(3, 0, 0, 0);
             _items = new RibbonQuickAccessToolbarItemCollection(this);
             _sensor = new RibbonMouseSensor(ownerRibbon, ownerRibbon, Items);
             _DropDownButtonVisible = true;
        }
        internal RibbonQuickAccessToolbar(Ribbon ownerRibbon)
        {
            if (ownerRibbon == null)
            {
                throw new ArgumentNullException("ownerRibbon");
            }

            SetOwner(ownerRibbon);

            _dropDownButton = new RibbonButton();
            _dropDownButton.SetOwner(ownerRibbon);
            _dropDownButton.SmallImage = CreateDropDownButtonImage();

            _margin  = new Padding(9);
            _padding = new Padding(3, 0, 0, 0);
            _items   = new RibbonQuickAccessToolbarItemCollection(this);
            _sensor  = new RibbonMouseSensor(ownerRibbon, ownerRibbon, Items);
            _DropDownButtonVisible = true;
        }
示例#7
0
        /// <summary>
        /// Drops out the old sensor and creates a new one
        /// </summary>
        private void RenewSensor()
        {
            if (ActiveTab == null)
            {
                return;
            }

            if (Sensor != null)
            {
                Sensor.Dispose();
            }

            _sensor = new RibbonMouseSensor(this, this, ActiveTab);

            if (CaptionButtonsVisible)
            {
                Sensor.Items.AddRange(new RibbonItem[] { CloseButton, MaximizeRestoreButton, MinimizeButton });
            }
        }
示例#8
0
        internal RibbonDropDown(RibbonItem parentItem, IEnumerable<RibbonItem> items, Ribbon ownerRibbon, RibbonElementSizeMode measuringSize)
            : this()
        {
            _items = items;
            _ownerRibbon = ownerRibbon;
            _sizingGripHeight = 12;
            _parentItem = parentItem;
            _sensor = new RibbonMouseSensor(this, OwnerRibbon, items);
            _MeasuringSize = measuringSize;

            if (Items != null)
                foreach (RibbonItem item in Items)
                {
                    item.SetSizeMode(RibbonElementSizeMode.DropDown);
                    item.SetCanvas(this);
                }

            UpdateSize();
        }
示例#9
0
        internal RibbonDropDown(RibbonItem parentItem, IEnumerable <RibbonItem> items, Ribbon ownerRibbon, RibbonElementSizeMode measuringSize)
            : this()
        {
            _items            = items;
            _ownerRibbon      = ownerRibbon;
            _sizingGripHeight = 12;
            _parentItem       = parentItem;
            _sensor           = new RibbonMouseSensor(this, OwnerRibbon, items);
            _MeasuringSize    = measuringSize;

            if (Items != null)
            {
                foreach (RibbonItem item in Items)
                {
                    item.SetSizeMode(RibbonElementSizeMode.DropDown);
                    item.SetCanvas(this);
                }
            }

            UpdateSize();
        }
示例#10
0
        internal RibbonPanelPopup(RibbonPanel panel)
        {
            DoubleBuffered = true;

            _sensor            = new RibbonMouseSensor(this, panel.Owner, panel.Items);
            _sensor.PanelLimit = panel;
            _panel             = panel;
            _panel.PopUp       = this;
            panel.Owner.SuspendSensor();

            using (Graphics g = CreateGraphics())
            {
                panel.overflowBoundsBuffer = panel.Bounds;
                Size s = panel.SwitchToSize(this, g, GetSizeMode(panel));
                Size = s;
            }

            foreach (RibbonItem item in panel.Items)
            {
                item.SetCanvas(this);
            }
        }
示例#11
0
        /// <summary>
        /// Drops out the old sensor and creates a new one
        /// </summary>
        private void RenewSensor()
        {
            if (ActiveTab == null)
            {
                return;
            }

            if (Sensor != null) Sensor.Dispose();

            _sensor = new RibbonMouseSensor(this, this, ActiveTab);

            if (CaptionButtonsVisible)
            {
                Sensor.Items.AddRange(new RibbonItem[] { CloseButton, MaximizeRestoreButton, MinimizeButton });
            }
        }
示例#12
0
		/// <summary>
		/// Refreshes the sensor
		/// </summary>
		private void UpdateSensor()
		{
			if (_sensor != null)
			{
				_sensor.Dispose();
			}

			_sensor = new RibbonMouseSensor(this, Ribbon, AllItems);
		}
      internal RibbonDropDown(RibbonItem parentItem, IEnumerable<RibbonItem> items, Ribbon ownerRibbon, RibbonElementSizeMode measuringSize)
         : this()
      {
         _items = items;
         _ownerRibbon = ownerRibbon;
         _sizingGripHeight = 12;
         _parentItem = parentItem;
         _sensor = new RibbonMouseSensor(this, OwnerRibbon, items);
         _MeasuringSize = measuringSize;
         _scrollBarSize = 16;

         if (Items != null)
            foreach (RibbonItem item in Items)
            {
               item.SetSizeMode(RibbonElementSizeMode.DropDown);
               item.SetCanvas(this);

                //If item is a RibbonHost, the MouseSensor will not detect the mouse move event, so manually hook into the event.
               if (item is RibbonHost)
               {
                   ((RibbonHost)item).ClientMouseMove += new MouseEventHandler(OnRibbonHostMouseMove);
               }
            }

         UpdateSize();
      }