Ejemplo n.º 1
0
        /// <summary>
        /// Initialize a new instance of the ViewDrawSeparator class.
        /// </summary>
        /// <param name="paletteDisabled">Palette source for the disabled state.</param>
        /// <param name="paletteNormal">Palette source for the normal state.</param>
        /// <param name="paletteTracking">Palette source for the tracking state.</param>
        /// <param name="palettePressed">Palette source for the pressed state.</param>
        /// <param name="metricDisabled">Palette source for disabled metric values.</param>
        /// <param name="metricNormal">Palette source for normal metric values.</param>
        /// <param name="metricTracking">Palette source for tracking metric values.</param>
        /// <param name="metricPressed">Palette source for pressed metric values.</param>
        /// <param name="metricPadding">Metric used to get padding values.</param>
        /// <param name="orientation">Visual orientation of the content.</param>
        public ViewDrawSeparator(IPaletteDouble paletteDisabled, IPaletteDouble paletteNormal,
                                 IPaletteDouble paletteTracking, IPaletteDouble palettePressed,
                                 IPaletteMetric metricDisabled,  IPaletteMetric metricNormal,
                                 IPaletteMetric metricTracking,  IPaletteMetric metricPressed,
                                 PaletteMetricPadding metricPadding,
                                 Orientation orientation)
        {
            Debug.Assert(paletteDisabled != null);
            Debug.Assert(paletteNormal != null);
            Debug.Assert(paletteTracking != null);
            Debug.Assert(palettePressed != null);
            Debug.Assert(metricDisabled != null);
            Debug.Assert(metricNormal != null);
            Debug.Assert(metricTracking != null);
            Debug.Assert(metricPressed != null);

            // Remember the source information
            _paletteDisabled = paletteDisabled;
            _paletteNormal = paletteNormal;
            _paletteTracking = paletteTracking;
            _palettePressed = palettePressed;
            _metricDisabled = metricDisabled;
            _metricNormal = metricNormal;
            _metricTracking = metricTracking;
            _metricPressed = metricPressed;
            _metricPadding = metricPadding;
            _orientation = orientation;

            // Default other state
            _length = 0;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initialize a new instance of the ButtonSpecView class.
        /// </summary>
        /// <param name="redirector">Palette redirector.</param>
        /// <param name="paletteMetric">Source for metric values.</param>
        /// <param name="metricPadding">Padding metric for border padding.</param>
        /// <param name="manager">Reference to owning manager.</param>
        /// <param name="buttonSpec">Access</param>
        public ButtonSpecView(PaletteRedirect redirector,
                              IPaletteMetric paletteMetric,
                              PaletteMetricPadding metricPadding,
                              ButtonSpecManagerBase manager,
                              ButtonSpec buttonSpec)
        {
            Debug.Assert(redirector != null);
            Debug.Assert(manager != null);
            Debug.Assert(buttonSpec != null);

            // Remember references
            _redirector = redirector;
            _manager = manager;
            _buttonSpec = buttonSpec;
            _finishDelegate = new EventHandler(OnFinishDelegate);

            // Create delegate for paint notifications
            NeedPaintHandler needPaint = new NeedPaintHandler(OnNeedPaint);

            // Intercept calls from the button for color remapping and instead use
            // the button spec defined map and the container foreground color
            _remapPalette = _manager.CreateButtonSpecRemap(redirector, buttonSpec);

            // Use a redirector to get button values directly from palette
            _palette = new PaletteTripleRedirect(_remapPalette,
                                                 PaletteBackStyle.ButtonButtonSpec,
                                                 PaletteBorderStyle.ButtonButtonSpec,
                                                 PaletteContentStyle.ButtonButtonSpec,
                                                 needPaint);

            // Create the view for displaying a button
            _viewButton = new ViewDrawButton(_palette, _palette, _palette, _palette,
                                             paletteMetric, this, VisualOrientation.Top, false);

            // Associate the view with the source component (for design time support)
            if (buttonSpec.AllowComponent)
                _viewButton.Component = buttonSpec;

            // Use a view center to place button in centre of given space
            _viewCenter = new ViewLayoutCenter(paletteMetric, metricPadding, VisualOrientation.Top);
            _viewCenter.Add(_viewButton);

            // Create a controller for managing button behavior
            ButtonSpecViewControllers controllers = CreateController(_viewButton, needPaint, new MouseEventHandler(OnClick));
            _viewButton.MouseController = controllers.MouseController;
            _viewButton.SourceController = controllers.SourceController;
            _viewButton.KeyController = controllers.KeyController;

            // We need notifying whenever a button specification property changes
            _buttonSpec.ButtonSpecPropertyChanged += new PropertyChangedEventHandler(OnPropertyChanged);

            // Associate the button spec with the view that is drawing it
            _buttonSpec.SetView(_viewButton);

            // Finally update view with current button spec settings
            UpdateButtonStyle();
            UpdateVisible();
            UpdateEnabled();
            UpdateChecked();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initialize a new instance of the ViewLayoutViewport class.
        /// </summary>
        /// <param name="paletteMetrics">Palette source for metrics.</param>
        /// <param name="metricPadding">Metric used to get view padding.</param>
        /// <param name="metricOvers">Metric used to get overposition.</param>
        /// <param name="orientation">Orientation for the viewport children.</param>
        /// <param name="alignment">Alignment of the children within the viewport.</param>
        /// <param name="animateChange">Animate changes in the viewport.</param>
        public ViewLayoutViewport(IPaletteMetric paletteMetrics,
                                  PaletteMetricPadding metricPadding,
                                  PaletteMetricInt metricOvers,
                                  VisualOrientation orientation,
                                  RelativePositionAlign alignment,
                                  bool animateChange)
        {
            // Remember the source information
            _paletteMetrics = paletteMetrics;
            _metricPadding = metricPadding;
            _metricOvers = metricOvers;
            _orientation = orientation;
            _alignment = alignment;
            _animateChange = animateChange;

            // Default other state
            _offset = Point.Empty;
            _extent = Size.Empty;
            _rightToLeft = RightToLeft.No;
            _rightToLeftLayout = false;
            _fillSpace = false;
            _counterAlignment = RelativePositionAlign.Far;

            // Create a timer for animation effect
            _animationTimer = new Timer();
            _animationTimer.Interval = _animationInterval;
            _animationTimer.Tick += new EventHandler(OnAnimationTick);
        }
 /// <summary>
 /// Create the button spec view appropriate for the button spec.
 /// </summary>
 /// <param name="redirector">Redirector for acquiring palette values.</param>
 /// <param name="viewPaletteMetric">Target metric providers.</param>
 /// <param name="viewMetricPadding">Target metric padding.</param>
 /// <param name="buttonSpec">ButtonSpec instance.</param>
 /// <returns>ButtonSpecView derived class.</returns>
 protected override ButtonSpecView CreateButtonSpecView(PaletteRedirect redirector, 
                                                        IPaletteMetric viewPaletteMetric, 
                                                        PaletteMetricPadding viewMetricPadding, 
                                                        ButtonSpec buttonSpec)
 {
     return new ButtonSpecViewRibbon(redirector, viewPaletteMetric,
                                     viewMetricPadding, this, buttonSpec);
 }
 /// <summary>
 /// Initialize a new instance of the ButtonSpecViewAppButton class.
 /// </summary>
 /// <param name="redirector">Palette redirector.</param>
 /// <param name="paletteMetric">Source for metric values.</param>
 /// <param name="metricPadding">Padding metric for border padding.</param>
 /// <param name="manager">Reference to owning manager.</param>
 /// <param name="buttonSpec">Access</param>
 public ButtonSpecViewAppButton(PaletteRedirect redirector,
                                IPaletteMetric paletteMetric,
                                PaletteMetricPadding metricPadding,
                                ButtonSpecManagerBase manager,
                                ButtonSpec buttonSpec)
     : base(redirector, paletteMetric, metricPadding, manager, buttonSpec)
 {
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Initialize a new instance of the ViewLayoutCenter class.
        /// </summary>
        /// <param name="paletteMetric">Target for recovering metric values.</param>
        /// <param name="metricPadding">Metric to use for border padding.</param>
        /// <param name="orientation">Orientation of the element.</param>
        /// <param name="childElement">Optional element to add as child.</param>
        public ViewLayoutCenter(IPaletteMetric paletteMetric,
                                PaletteMetricPadding metricPadding,
                                VisualOrientation orientation,
                                ViewBase childElement)
        {
            // Remember provided values
            _paletteMetric = paletteMetric;
            _metricPadding = metricPadding;
            _orientation = orientation;

            if (childElement != null)
                Add(childElement);
        }
 /// <summary>
 /// Initialize a new instance of the ButtonSpecManagerDraw class.
 /// </summary>
 /// <param name="control">Control that owns the button manager.</param>
 /// <param name="redirector">Palette redirector.</param>
 /// <param name="variableSpecs">Variable set of button specifications.</param>
 /// <param name="fixedSpecs">Fixed set of button specifications.</param>
 /// <param name="viewDockers">Array of target view dockers.</param>
 /// <param name="viewMetrics">Array of target metric providers.</param>
 /// <param name="viewMetricInt">Array of target metrics for outside/inside spacer size.</param>
 /// <param name="viewMetricPaddings">Array of target metrics for button padding.</param>
 /// <param name="getRenderer">Delegate for returning a tool strip renderer.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public ButtonSpecManagerDraw(Control control,
                              PaletteRedirect redirector,
                              ButtonSpecCollectionBase variableSpecs,
                              ButtonSpecCollectionBase fixedSpecs,
                              ViewDrawDocker[] viewDockers,
                              IPaletteMetric[] viewMetrics,
                              PaletteMetricInt[] viewMetricInt,
                              PaletteMetricPadding[] viewMetricPaddings,
                              GetToolStripRenderer getRenderer,
                              NeedPaintHandler needPaint)
     : this(control, redirector, variableSpecs, fixedSpecs, 
            viewDockers, viewMetrics, viewMetricInt, viewMetricInt,
            viewMetricPaddings, getRenderer, needPaint)
 {
 }
 /// <summary>
 /// Initialize a new instance of the ButtonSpecManagerLayoutRibbon class.
 /// </summary>
 /// <param name="ribbon">Ribbon that owns the button manager.</param>
 /// <param name="redirector">Palette redirector.</param>
 /// <param name="variableSpecs">Variable set of button specifications.</param>
 /// <param name="fixedSpecs">Fixed set of button specifications.</param>
 /// <param name="viewDockers">Array of target view dockers.</param>
 /// <param name="viewMetrics">Array of target metric providers.</param>
 /// <param name="viewMetricInt">Array of target metrics for outside/inside spacer size.</param>
 /// <param name="viewMetricPaddings">Array of target metrics for button padding.</param>
 /// <param name="getRenderer">Delegate for returning a tool strip renderer.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public ButtonSpecManagerLayoutRibbon(KryptonRibbon ribbon,
                                      PaletteRedirect redirector,
                                      ButtonSpecCollectionBase variableSpecs,
                                      ButtonSpecCollectionBase fixedSpecs,
                                      ViewLayoutDocker[] viewDockers,
                                      IPaletteMetric[] viewMetrics,
                                      PaletteMetricInt[] viewMetricInt,
                                      PaletteMetricPadding[] viewMetricPaddings,
                                      GetToolStripRenderer getRenderer,
                                      NeedPaintHandler needPaint)
     : base(ribbon, redirector, variableSpecs, fixedSpecs,
            viewDockers, viewMetrics, viewMetricInt,
            viewMetricPaddings, getRenderer, needPaint)
 {
 }
 /// <summary>
 /// Initialize a new instance of the ButtonSpecNavManagerLayoutBar class.
 /// </summary>
 /// <param name="control">Control that owns the button manager.</param>
 /// <param name="redirector">Palette redirector.</param>
 /// <param name="variableSpecs">Variable set of button specifications.</param>
 /// <param name="viewDockers">Array of target view dockers.</param>
 /// <param name="viewMetrics">Array of target metric providers.</param>
 /// <param name="viewMetricIntOutside">Array of target metrics for outside spacer size.</param>
 /// <param name="viewMetricIntInside">Array of target metrics for inside spacer size.</param>
 /// <param name="viewMetricPaddings">Array of target metrics for button padding.</param>
 /// <param name="getRenderer">Delegate for returning a tool strip renderer.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public ButtonSpecNavManagerLayoutBar(Control control,
                                      PaletteRedirect redirector,
                                      ButtonSpecCollectionBase variableSpecs,
                                      ViewLayoutDocker[] viewDockers,
                                      IPaletteMetric[] viewMetrics,
                                      PaletteMetricInt[] viewMetricIntOutside,
                                      PaletteMetricInt[] viewMetricIntInside,
                                      PaletteMetricPadding[] viewMetricPaddings,
                                      GetToolStripRenderer getRenderer,
                                      NeedPaintHandler needPaint)
     : this(control, redirector, variableSpecs,
            null, viewDockers, viewMetrics, 
            viewMetricIntOutside, viewMetricIntInside,
            viewMetricPaddings, getRenderer, needPaint)
 {
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Initialize a new instance of the ViewDrawCanvas class.
        /// </summary>
        /// <param name="paletteBack">Palette source for the background.</param>		
        /// <param name="paletteBorder">Palette source for the border.</param>
        /// <param name="paletteMetric">Palette source for metric values.</param>
        /// <param name="metricPadding">Matric used to get padding values.</param>
        /// <param name="orientation">Visual orientation of the content.</param>
        public ViewDrawCanvas(IPaletteBack paletteBack,
							  IPaletteBorder paletteBorder,
							  IPaletteMetric paletteMetric,
							  PaletteMetricPadding metricPadding,
							  VisualOrientation orientation)
        {
            // Cache the starting values
            _paletteBorder = paletteBorder;
            _paletteBack = paletteBack;
            _paletteMetric = paletteMetric;
            _metricPadding = metricPadding;
            _orientation = orientation;
            _includeBorderEdge = orientation;
            _applyIncludeBorderEdge = false;
            _drawTabBorder = false;
            _drawCanvas = true;
        }
 /// <summary>
 /// Initialize a new instance of the ButtonSpecManagerLayoutAppButton class.
 /// </summary>
 /// <param name="viewManager">Reference to context menu view manager.</param>
 /// <param name="control">Control that owns the button manager.</param>
 /// <param name="redirector">Palette redirector.</param>
 /// <param name="variableSpecs">Variable set of button specifications.</param>
 /// <param name="fixedSpecs">Fixed set of button specifications.</param>
 /// <param name="viewDockers">Array of target view dockers.</param>
 /// <param name="viewMetrics">Array of target metric providers.</param>
 /// <param name="viewMetricInt">Array of target metrics for outside/inside spacer size.</param>
 /// <param name="viewMetricPaddings">Array of target metrics for button padding.</param>
 /// <param name="getRenderer">Delegate for returning a tool strip renderer.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public ButtonSpecManagerLayoutAppButton(ViewContextMenuManager viewManager,
                                         Control control,
                                         PaletteRedirect redirector,
                                         ButtonSpecCollectionBase variableSpecs,
                                         ButtonSpecCollectionBase fixedSpecs,
                                         ViewLayoutDocker[] viewDockers,
                                         IPaletteMetric[] viewMetrics,
                                         PaletteMetricInt[] viewMetricInt,
                                         PaletteMetricPadding[] viewMetricPaddings,
                                         GetToolStripRenderer getRenderer,
                                         NeedPaintHandler needPaint)
     : base(control, redirector, variableSpecs, fixedSpecs,
            viewDockers, viewMetrics, viewMetricInt,
            viewMetricPaddings, getRenderer, needPaint)
 {
     _viewManager = viewManager;
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Initialize a new instance of the ViewLayoutOutlookFull class.
 /// </summary>
 /// <param name="viewBuilder">View builder reference.</param>
 /// <param name="rootControl">Top level visual control.</param>
 /// <param name="viewportFiller">View element to place inside viewport.</param>
 /// <param name="paletteBorderEdge">Palette for use with the border edge.</param>
 /// <param name="paletteMetrics">Palette source for metrics.</param>
 /// <param name="metricPadding">Metric used to get view padding.</param>
 /// <param name="metricOvers">Metric used to get overposition.</param>
 /// <param name="orientation">Orientation for the viewport children.</param>
 /// <param name="alignment">Alignment of the children within the viewport.</param>
 /// <param name="animateChange">Animate changes in the viewport.</param>
 /// <param name="vertical">Is the viewport vertical.</param>
 /// <param name="needPaintDelegate">Delegate for notifying paint requests.</param>
 public ViewLayoutOutlookFull(ViewBuilderOutlookBase viewBuilder,
                              VisualControl rootControl,
                              ViewBase viewportFiller,
                              PaletteBorderEdge paletteBorderEdge,
                              IPaletteMetric paletteMetrics,
                              PaletteMetricPadding metricPadding,
                              PaletteMetricInt metricOvers,
                              VisualOrientation orientation,
                              RelativePositionAlign alignment,
                              bool animateChange,
                              bool vertical,
                              NeedPaintHandler needPaintDelegate)
     : base(rootControl, viewportFiller, paletteBorderEdge, paletteMetrics, 
            metricPadding, metricOvers, orientation, alignment, animateChange, 
            vertical, needPaintDelegate)
 {
     Debug.Assert(viewBuilder != null);
     _viewBuilder = viewBuilder;
 }
Ejemplo n.º 13
0
        /// <summary>
        /// Initialize a new instance of the ViewDrawSplitCanvas class.
        /// </summary>
        /// <param name="paletteBack">Palette source for the background.</param>		
        /// <param name="paletteBorder">Palette source for the border.</param>
        /// <param name="paletteMetric">Palette source for metric values.</param>
        /// <param name="metricPadding">Matric used to get padding values.</param>
        /// <param name="orientation">Visual orientation of the content.</param>
        public ViewDrawSplitCanvas(IPaletteBack paletteBack,
							       IPaletteBorder paletteBorder,
							       IPaletteMetric paletteMetric,
							       PaletteMetricPadding metricPadding,
							       VisualOrientation orientation)
        {
            // Cache the starting values
            _paletteBorder = paletteBorder;
            _paletteBack = paletteBack;
            _paletteBackDraw = new PaletteBackInheritForced(_paletteBack);
            _paletteBackDraw.ForceDraw = InheritBool.True;
            _paletteBackLight = new PaletteBackLightenColors(_paletteBack);
            _paletteMetric = paletteMetric;
            _paletteBorderNormal = paletteBorder;
            _paletteBackNormal = paletteBack;
            _metricPadding = metricPadding;
            _orientation = orientation;
            _drawTabBorder = false;
            _drawCanvas = true;
            _splitter = false;
        }
 /// <summary>
 /// Initialize a new instance of the ButtonSpecNavManagerLayoutHeaderBar class.
 /// </summary>
 /// <param name="control">Control that owns the button manager.</param>
 /// <param name="redirector">Palette redirector.</param>
 /// <param name="variableSpecs">Variable set of button specifications.</param>
 /// <param name="fixedSpecs">Fixed set of button specifications.</param>
 /// <param name="viewDockers">Array of target view dockers.</param>
 /// <param name="viewMetrics">Array of target metric providers.</param>
 /// <param name="viewMetricIntOutside">Array of target metrics for outside spacer size.</param>
 /// <param name="viewMetricIntInside">Array of target metrics for inside spacer size.</param>
 /// <param name="viewMetricPaddings">Array of target metrics for button padding.</param>
 /// <param name="getRenderer">Delegate for returning a tool strip renderer.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 /// <param name="paletteContent">Palette source for color remapping.</param>
 /// <param name="paletteState">Palette state for color remapping.</param>
 public ButtonSpecNavManagerLayoutHeaderBar(Control control,
                                            PaletteRedirect redirector,
                                            ButtonSpecCollectionBase variableSpecs,
                                            ButtonSpecCollectionBase fixedSpecs,
                                            ViewLayoutDocker[] viewDockers,
                                            IPaletteMetric[] viewMetrics,
                                            PaletteMetricInt[] viewMetricIntOutside,
                                            PaletteMetricInt[] viewMetricIntInside,
                                            PaletteMetricPadding[] viewMetricPaddings,
                                            GetToolStripRenderer getRenderer,
                                            NeedPaintHandler needPaint,
                                            IPaletteContent paletteContent,
                                            PaletteState paletteState)
     : base(control, redirector, variableSpecs, fixedSpecs, 
            viewDockers, viewMetrics, viewMetricIntOutside,
            viewMetricIntInside, viewMetricPaddings, getRenderer, 
            needPaint)
 {
     // Remember initial palette settings needed for color remapping
     _paletteContent = paletteContent;
     _paletteState = paletteState;
 }
 /// <summary>
 /// Gets a padding metric value.
 /// </summary>
 /// <param name="state">Palette value should be applicable to this state.</param>
 /// <param name="metric">Requested metric.</param>
 /// <returns>Padding value.</returns>
 public Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric)
 {
     return _metricRedirect.GetMetricPadding(state, metric);
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Gets a padding metric value.
 /// </summary>
 /// <param name="state">Palette value should be applicable to this state.</param>
 /// <param name="metric">Requested metric.</param>
 /// <returns>Padding value.</returns>
 public Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric) =>
 // Always pass onto the inheritance
 _inherit.GetMetricPadding(state, metric);
        /// <summary>
        /// Gets a padding metric value.
        /// </summary>
        /// <param name="state">Palette value should be applicable to this state.</param>
        /// <param name="metric">Requested metric.</param>
        /// <returns>Padding value.</returns>
        public override Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric)
        {
            // Is this the metric we provide?
            if ((metric == PaletteMetricPadding.HeaderGroupPaddingPrimary) ||
                (metric == PaletteMetricPadding.HeaderGroupPaddingSecondary) ||
                (metric == PaletteMetricPadding.HeaderGroupPaddingDockInactive) ||
                (metric == PaletteMetricPadding.HeaderGroupPaddingDockActive))
            {
                // If the user has defined an actual value to use
                if (!HeaderPadding.Equals(CommonHelper.InheritPadding))
                    return HeaderPadding;
            }

            // Let base class perform its own testing
            return base.GetMetricPadding(state, metric);
        }
        /// <summary>
        /// Gets a padding metric value.
        /// </summary>
        /// <param name="state">Palette value should be applicable to this state.</param>
        /// <param name="metric">Requested metric.</param>
        /// <returns>Padding value.</returns>
        public override Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric)
        {
            IPaletteMetric inherit = GetInherit(state);

            if (inherit != null)
                return inherit.GetMetricPadding(state, metric);
            else
                return Target.GetMetricPadding(state, metric);
        }
 /// <summary>
 /// Gets a padding metric value.
 /// </summary>
 /// <param name="state">Palette value should be applicable to this state.</param>
 /// <param name="metric">Requested metric.</param>
 /// <returns>Padding value.</returns>
 public virtual Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric)
 {
     // Pass onto the inheritance
     return _redirect.GetMetricPadding(state, metric);
 }
        /// <summary>
        /// Gets a padding metric value.
        /// </summary>
        /// <param name="state">Palette value should be applicable to this state.</param>
        /// <param name="metric">Requested metric.</param>
        /// <returns>Padding value.</returns>
        public override Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric)
        {
            // Is this the metric we provide?
            if ((metric == PaletteMetricPadding.HeaderButtonPaddingPrimary) ||
                (metric == PaletteMetricPadding.HeaderButtonPaddingSecondary) ||
                (metric == PaletteMetricPadding.HeaderButtonPaddingDockInactive) ||
                (metric == PaletteMetricPadding.HeaderButtonPaddingDockActive) ||
                (metric == PaletteMetricPadding.HeaderButtonPaddingForm) ||
                (metric == PaletteMetricPadding.HeaderButtonPaddingInputControl) ||
                (metric == PaletteMetricPadding.HeaderButtonPaddingCustom1) ||
                (metric == PaletteMetricPadding.HeaderButtonPaddingCustom2))
            {
                // If the user has defined an actual value to use
                if (!ButtonPadding.Equals(CommonHelper.InheritPadding))
                    return ButtonPadding;
            }

            // Pass onto the inheritance
            return _redirect.GetMetricPadding(state, metric);
        }
Ejemplo n.º 21
0
 /// <summary>
 /// Gets a padding metric value.
 /// </summary>
 /// <param name="state">Palette value should be applicable to this state.</param>
 /// <param name="metric">Requested metric.</param>
 /// <returns>Padding value.</returns>
 public virtual Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric)
 {
     // Pass onto the inheritance
     return(_redirect.GetMetricPadding(state, metric));
 }
 /// <summary>
 /// Gets a padding metric value.
 /// </summary>
 /// <param name="state">Palette value should be applicable to this state.</param>
 /// <param name="metric">Requested metric.</param>
 /// <returns>Padding value.</returns>
 public Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric)
 {
     // Always pass onto the inheritance
     return(_inherit.GetMetricPadding(state, metric));
 }
        /// <summary>
        /// Initialize a new instance of the ViewLayoutScrollViewport class.
        /// </summary>
        /// <param name="rootControl">Top level visual control.</param>
        /// <param name="viewportFiller">View element to place inside viewport.</param>
        /// <param name="paletteBorderEdge">Palette for use with the border edge.</param>
        /// <param name="paletteMetrics">Palette source for metrics.</param>
        /// <param name="metricPadding">Metric used to get view padding.</param>
        /// <param name="metricOvers">Metric used to get overposition.</param>
        /// <param name="orientation">Orientation for the viewport children.</param>
        /// <param name="alignment">Alignment of the children within the viewport.</param>
        /// <param name="animateChange">Animate changes in the viewport.</param>
        /// <param name="vertical">Is the viewport vertical.</param>
        /// <param name="needPaintDelegate">Delegate for notifying paint requests.</param>
        public ViewLayoutScrollViewport(VisualControl rootControl,
                                        ViewBase viewportFiller,
                                        PaletteBorderEdge paletteBorderEdge,
                                        IPaletteMetric paletteMetrics,
                                        PaletteMetricPadding metricPadding,
                                        PaletteMetricInt metricOvers,
                                        VisualOrientation orientation,
                                        RelativePositionAlign alignment,
                                        bool animateChange,
                                        bool vertical,
                                        NeedPaintHandler needPaintDelegate)
        {
            Debug.Assert(rootControl != null);
            Debug.Assert(viewportFiller != null);
            Debug.Assert(needPaintDelegate != null);

            // We need a way to notify changes in layout
            _needPaintDelegate = needPaintDelegate;

            // By default we are showing the contained viewport in vertical scrolling
            _viewportVertical = vertical;

            // Our initial visual orientation should match the parameter
            Orientation = orientation;

            // Create the child viewport
            Viewport = new ViewLayoutViewport(paletteMetrics, metricPadding,
                                              metricOvers, ViewportOrientation(_viewportVertical),
                                              alignment, animateChange)
            {
                // Default to same alignment for both directions
                CounterAlignment = alignment,

                // We always want the viewport to fill any remainder space
                FillSpace = true
            };

            // Put the provided element inside the viewport
            Viewport.Add(viewportFiller);

            // Hook into animation step events
            Viewport.AnimateStep += OnAnimateStep;

            // To prevent the contents of the viewport from being able to draw outside
            // the viewport (such as having child controls) we use a ViewLayoutControl
            // that uses a child control to restrict the drawing region.
            ViewControl = new ViewLayoutControl(rootControl, Viewport)
            {
                InDesignMode = rootControl.InDesignMode
            };

            // Create the scrollbar and matching border edge
            ScrollbarV  = new ViewDrawScrollBar(true);
            ScrollbarH  = new ViewDrawScrollBar(false);
            BorderEdgeV = new ViewDrawBorderEdge(paletteBorderEdge, System.Windows.Forms.Orientation.Vertical);
            BorderEdgeH = new ViewDrawBorderEdge(paletteBorderEdge, System.Windows.Forms.Orientation.Horizontal);

            // Hook into scroll position changes
            ScrollbarV.ScrollChanged += OnScrollVChanged;
            ScrollbarH.ScrollChanged += OnScrollHChanged;

            // Add with appropriate docking style
            Add(ViewControl, ViewDockStyle.Fill);
            Add(BorderEdgeV, ViewDockStyle.Right);
            Add(BorderEdgeH, ViewDockStyle.Bottom);
            Add(ScrollbarV, ViewDockStyle.Right);
            Add(ScrollbarH, ViewDockStyle.Bottom);
        }
Ejemplo n.º 24
0
 /// <summary>
 /// Gets a padding metric value.
 /// </summary>
 /// <param name="state">Palette value should be applicable to this state.</param>
 /// <param name="metric">Requested metric.</param>
 /// <returns>Padding value.</returns>
 public Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric)
 {
     return(_metricRedirect.GetMetricPadding(state, metric));
 }
        /// <summary>
        /// Initialize a new instance of the ButtonSpecView class.
        /// </summary>
        /// <param name="redirector">Palette redirector.</param>
        /// <param name="paletteMetric">Source for metric values.</param>
        /// <param name="metricPadding">Padding metric for border padding.</param>
        /// <param name="manager">Reference to owning manager.</param>
        /// <param name="buttonSpec">Access</param>
        public ButtonSpecView(PaletteRedirect redirector,
                              IPaletteMetric paletteMetric,
                              PaletteMetricPadding metricPadding,
                              ButtonSpecManagerBase manager,
                              ButtonSpec buttonSpec)
        {
            Debug.Assert(redirector != null);
            Debug.Assert(manager != null);
            Debug.Assert(buttonSpec != null);

            // Remember references
            _redirector     = redirector;
            Manager         = manager;
            ButtonSpec      = buttonSpec;
            _finishDelegate = OnFinishDelegate;

            // Create delegate for paint notifications
            NeedPaintHandler needPaint = OnNeedPaint;

            // Intercept calls from the button for color remapping and instead use
            // the button spec defined map and the container foreground color
            RemapPalette = Manager.CreateButtonSpecRemap(redirector, buttonSpec);

            // Use a redirector to get button values directly from palette
            _palette = new PaletteTripleRedirect(RemapPalette,
                                                 PaletteBackStyle.ButtonButtonSpec,
                                                 PaletteBorderStyle.ButtonButtonSpec,
                                                 PaletteContentStyle.ButtonButtonSpec,
                                                 needPaint);


            // Create the view for displaying a button
            ViewButton = new ViewDrawButton(_palette, _palette, _palette, _palette,
                                            paletteMetric, this, VisualOrientation.Top, false);

            // Associate the view with the source component (for design time support)
            if (buttonSpec.AllowComponent)
            {
                ViewButton.Component = buttonSpec;
            }

            // Use a view center to place button in centre of given space
            ViewCenter = new ViewLayoutCenter(paletteMetric, metricPadding, VisualOrientation.Top)
            {
                ViewButton
            };

            // Create a controller for managing button behavior
            ButtonSpecViewControllers controllers = CreateController(ViewButton, needPaint, OnClick);

            ViewButton.MouseController  = controllers.MouseController;
            ViewButton.SourceController = controllers.SourceController;
            ViewButton.KeyController    = controllers.KeyController;

            // We need notifying whenever a button specification property changes
            ButtonSpec.ButtonSpecPropertyChanged += OnPropertyChanged;

            // Associate the button spec with the view that is drawing it
            ButtonSpec.SetView(ViewButton);

            // Finally update view with current button spec settings
            UpdateButtonStyle();
            UpdateVisible();
            UpdateEnabled();
            UpdateChecked();
        }
 /// <summary>
 /// Populate values from the base palette.
 /// </summary>
 /// <param name="metric">Which metric should be used for padding.</param>
 public void PopulateFromBase(PaletteMetricPadding metric)
 {
     // Populate only the designated styles
     _stateDisabled.PopulateFromBase(PaletteState.Disabled, metric);
     _stateNormal.PopulateFromBase(PaletteState.Normal, metric);
     _stateTracking.PopulateFromBase(PaletteState.Tracking, metric);
     _statePressed.PopulateFromBase(PaletteState.Pressed, metric);
 }
        /// <summary>
        /// Initialize a new instance of the ViewLayoutScrollViewport class.
        /// </summary>
        /// <param name="rootControl">Top level visual control.</param>
        /// <param name="viewportFiller">View element to place inside viewport.</param>
        /// <param name="paletteBorderEdge">Palette for use with the border edge.</param>
        /// <param name="paletteMetrics">Palette source for metrics.</param>
        /// <param name="metricPadding">Metric used to get view padding.</param>
        /// <param name="metricOvers">Metric used to get overposition.</param>
        /// <param name="orientation">Orientation for the viewport children.</param>
        /// <param name="alignment">Alignment of the children within the viewport.</param>
        /// <param name="animateChange">Animate changes in the viewport.</param>
        /// <param name="vertical">Is the viewport vertical.</param>
        /// <param name="needPaintDelegate">Delegate for notifying paint requests.</param>
        public ViewLayoutScrollViewport(VisualControl rootControl,
                                        ViewBase viewportFiller,
                                        PaletteBorderEdge paletteBorderEdge,
                                        IPaletteMetric paletteMetrics,
                                        PaletteMetricPadding metricPadding,
                                        PaletteMetricInt metricOvers,
                                        VisualOrientation orientation,
                                        RelativePositionAlign alignment,
                                        bool animateChange,
                                        bool vertical,
                                        NeedPaintHandler needPaintDelegate)
        {
            Debug.Assert(rootControl != null);
            Debug.Assert(viewportFiller != null);
            Debug.Assert(needPaintDelegate != null);

            // We need a way to notify changes in layout
            _needPaintDelegate = needPaintDelegate;

            // By default we are showing the contained viewport in vertical scrolling
            _viewportVertical = vertical;

            // Our initial visual orientation should match the parameter
            Orientation = orientation;

            // Create the child viewport
            _viewport = new ViewLayoutViewport(paletteMetrics, metricPadding,
                                               metricOvers, ViewportOrientation(_viewportVertical),
                                               alignment, animateChange);

            // Default to same alignment for both directions
            _viewport.CounterAlignment = alignment;

            // We always want the viewport to fill any remainder space
            _viewport.FillSpace = true;

            // Put the provided element inside the viewport
            _viewport.Add(viewportFiller);

            // Hook into animation step events
            _viewport.AnimateStep += new EventHandler(OnAnimateStep);

            // To prevent the contents of the viewport from being able to draw outside
            // the viewport (such as having child controls) we use a ViewLayoutControl
            // that uses a child control to restrict the drawing region.
            _viewControl = new ViewLayoutControl(rootControl, _viewport);
            _viewControl.InDesignMode = rootControl.InDesignMode;

            // Create the scrollbar and matching border edge
            _scrollbarV = new ViewDrawScrollBar(true);
            _scrollbarH = new ViewDrawScrollBar(false);
            _borderEdgeV = new ViewDrawBorderEdge(paletteBorderEdge, System.Windows.Forms.Orientation.Vertical);
            _borderEdgeH = new ViewDrawBorderEdge(paletteBorderEdge, System.Windows.Forms.Orientation.Horizontal);

            // Hook into scroll position changes
            _scrollbarV.ScrollChanged += new EventHandler(OnScrollVChanged);
            _scrollbarH.ScrollChanged += new EventHandler(OnScrollHChanged);

            // Add with appropriate docking style
            Add(_viewControl, ViewDockStyle.Fill);
            Add(_borderEdgeV, ViewDockStyle.Right);
            Add(_borderEdgeH, ViewDockStyle.Bottom);
            Add(_scrollbarV, ViewDockStyle.Right);
            Add(_scrollbarH, ViewDockStyle.Bottom);
        }
        /// <summary>
        /// Gets a padding metric value.
        /// </summary>
        /// <param name="state">Palette value should be applicable to this state.</param>
        /// <param name="metric">Requested metric.</param>
        /// <returns>Padding value.</returns>
        public Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric)
        {
            // Is this the metric we provide?
            if ((metric == PaletteMetricPadding.SeparatorPaddingLowProfile) ||
                (metric == PaletteMetricPadding.SeparatorPaddingHighProfile) ||
                (metric == PaletteMetricPadding.SeparatorPaddingHighInternalProfile) ||
                (metric == PaletteMetricPadding.SeparatorPaddingCustom1))
            {
                // If the user has defined an actual value to use
                if (!Padding.Equals(CommonHelper.InheritPadding))
                    return Padding;
            }

            // Pass onto the inheritance
            return _inherit.GetMetricPadding(state, metric);
        }
Ejemplo n.º 29
0
 /// <summary>
 /// Initialize a new instance of the ViewLayoutCenter class.
 /// </summary>
 /// <param name="paletteMetric">Target for recovering metric values.</param>
 /// <param name="metricPadding">Metric to use for border padding.</param>
 /// <param name="orientation">Orientation of the element.</param>
 public ViewLayoutCenter(IPaletteMetric paletteMetric,
                         PaletteMetricPadding metricPadding,
                         VisualOrientation orientation)
     : this(paletteMetric, metricPadding, orientation, null)
 {
 }
Ejemplo n.º 30
0
 /// <summary>
 /// Initialize a new instance of the ViewLayoutCenter class.
 /// </summary>
 /// <param name="paletteMetric">Target for recovering metric values.</param>
 /// <param name="metricPadding">Metric to use for border padding.</param>
 /// <param name="orientation">Orientation of the element.</param>
 public ViewLayoutCenter(IPaletteMetric paletteMetric,
                         PaletteMetricPadding metricPadding,
                         VisualOrientation orientation)
     : this(paletteMetric, metricPadding, orientation, null)
 {
 }
Ejemplo n.º 31
0
        /// <summary>
        /// Gets a padding metric value.
        /// </summary>
        /// <param name="state">Palette value should be applicable to this state.</param>
        /// <param name="metric">Requested metric.</param>
        /// <returns>Padding value.</returns>
        public override Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric)
        {
            switch (metric)
            {
                case PaletteMetricPadding.PageButtonPadding:
                    return _metricPaddingPageButtons;
                case PaletteMetricPadding.BarPaddingTabs:
                    return _metricPaddingBarTabs;
                case PaletteMetricPadding.BarPaddingInside:
                case PaletteMetricPadding.BarPaddingOnly:
                    return _metricPaddingBarInside;
                case PaletteMetricPadding.BarPaddingOutside:
                    return _metricPaddingBarOutside;
                case PaletteMetricPadding.HeaderButtonPaddingForm:
                    return _metricPaddingHeaderForm;
                case PaletteMetricPadding.RibbonButtonPadding:
                    return _metricPaddingRibbon;
                case PaletteMetricPadding.RibbonAppButton:
                    return _metricPaddingRibbonAppButton;
                case PaletteMetricPadding.HeaderButtonPaddingInputControl:
                    return _metricPaddingInputControl;
                case PaletteMetricPadding.HeaderButtonPaddingPrimary:
                case PaletteMetricPadding.HeaderButtonPaddingSecondary:
                case PaletteMetricPadding.HeaderButtonPaddingDockInactive:
                case PaletteMetricPadding.HeaderButtonPaddingDockActive:
                case PaletteMetricPadding.HeaderButtonPaddingCustom1:
                case PaletteMetricPadding.HeaderButtonPaddingCustom2:
                case PaletteMetricPadding.HeaderButtonPaddingCalendar:
                case PaletteMetricPadding.BarButtonPadding:
                    return _metricPaddingHeader;
                case PaletteMetricPadding.HeaderGroupPaddingPrimary:
                case PaletteMetricPadding.HeaderGroupPaddingSecondary:
                case PaletteMetricPadding.HeaderGroupPaddingDockInactive:
                case PaletteMetricPadding.HeaderGroupPaddingDockActive:
                case PaletteMetricPadding.SeparatorPaddingLowProfile:
                case PaletteMetricPadding.SeparatorPaddingHighInternalProfile:
                case PaletteMetricPadding.SeparatorPaddingHighProfile:
                case PaletteMetricPadding.SeparatorPaddingCustom1:
                case PaletteMetricPadding.ContextMenuItemHighlight:
                case PaletteMetricPadding.ContextMenuItemsCollection:
                case PaletteMetricPadding.ContextMenuItemOuter:
                    return Padding.Empty;
                default:
                    // Should never happen!
                    Debug.Assert(false);
                    break;
            }

            return Padding.Empty;
        }
Ejemplo n.º 32
0
 /// <summary>
 /// Gets a padding metric value.
 /// </summary>
 /// <param name="state">Palette value should be applicable to this state.</param>
 /// <param name="metric">Requested metric.</param>
 /// <returns>Padding value.</returns>
 public virtual Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric)
 {
     return _target.GetMetricPadding(state, metric);
 }
Ejemplo n.º 33
0
        /// <summary>
        /// Gets a padding metric value.
        /// </summary>
        /// <param name="state">Palette value should be applicable to this state.</param>
        /// <param name="metric">Requested metric.</param>
        /// <returns>Padding value.</returns>
        public override Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric)
        {
            switch (metric)
            {
                case PaletteMetricPadding.BarButtonPadding:
                    if (!ButtonPadding.Equals(CommonHelper.InheritPadding))
                        return ButtonPadding;
                    break;
                case PaletteMetricPadding.BarPaddingTabs:
                    if (!BarPaddingTabs.Equals(CommonHelper.InheritPadding))
                        return BarPaddingInside;
                    break;
                case PaletteMetricPadding.BarPaddingInside:
                    if (!BarPaddingInside.Equals(CommonHelper.InheritPadding))
                        return BarPaddingInside;
                    break;
                case PaletteMetricPadding.BarPaddingOutside:
                    if (!BarPaddingOutside.Equals(CommonHelper.InheritPadding))
                        return BarPaddingOutside;
                    break;
                case PaletteMetricPadding.BarPaddingOnly:
                    if (!BarPaddingOnly.Equals(CommonHelper.InheritPadding))
                        return BarPaddingOnly;
                    break;
            }

            // Pass onto the inheritance
            return _redirect.GetMetricPadding(state, metric);
        }
 /// <summary>
 /// Initialize a new instance of the ButtonSpecNavManagerLayoutBar class.
 /// </summary>
 /// <param name="control">Control that owns the button manager.</param>
 /// <param name="redirector">Palette redirector.</param>
 /// <param name="variableSpecs">Variable set of button specifications.</param>
 /// <param name="fixedSpecs">Fixed set of button specifications.</param>
 /// <param name="viewDockers">Array of target view dockers.</param>
 /// <param name="viewMetrics">Array of target metric providers.</param>
 /// <param name="viewMetricIntOutside">Array of target metrics for outside spacer size.</param>
 /// <param name="viewMetricIntInside">Array of target metrics for inside spacer size.</param>
 /// <param name="viewMetricPaddings">Array of target metrics for button padding.</param>
 /// <param name="getRenderer">Delegate for returning a tool strip renderer.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public ButtonSpecNavManagerLayoutBar(Control control,
                                      PaletteRedirect redirector,
                                      ButtonSpecCollectionBase variableSpecs,
                                      ButtonSpecCollectionBase fixedSpecs,
                                      ViewLayoutDocker[] viewDockers,
                                      IPaletteMetric[] viewMetrics,
                                      PaletteMetricInt[] viewMetricIntOutside,
                                      PaletteMetricInt[] viewMetricIntInside,
                                      PaletteMetricPadding[] viewMetricPaddings,
                                      GetToolStripRenderer getRenderer,
                                      NeedPaintHandler needPaint)
     : base(control, redirector, variableSpecs, fixedSpecs, 
            viewDockers, viewMetrics, viewMetricIntOutside,
            viewMetricIntInside, viewMetricPaddings, getRenderer, 
            needPaint)
 {
     _remapTarget = ButtonSpecNavRemap.ButtonSpecRemapTarget.LabelPanel;
 }
Ejemplo n.º 35
0
 /// <summary>
 /// Populate values from the base palette.
 /// </summary>
 /// <param name="state">Which state to populate from.</param>
 /// <param name="metric">Which metric should be used for padding.</param>
 public void PopulateFromBase(PaletteState state, PaletteMetricPadding metric)
 {
     base.PopulateFromBase(state);
     Padding = _inherit.GetMetricPadding(state, metric);
 }
Ejemplo n.º 36
0
        /// <summary>
        /// Initialize a new instance of the ViewDrawDocker class.
        /// </summary>
        /// <param name="paletteBack">Palette source for the background.</param>		
        /// <param name="paletteBorder">Palette source for the border.</param>
        /// <param name="paletteMetric">Palette source for metric values.</param>
        /// <param name="metricOverlay">Metric to use for border overlay.</param>
        /// <param name="metricPadding">Matric used to get padding values.</param>
        /// <param name="orientation">Visual orientation of the content.</param>
        public ViewDrawDocker(IPaletteBack paletteBack,
							  IPaletteBorder paletteBorder,
							  IPaletteMetric paletteMetric,
                              PaletteMetricBool metricOverlay,
                              PaletteMetricPadding metricPadding,
                              VisualOrientation orientation)
            : base(paletteBack, paletteBorder, paletteMetric, metricPadding, orientation)
        {
            // Cache the starting values
            _metricOverlay = metricOverlay;

            // Create other state
            _childDocking = new ViewDockStyleLookup();
            _fillRectangle = Rectangle.Empty;
            _ignoreBorderSpace = false;
            _removeChildBorders = false;
            _preferredSizeAll = false;
        }
        /// <summary>
        /// Gets a padding metric value.
        /// </summary>
        /// <param name="state">Palette value should be applicable to this state.</param>
        /// <param name="metric">Requested metric.</param>
        /// <returns>Padding value.</returns>
        public virtual Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric)
        {
            switch (metric)
            {
                case PaletteMetricPadding.HeaderGroupPaddingPrimary:
                    if (!PrimaryHeaderPadding.Equals(CommonHelper.InheritPadding))
                        return PrimaryHeaderPadding;
                    break;
                case PaletteMetricPadding.HeaderGroupPaddingSecondary:
                    if (!SecondaryHeaderPadding.Equals(CommonHelper.InheritPadding))
                        return SecondaryHeaderPadding;
                    break;
                case PaletteMetricPadding.HeaderGroupPaddingDockInactive:
                    if (!DockInactiveHeaderPadding.Equals(CommonHelper.InheritPadding))
                        return DockInactiveHeaderPadding;
                    break;
                case PaletteMetricPadding.HeaderGroupPaddingDockActive:
                    if (!DockActiveHeaderPadding.Equals(CommonHelper.InheritPadding))
                        return DockActiveHeaderPadding;
                    break;
            }

            // Pass onto the inheritance
            return _redirect.GetMetricPadding(state, metric);
        }
        /// <summary>
        /// Gets a padding metric value.
        /// </summary>
        /// <param name="state">Palette value should be applicable to this state.</param>
        /// <param name="metric">Requested metric.</param>
        /// <returns>Padding value.</returns>
        public override Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric)
        {
            IPaletteMetric inherit = GetInherit(state);

            return(inherit?.GetMetricPadding(state, metric) ?? Target.GetMetricPadding(state, metric));
        }
 /// <summary>
 /// Populate values from the base palette.
 /// </summary>
 /// <param name="state">Which state to populate from.</param>
 /// <param name="metric">Which metric should be used for padding.</param>
 public void PopulateFromBase(PaletteState state, PaletteMetricPadding metric)
 {
     base.PopulateFromBase(state);
     Padding = _inherit.GetMetricPadding(state, metric);
 }
 /// <summary>
 /// Create the button spec view appropriate for the button spec.
 /// </summary>
 /// <param name="redirector">Redirector for acquiring palette values.</param>
 /// <param name="viewPaletteMetric">Target metric providers.</param>
 /// <param name="viewMetricPadding">Target metric padding.</param>
 /// <param name="buttonSpec">ButtonSpec instance.</param>
 /// <returns>ButtonSpecView derived class.</returns>
 protected override ButtonSpecView CreateButtonSpecView(PaletteRedirect redirector,
                                                        IPaletteMetric viewPaletteMetric,
                                                        PaletteMetricPadding viewMetricPadding,
                                                        ButtonSpec buttonSpec) =>
 new ButtonSpecViewRibbon(redirector, viewPaletteMetric,
                          viewMetricPadding, this, buttonSpec);