Implement redirected storage for common bread crumb appearance.
상속: PaletteDoubleMetricRedirect
예제 #1
0
 public MyKryptonBreadCrumb()
 {
     base.SetStyle(ControlStyles.Selectable, false);
     this._selectedItem              = null;
     this._dropDownNavigaton         = true;
     this._buttonStyle               = ButtonStyle.BreadCrumb;
     this._rootItem                  = new KryptonBreadCrumbItem();
     this._rootItem.PropertyChanged += new PropertyChangedEventHandler(this.OnCrumbItemChanged);
     this._allowButtonSpecToolTips   = false;
     this._buttonSpecs               = new BreadCrumbButtonSpecCollection(this);
     this._stateCommon               = new PaletteBreadCrumbRedirect(base.Redirector, base.NeedPaintDelegate);
     this._stateDisabled             = new PaletteBreadCrumbDoubleState(this._stateCommon, base.NeedPaintDelegate);
     this._stateNormal               = new PaletteBreadCrumbDoubleState(this._stateCommon, base.NeedPaintDelegate);
     this._stateTracking             = new PaletteBreadCrumbState(this._stateCommon, base.NeedPaintDelegate);
     this._statePressed              = new PaletteBreadCrumbState(this._stateCommon, base.NeedPaintDelegate);
     //this._layoutCrumbs =new ViewLayoutCrumbs( new ViewLayoutCrumbs((KryptonBreadCrumb)this, base.NeedPaintDelegate);// new ViewLayoutCrumbs(this, base.NeedPaintDelegate);
     this._drawDocker = new ViewDrawDocker(this._stateNormal.Back, this._stateNormal.Border, null);
     //this._drawDocker.Add(this._layoutCrumbs, ViewDockStyle.Fill);
     base.ViewManager = new ViewManager(this, this._drawDocker);
     PaletteMetricPadding[] viewMetricPaddings = new PaletteMetricPadding[1];
     this._buttonManager                 = new ButtonSpecManagerDraw(this, base.Redirector, this._buttonSpecs, null, new ViewDrawDocker[] { this._drawDocker }, new IPaletteMetric[] { this._stateCommon }, new PaletteMetricInt[] { PaletteMetricInt.HeaderButtonEdgeInsetPrimary }, viewMetricPaddings, new GetToolStripRenderer(this.CreateToolStripRenderer), base.NeedPaintDelegate);
     this._toolTipManager                = new ComponentFactory.Krypton.Toolkit.ToolTipManager();
     this._toolTipManager.ShowToolTip   += new EventHandler <ToolTipEventArgs>(this.OnShowToolTip);
     this._toolTipManager.CancelToolTip += new EventHandler(this.OnCancelToolTip);
     this._buttonManager.ToolTipManager  = this._toolTipManager;
 }
예제 #2
0
        /// <summary>
        /// Initialize a new instance of the KryptonBreadCrumb class.
        /// </summary>
        public KryptonBreadCrumb()
        {
            // The bread crumb cannot take the focus
            SetStyle(ControlStyles.Selectable, false);

            // Set default values
            _selectedItem                  = null;
            _dropDownNavigaton             = true;
            _buttonStyle                   = ButtonStyle.BreadCrumb;
            RootItem                       = new KryptonBreadCrumbItem("Root");
            RootItem.PropertyChanged      += OnCrumbItemChanged;
            AllowButtonSpecToolTips        = false;
            AllowButtonSpecToolTipPriority = false;

            // Create storage objects
            ButtonSpecs = new BreadCrumbButtonSpecCollection(this);

            // Create the palette storage
            StateCommon   = new PaletteBreadCrumbRedirect(Redirector, NeedPaintDelegate);
            StateDisabled = new PaletteBreadCrumbDoubleState(StateCommon, NeedPaintDelegate);
            StateNormal   = new PaletteBreadCrumbDoubleState(StateCommon, NeedPaintDelegate);
            StateTracking = new PaletteBreadCrumbState(StateCommon, NeedPaintDelegate);
            StatePressed  = new PaletteBreadCrumbState(StateCommon, NeedPaintDelegate);

            // Our view contains background and border with crumbs inside
            _layoutCrumbs = new ViewLayoutCrumbs(this, NeedPaintDelegate);
            _drawDocker   = new ViewDrawDocker(StateNormal.Back, StateNormal.Border, null)
            {
                { _layoutCrumbs, ViewDockStyle.Fill }
            };

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawDocker);

            // Create button specification collection manager
            _buttonManager = new ButtonSpecManagerDraw(this, Redirector, ButtonSpecs, null,
                                                       new ViewDrawDocker[] { _drawDocker },
                                                       new IPaletteMetric[] { StateCommon },
                                                       new PaletteMetricInt[] { PaletteMetricInt.HeaderButtonEdgeInsetPrimary },
                                                       new PaletteMetricPadding[] { PaletteMetricPadding.None },
                                                       CreateToolStripRenderer,
                                                       NeedPaintDelegate);

            // Create the manager for handling tooltips
            ToolTipManager                = new ToolTipManager();
            ToolTipManager.ShowToolTip   += OnShowToolTip;
            ToolTipManager.CancelToolTip += OnCancelToolTip;
            _buttonManager.ToolTipManager = ToolTipManager;
        }
 /// <summary>
 /// Initialize a new instance of the PaletteBreadCrumbState class.
 /// </summary>
 /// <param name="redirect">Inheritence redirection instance.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public PaletteBreadCrumbState(PaletteBreadCrumbRedirect redirect,
                               NeedPaintHandler needPaint)
 {
     BreadCrumb = new PaletteTriple(redirect.BreadCrumb, needPaint);
 }
 /// <summary>
 /// Initialize a new instance of the PaletteBreadCrumbState class.
 /// </summary>
 /// <param name="redirect">Inheritence redirection instance.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public PaletteBreadCrumbState(PaletteBreadCrumbRedirect redirect,
                               NeedPaintHandler needPaint)
 {
     _paletteCrumb = new PaletteTriple(redirect.BreadCrumb, needPaint);
 }
 /// <summary>
 /// Initialize a new instance of the PaletteBreadCrumbDoubleState class.
 /// </summary>
 /// <param name="redirect">Inheritence redirection instance.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public PaletteBreadCrumbDoubleState(PaletteBreadCrumbRedirect redirect,
                                     NeedPaintHandler needPaint)
     : base(redirect, needPaint)
 {
     _paletteCrumb = new PaletteTriple(redirect.BreadCrumb, needPaint);
 }