Exemplo n.º 1
0
        /// <summary>
        /// Refreshes the sensor
        /// </summary>
        private void UpdateSensor()
        {
            if (_sensor != null)
            {
                _sensor.Dispose();
            }

            _sensor = new RibbonMouseSensor(this, Ribbon, AllItems);
        }
Exemplo n.º 2
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 });
            }
        }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
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();
        }
Exemplo n.º 5
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);
            }
        }