public RibbonTabGlyph(BehaviorService behaviorService, RibbonDesigner designer, Controls.Ribbon.Ribbon ribbon)
     : base(new RibbonTabGlyphBehavior(designer, ribbon))
 {
     _behaviorService = behaviorService;
     _ribbon = ribbon;
     size = new Size(60, 16);
 }
Exemple #2
0
        public MainWindow()
        {
            InitializeComponent();
#if DEBUG
            this.AttachDevTools();
#endif
            //this.FindName<CheckBox>("VerticalRibbonCheckBox").
            Controls.Ribbon.Ribbon ribbon = this.Find <Controls.Ribbon.Ribbon>("RibbonControl");
            Button verticalRibbonButton   = this.Find <Button>("VerticalRibbonButton");
            Button horizontalRibbonButton = this.Find <Button>("HorizontalRibbonButton");
            verticalRibbonButton.Click += (sneder, args) =>
            {
                ribbon.Orientation = Orientation.Vertical;
                DockPanel.SetDock(ribbon, Dock.Left);
                verticalRibbonButton.IsVisible   = false;
                horizontalRibbonButton.IsVisible = true;
            };
            horizontalRibbonButton.Click += (sneder, args) =>
            {
                ribbon.Orientation = Orientation.Horizontal;
                DockPanel.SetDock(ribbon, Dock.Top);
                horizontalRibbonButton.IsVisible = false;
                verticalRibbonButton.IsVisible   = true;
            };
        }
        public RibbonSensor(Control control, Controls.Ribbon.Ribbon ribbon, RibbonTab tabToSense)
        {
            _ribbon = ribbon;
            _control = control;
            Tab = tabToSense;

            _control.MouseMove += _control_MouseMove;
            _control.MouseDown += _control_MouseDown;
            _control.MouseUp += _control_MouseUp;
            _control.MouseLeave += _control_MouseLeave;
        }
        public RibbonSensor(Control control, Controls.Ribbon.Ribbon ribbon, IEnumerable<RibbonItem> itemsToSense)
        {
            _ribbon = ribbon;
            _control = control;
            _itemsToSense = itemsToSense;
            SenseOnlyItems = true;

            _control.MouseMove += _control_MouseMove;
            _control.MouseDown += _control_MouseDown;
            _control.MouseUp += _control_MouseUp;
            _control.MouseLeave += _control_MouseLeave;
        }
        internal RibbonOrbDropDown(Controls.Ribbon.Ribbon ribbon)
        {
            DoubleBuffered = true;
            _ribbon = ribbon;
            _menuItems = new RibbonItemCollection();
            _recentItems = new RibbonItemCollection();
            _optionItems = new RibbonItemCollection();

            _menuItems.SetOwner(Ribbon);
            _recentItems.SetOwner(Ribbon);
            _optionItems.SetOwner(Ribbon);

            OptionItemsPadding = 6;
            Size = new Size(527, 447);
        }
        internal RibbonDropDown(
            RibbonItem parentItem, 
            IEnumerable<RibbonItem> items, 
            Controls.Ribbon.Ribbon ownerRibbon,
            RibbonElementSizeMode measuringSize)
            : this()
        {
            _items = items;
            _ownerRibbon = ownerRibbon;
            SizingGripHeight = 12;
            _parentItem = parentItem;
            _sensor = new RibbonSensor(this, OwnerRibbon, items);
            MeasuringSize = measuringSize;

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

            UpdateSize();
            UpdateItemsBounds();
        }
        /// <summary>
        /// Sets the value of the Owner Property
        /// </summary>
        internal void SetOwner(Controls.Ribbon.Ribbon owner)
        {
            _owner = owner;

            Panels.SetOwner(owner);
        }
 /// <summary>
 /// Sets the Ribbon that owns this item
 /// </summary>
 /// <param name="owner">Ribbon that owns this item</param>
 internal virtual void SetOwner(Controls.Ribbon.Ribbon owner)
 {
     _owner = owner;
 }
 public RibbonOrbAdornerGlyph(BehaviorService behaviorService, RibbonDesigner designer, Controls.Ribbon.Ribbon ribbon)
     : base(new RibbonOrbAdornerGlyphBehavior())
 {
     _behaviorService = behaviorService;
     _ribbon = ribbon;
 }
 public RibbonQuickAccessToolbarGlyph(BehaviorService behaviorService, RibbonDesigner designer, Controls.Ribbon.Ribbon ribbon)
     : base(new RibbonQuickAccessGlyphBehavior(designer, ribbon))
 {
     _behaviorService = behaviorService;
     _ribbon = ribbon;
 }
 public RibbonQuickAccessGlyphBehavior(RibbonDesigner designer, Controls.Ribbon.Ribbon ribbon)
 {
     _designer = designer;
     _ribbon = ribbon;
 }