Inheritance: KryptonRibbonGroupItem
        /// <summary>
        /// Initialize a new instance of the DomainUpDownController class.
        /// </summary>
        /// <param name="ribbon">Reference to owning ribbon instance.</param>
        /// <param name="domainUpDown">Source definition.</param>
        /// <param name="target">Target view element.</param>
        public DomainUpDownController(KryptonRibbon ribbon,
                                      KryptonRibbonGroupDomainUpDown domainUpDown,
                                      ViewDrawRibbonGroupDomainUpDown target)
        {
            Debug.Assert(ribbon != null);
            Debug.Assert(domainUpDown != null);
            Debug.Assert(target != null);

            _ribbon = ribbon;
            _domainUpDown = domainUpDown;
            _target = target;
        }
Example #2
0
        /// <summary>
        /// Initialize a new instance of the DomainUpDownController class.
        /// </summary>
        /// <param name="ribbon">Reference to owning ribbon instance.</param>
        /// <param name="domainUpDown">Source definition.</param>
        /// <param name="target">Target view element.</param>
        public DomainUpDownController(KryptonRibbon ribbon,
                                      KryptonRibbonGroupDomainUpDown domainUpDown,
                                      ViewDrawRibbonGroupDomainUpDown target)
        {
            Debug.Assert(ribbon != null);
            Debug.Assert(domainUpDown != null);
            Debug.Assert(target != null);

            _ribbon       = ribbon;
            _domainUpDown = domainUpDown;
            _target       = target;
        }
 /// <summary>
 /// Propagates the theme selector.
 /// </summary>
 /// <param name="target">The target.</param>
 public static void PropagateThemeSelector(KryptonRibbonGroupDomainUpDown target)
 {
     try
     {
         foreach (string theme in Toolkit.ThemeManager.SupportedThemeArray)
         {
             target.Items.Add(theme);
         }
     }
     catch
     {
         throw;
     }
 }
Example #4
0
        /// <summary>
        /// Initialize a new instance of the ViewDrawRibbonGroupDomainUpDown class.
        /// </summary>
        /// <param name="ribbon">Reference to owning ribbon control.</param>
        /// <param name="ribbonDomainUpDown">Reference to source domain up-down.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public ViewDrawRibbonGroupDomainUpDown(KryptonRibbon ribbon,
                                               KryptonRibbonGroupDomainUpDown ribbonDomainUpDown,
                                               NeedPaintHandler needPaint)
        {
            Debug.Assert(ribbon != null);
            Debug.Assert(ribbonDomainUpDown != null);
            Debug.Assert(needPaint != null);

            // Remember incoming references
            _ribbon           = ribbon;
            GroupDomainUpDown = ribbonDomainUpDown;
            _needPaint        = needPaint;
            _currentSize      = GroupDomainUpDown.ItemSizeCurrent;

            // Hook into the domain up-down events
            GroupDomainUpDown.MouseEnterControl += OnMouseEnterControl;
            GroupDomainUpDown.MouseLeaveControl += OnMouseLeaveControl;

            // Associate this view with the source component (required for design time selection)
            Component = GroupDomainUpDown;

            if (_ribbon.InDesignMode)
            {
                // At design time we need to know when the user right clicks the domain up-down
                ContextClickController controller = new ContextClickController();
                controller.ContextClick += OnContextClick;
                MouseController          = controller;
            }

            // Create controller needed for handling focus and key tip actions
            _controller      = new DomainUpDownController(_ribbon, GroupDomainUpDown, this);
            SourceController = _controller;
            KeyController    = _controller;

            // We need to rest visibility of the domain up-down for each layout cycle
            _ribbon.ViewRibbonManager.LayoutBefore += OnLayoutAction;
            _ribbon.ViewRibbonManager.LayoutAfter  += OnLayoutAction;

            // Define back reference to view for the domain up-down definition
            GroupDomainUpDown.DomainUpDownView = this;

            // Give paint delegate to domain up-down so its palette changes are redrawn
            GroupDomainUpDown.ViewPaintDelegate = needPaint;

            // Hook into changes in the ribbon custom definition
            GroupDomainUpDown.PropertyChanged += OnDomainUpDownPropertyChanged;
        }
        /// <summary>
        /// Initialize a new instance of the ViewDrawRibbonGroupDomainUpDown class.
        /// </summary>
        /// <param name="ribbon">Reference to owning ribbon control.</param>
        /// <param name="ribbonDomainUpDown">Reference to source domain up-down.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public ViewDrawRibbonGroupDomainUpDown(KryptonRibbon ribbon,
            KryptonRibbonGroupDomainUpDown ribbonDomainUpDown,
            NeedPaintHandler needPaint)
        {
            Debug.Assert(ribbon != null);
            Debug.Assert(ribbonDomainUpDown != null);
            Debug.Assert(needPaint != null);

            // Remember incoming references
            _ribbon = ribbon;
            _ribbonDomainUpDown = ribbonDomainUpDown;
            _needPaint = needPaint;
            _currentSize = _ribbonDomainUpDown.ItemSizeCurrent;

            // Hook into the domain up-down events
            _ribbonDomainUpDown.MouseEnterControl += new EventHandler(OnMouseEnterControl);
            _ribbonDomainUpDown.MouseLeaveControl += new EventHandler(OnMouseLeaveControl);

            // Associate this view with the source component (required for design time selection)
            Component = _ribbonDomainUpDown;

            if (_ribbon.InDesignMode)
            {
                // At design time we need to know when the user right clicks the domain up-down
                ContextClickController controller = new ContextClickController();
                controller.ContextClick += new MouseEventHandler(OnContextClick);
                MouseController = controller;
            }

            // Create controller needed for handling focus and key tip actions
            _controller = new DomainUpDownController(_ribbon, _ribbonDomainUpDown, this);
            SourceController = _controller;
            KeyController = _controller;

            // We need to rest visibility of the domain up-down for each layout cycle
            _ribbon.ViewRibbonManager.LayoutBefore += new EventHandler(OnLayoutAction);
            _ribbon.ViewRibbonManager.LayoutAfter += new EventHandler(OnLayoutAction);

            // Define back reference to view for the domain up-down definition
            _ribbonDomainUpDown.DomainUpDownView = this;

            // Give paint delegate to domain up-down so its palette changes are redrawn
            _ribbonDomainUpDown.ViewPaintDelegate = needPaint;

            // Hook into changes in the ribbon custom definition
            _ribbonDomainUpDown.PropertyChanged += new PropertyChangedEventHandler(OnDomainUpDownPropertyChanged);
        }
Example #6
0
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_ribbonDomainUpDown != null)
                {
                    // Must unhook to prevent memory leaks
                    _ribbonDomainUpDown.MouseEnterControl  -= new EventHandler(OnMouseEnterControl);
                    _ribbonDomainUpDown.MouseLeaveControl  -= new EventHandler(OnMouseLeaveControl);
                    _ribbonDomainUpDown.ViewPaintDelegate   = null;
                    _ribbonDomainUpDown.PropertyChanged    -= new PropertyChangedEventHandler(OnDomainUpDownPropertyChanged);
                    _ribbon.ViewRibbonManager.LayoutAfter  -= new EventHandler(OnLayoutAction);
                    _ribbon.ViewRibbonManager.LayoutBefore -= new EventHandler(OnLayoutAction);

                    // Remove association with definition
                    _ribbonDomainUpDown.DomainUpDownView = null;
                    _ribbonDomainUpDown = null;
                }
            }

            base.Dispose(disposing);
        }
        /// <summary>
        /// Initializes the designer with the specified component.
        /// </summary>
        /// <param name="component">The IComponent to associate the designer with.</param>
        public override void Initialize(IComponent component)
        {
            Debug.Assert(component != null);

            // Validate the parameter reference
            if (component == null)
            {
                throw new ArgumentNullException(nameof(component));
            }

            // Let base class do standard stuff
            base.Initialize(component);

            // Cast to correct type
            _ribbonDomainUpDown = (KryptonRibbonGroupDomainUpDown)component;
            _ribbonDomainUpDown.DomainUpDownDesigner = this;

            // Update designer properties with actual starting values
            Visible = _ribbonDomainUpDown.Visible;
            Enabled = _ribbonDomainUpDown.Enabled;

            // Update visible/enabled to always be showing/enabled at design time
            _ribbonDomainUpDown.Visible = true;
            _ribbonDomainUpDown.Enabled = true;

            // Tell the embedded domain up-down control it is in design mode
            _ribbonDomainUpDown.DomainUpDown.InRibbonDesignMode = true;

            // Hook into events
            _ribbonDomainUpDown.DesignTimeContextMenu += OnContextMenu;

            // Get access to the services
            _designerHost  = (IDesignerHost)GetService(typeof(IDesignerHost));
            _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));

            // We need to know when we are being removed/changed
            _changeService.ComponentChanged += OnComponentChanged;
        }
        /// <summary>
        /// Initializes the designer with the specified component.
        /// </summary>
        /// <param name="component">The IComponent to associate the designer with.</param>
        public override void Initialize(IComponent component)
        {
            Debug.Assert(component != null);

            // Validate the parameter reference
            if (component == null) throw new ArgumentNullException("component");

            // Let base class do standard stuff
            base.Initialize(component);

            // Cast to correct type
            _ribbonDomainUpDown = (KryptonRibbonGroupDomainUpDown)component;
            _ribbonDomainUpDown.DomainUpDownDesigner = this;

            // Update designer properties with actual starting values
            Visible = _ribbonDomainUpDown.Visible;
            Enabled = _ribbonDomainUpDown.Enabled;

            // Update visible/enabled to always be showing/enabled at design time
            _ribbonDomainUpDown.Visible = true;
            _ribbonDomainUpDown.Enabled = true;

            // Tell the embedded domain up-down control it is in design mode
            _ribbonDomainUpDown.DomainUpDown.InRibbonDesignMode = true;

            // Hook into events
            _ribbonDomainUpDown.DesignTimeContextMenu += new MouseEventHandler(OnContextMenu);

            // Get access to the services
            _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
            _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));

            // We need to know when we are being removed/changed
            _changeService.ComponentChanged += new ComponentChangedEventHandler(OnComponentChanged);
        }
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_ribbonDomainUpDown != null)
                {
                    // Must unhook to prevent memory leaks
                    _ribbonDomainUpDown.MouseEnterControl -= new EventHandler(OnMouseEnterControl);
                    _ribbonDomainUpDown.MouseLeaveControl -= new EventHandler(OnMouseLeaveControl);
                    _ribbonDomainUpDown.ViewPaintDelegate = null;
                    _ribbonDomainUpDown.PropertyChanged -= new PropertyChangedEventHandler(OnDomainUpDownPropertyChanged);
                    _ribbon.ViewRibbonManager.LayoutAfter -= new EventHandler(OnLayoutAction);
                    _ribbon.ViewRibbonManager.LayoutBefore -= new EventHandler(OnLayoutAction);

                    // Remove association with definition
                    _ribbonDomainUpDown.DomainUpDownView = null;
                    _ribbonDomainUpDown = null;
                }
            }

            base.Dispose(disposing);
        }
 private void InitializeComponent()
 {
     this.components                = new System.ComponentModel.Container();
     this.kryptonRibbon1            = new ComponentFactory.Krypton.Ribbon.KryptonRibbon();
     this.kryptonRibbonTab1         = new ComponentFactory.Krypton.Ribbon.KryptonRibbonTab();
     this.kryptonRibbonGroup1       = new ComponentFactory.Krypton.Ribbon.KryptonRibbonGroup();
     this.kryptonRibbonGroupTriple1 = new ComponentFactory.Krypton.Ribbon.KryptonRibbonGroupTriple();
     this.kgbtnDropShadowOn         = new ComponentFactory.Krypton.Ribbon.KryptonRibbonGroupButton();
     this.kgbtnDropShadowOff        = new ComponentFactory.Krypton.Ribbon.KryptonRibbonGroupButton();
     this.kryptonRibbonGroup2       = new ComponentFactory.Krypton.Ribbon.KryptonRibbonGroup();
     this.kryptonRibbonGroupTriple2 = new ComponentFactory.Krypton.Ribbon.KryptonRibbonGroupTriple();
     this.krgcmbThemeChooser        = new ComponentFactory.Krypton.Ribbon.KryptonRibbonGroupComboBox();
     this.krgdThemeSelector         = new ComponentFactory.Krypton.Ribbon.KryptonRibbonGroupDomainUpDown();
     this.krgbApplyTheme            = new ComponentFactory.Krypton.Ribbon.KryptonRibbonGroupButton();
     this.kryptonPanel1             = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
     this.kryptonPanel2             = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
     this.statusStrip1              = new System.Windows.Forms.StatusStrip();
     this.toolStripStatusLabel1     = new System.Windows.Forms.ToolStripStatusLabel();
     this.kryptonManager1           = new ComponentFactory.Krypton.Toolkit.KryptonManager(this.components);
     ((System.ComponentModel.ISupportInitialize)(this.kryptonRibbon1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit();
     this.kryptonPanel2.SuspendLayout();
     this.statusStrip1.SuspendLayout();
     this.SuspendLayout();
     //
     // kryptonRibbon1
     //
     this.kryptonRibbon1.AllowFormIntegrate = true;
     this.kryptonRibbon1.InDesignHelperMode = true;
     this.kryptonRibbon1.Name = "kryptonRibbon1";
     this.kryptonRibbon1.RibbonTabs.AddRange(new ComponentFactory.Krypton.Ribbon.KryptonRibbonTab[] {
         this.kryptonRibbonTab1
     });
     this.kryptonRibbon1.SelectedTab = this.kryptonRibbonTab1;
     this.kryptonRibbon1.Size        = new System.Drawing.Size(1347, 115);
     this.kryptonRibbon1.TabIndex    = 0;
     //
     // kryptonRibbonTab1
     //
     this.kryptonRibbonTab1.Groups.AddRange(new ComponentFactory.Krypton.Ribbon.KryptonRibbonGroup[] {
         this.kryptonRibbonGroup1,
         this.kryptonRibbonGroup2
     });
     //
     // kryptonRibbonGroup1
     //
     this.kryptonRibbonGroup1.Items.AddRange(new ComponentFactory.Krypton.Ribbon.KryptonRibbonGroupContainer[] {
         this.kryptonRibbonGroupTriple1
     });
     //
     // kryptonRibbonGroupTriple1
     //
     this.kryptonRibbonGroupTriple1.Items.AddRange(new ComponentFactory.Krypton.Ribbon.KryptonRibbonGroupItem[] {
         this.kgbtnDropShadowOn,
         this.kgbtnDropShadowOff
     });
     //
     // kgbtnDropShadowOn
     //
     this.kgbtnDropShadowOn.ButtonType = ComponentFactory.Krypton.Ribbon.GroupButtonType.Check;
     this.kgbtnDropShadowOn.TextLine1  = "Turn Drop Shadow";
     this.kgbtnDropShadowOn.TextLine2  = "On";
     this.kgbtnDropShadowOn.Click     += new System.EventHandler(this.kgbtnDropShadowOn_Click);
     //
     // kgbtnDropShadowOff
     //
     this.kgbtnDropShadowOff.ButtonType = ComponentFactory.Krypton.Ribbon.GroupButtonType.Check;
     this.kgbtnDropShadowOff.TextLine1  = "Turn Drop Shadow";
     this.kgbtnDropShadowOff.TextLine2  = "Off";
     this.kgbtnDropShadowOff.Click     += new System.EventHandler(this.kgbtnDropShadowOff_Click);
     //
     // kryptonRibbonGroup2
     //
     this.kryptonRibbonGroup2.Items.AddRange(new ComponentFactory.Krypton.Ribbon.KryptonRibbonGroupContainer[] {
         this.kryptonRibbonGroupTriple2
     });
     //
     // kryptonRibbonGroupTriple2
     //
     this.kryptonRibbonGroupTriple2.Items.AddRange(new ComponentFactory.Krypton.Ribbon.KryptonRibbonGroupItem[] {
         this.krgcmbThemeChooser,
         this.krgdThemeSelector,
         this.krgbApplyTheme
     });
     //
     // krgcmbThemeChooser
     //
     this.krgcmbThemeChooser.DropDownWidth     = 121;
     this.krgcmbThemeChooser.FormattingEnabled = false;
     this.krgcmbThemeChooser.ItemHeight        = 15;
     this.krgcmbThemeChooser.Text = "";
     //
     // krgdThemeSelector
     //
     this.krgdThemeSelector.Text = "";
     //
     // krgbApplyTheme
     //
     this.krgbApplyTheme.TextLine1 = "Apply";
     this.krgbApplyTheme.TextLine2 = "Theme";
     this.krgbApplyTheme.Click    += new System.EventHandler(this.krgbApplyTheme_Click);
     //
     // kryptonPanel1
     //
     this.kryptonPanel1.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.kryptonPanel1.Location = new System.Drawing.Point(0, 115);
     this.kryptonPanel1.Name     = "kryptonPanel1";
     this.kryptonPanel1.Size     = new System.Drawing.Size(1347, 555);
     this.kryptonPanel1.TabIndex = 1;
     //
     // kryptonPanel2
     //
     this.kryptonPanel2.Controls.Add(this.statusStrip1);
     this.kryptonPanel2.Dock     = System.Windows.Forms.DockStyle.Bottom;
     this.kryptonPanel2.Location = new System.Drawing.Point(0, 648);
     this.kryptonPanel2.Name     = "kryptonPanel2";
     this.kryptonPanel2.Size     = new System.Drawing.Size(1347, 22);
     this.kryptonPanel2.TabIndex = 0;
     //
     // statusStrip1
     //
     this.statusStrip1.Font = new System.Drawing.Font("Segoe UI", 9F);
     this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.toolStripStatusLabel1
     });
     this.statusStrip1.Location   = new System.Drawing.Point(0, 0);
     this.statusStrip1.Name       = "statusStrip1";
     this.statusStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.ManagerRenderMode;
     this.statusStrip1.Size       = new System.Drawing.Size(1347, 22);
     this.statusStrip1.TabIndex   = 0;
     this.statusStrip1.Text       = "statusStrip1";
     //
     // toolStripStatusLabel1
     //
     this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
     this.toolStripStatusLabel1.Size = new System.Drawing.Size(118, 17);
     this.toolStripStatusLabel1.Text = "toolStripStatusLabel1";
     //
     // RibbonApp
     //
     this.ClientSize = new System.Drawing.Size(1347, 670);
     this.Controls.Add(this.kryptonPanel2);
     this.Controls.Add(this.kryptonPanel1);
     this.Controls.Add(this.kryptonRibbon1);
     this.Name          = "RibbonApp";
     this.TextExtra     = "Test";
     this.UseDropShadow = false;
     this.Load         += new System.EventHandler(this.RibbonApp_Load);
     ((System.ComponentModel.ISupportInitialize)(this.kryptonRibbon1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit();
     this.kryptonPanel2.ResumeLayout(false);
     this.kryptonPanel2.PerformLayout();
     this.statusStrip1.ResumeLayout(false);
     this.statusStrip1.PerformLayout();
     this.ResumeLayout(false);
     this.PerformLayout();
 }