Redirect storage for a triple palette with palette metrics.
Inheritance: PaletteTripleRedirect, IPaletteMetric
        /// <summary>
        /// Initialize a new instance of the PaletteTripleMetric class.
        /// </summary>
        /// <param name="inherit">Source for palette defaulted values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public PaletteTripleMetric(PaletteTripleMetricRedirect inherit,
                                   NeedPaintHandler needPaint)
            : base(inherit, needPaint)
        {
            Debug.Assert(inherit != null);

            // Remember inheritance for metric values
            _inherit = inherit;
        }
        /// <summary>
        /// Initialize a new instance of the PaletteTripleMetric class.
        /// </summary>
        /// <param name="inherit">Source for palette defaulted values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public PaletteTripleMetric(PaletteTripleMetricRedirect inherit,
                                   NeedPaintHandler needPaint)
            : base(inherit, needPaint)
        {
            Debug.Assert(inherit != null);

            // Remember inheritance for metric values
            _inherit = inherit;
        }
Exemple #3
0
        /// <summary>
        /// Initialize a new instance of the PaletteForm class.
        /// </summary>
        /// <param name="inheritForm">Source for inheriting palette defaulted values.</param>
        /// <param name="inheritHeader">Source for inheriting header defaulted values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public PaletteForm(PaletteFormRedirect inheritForm,
                           PaletteTripleMetricRedirect inheritHeader,
                           NeedPaintHandler needPaint)
            : base(inheritForm, needPaint)
        {
            Debug.Assert(inheritForm != null);
            Debug.Assert(inheritHeader != null);

            // Remember the inheritance
            _inherit = inheritForm;

            // Create the palette storage
            _paletteHeader = new PaletteTripleMetric(inheritHeader, needPaint);
        }
        /// <summary>
        /// Initialize a new instance of the VisualPopupTooltip class.
        /// </summary>
        /// <param name="redirector">Redirector for recovering palette values.</param>
        /// <param name="contentValues">Source of content values.</param>
        /// <param name="renderer">Drawing renderer.</param>
        /// <param name="backStyle">Style for the tooltip background.</param>
        /// <param name="borderStyle">Style for the tooltip border.</param>
        /// <param name="contentStyle">Style for the tooltip content.</param>
        public VisualPopupToolTip(PaletteRedirect redirector,
                                  IContentValues contentValues,
                                  IRenderer renderer,
                                  PaletteBackStyle backStyle,
                                  PaletteBorderStyle borderStyle,
                                  PaletteContentStyle contentStyle)
            : base(renderer, true)
        {
            Debug.Assert(contentValues != null);

            // Remember references needed later
            _contentValues = contentValues;

            // Create the triple redirector needed by view elements
            _palette = new PaletteTripleMetricRedirect(redirector, backStyle, borderStyle, contentStyle, NeedPaintDelegate);

            // Our view contains background and border with content inside
            _drawDocker  = new ViewDrawDocker(_palette.Back, _palette.Border, null);
            _drawContent = new ViewDrawContent(_palette.Content, _contentValues, VisualOrientation.Top);
            _drawDocker.Add(_drawContent, ViewDockStyle.Fill);

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawDocker);
        }
Exemple #5
0
 /// <summary>
 /// Sets the inheritence parent.
 /// </summary>
 public void SetInherit(PaletteTripleMetricRedirect inherit)
 {
     base.SetInherit(inherit);
     _inherit = inherit;
 }
        private void SetHeaderStyle(ViewDrawDocker drawDocker,
                                    PaletteTripleMetricRedirect palette,
                                    HeaderStyle style)
        {
            palette.SetStyles(style);

            switch (style)
            {
                case HeaderStyle.Primary:
                    _buttonManager.SetDockerMetrics(drawDocker, palette,
                                                    PaletteMetricInt.HeaderButtonEdgeInsetPrimary,
                                                    PaletteMetricPadding.HeaderButtonPaddingPrimary);
                    break;
                case HeaderStyle.Secondary:
                    _buttonManager.SetDockerMetrics(drawDocker, palette,
                                                    PaletteMetricInt.HeaderButtonEdgeInsetSecondary,
                                                    PaletteMetricPadding.HeaderButtonPaddingSecondary);
                    break;
                case HeaderStyle.DockActive:
                    _buttonManager.SetDockerMetrics(drawDocker, palette,
                                                    PaletteMetricInt.HeaderButtonEdgeInsetDockActive,
                                                    PaletteMetricPadding.HeaderButtonPaddingDockActive);
                    break;
                case HeaderStyle.DockInactive:
                    _buttonManager.SetDockerMetrics(drawDocker, palette,
                                                    PaletteMetricInt.HeaderButtonEdgeInsetDockInactive,
                                                    PaletteMetricPadding.HeaderButtonPaddingDockInactive);
                    break;
                case HeaderStyle.Form:
                    _buttonManager.SetDockerMetrics(drawDocker, palette,
                                                    PaletteMetricInt.HeaderButtonEdgeInsetForm,
                                                    PaletteMetricPadding.HeaderButtonPaddingForm);
                    break;
                case HeaderStyle.Calendar:
                    _buttonManager.SetDockerMetrics(drawDocker, palette,
                                                    PaletteMetricInt.HeaderButtonEdgeInsetCalendar,
                                                    PaletteMetricPadding.HeaderButtonPaddingCalendar);
                    break;
                case HeaderStyle.Custom1:
                    _buttonManager.SetDockerMetrics(drawDocker, palette,
                                                    PaletteMetricInt.HeaderButtonEdgeInsetCustom1,
                                                    PaletteMetricPadding.HeaderButtonPaddingCustom1);
                    break;
                case HeaderStyle.Custom2:
                    _buttonManager.SetDockerMetrics(drawDocker, palette,
                                                    PaletteMetricInt.HeaderButtonEdgeInsetCustom2,
                                                    PaletteMetricPadding.HeaderButtonPaddingCustom2);
                    break;
                default:
                    // Should never happen!
                    Debug.Assert(false);
                    break;
            }
        }
        /// <summary>
        /// Initialize a new instance of the VisualPopupTooltip class.
        /// </summary>
        /// <param name="redirector">Redirector for recovering palette values.</param>
        /// <param name="contentValues">Source of content values.</param>
        /// <param name="renderer">Drawing renderer.</param>
        /// <param name="backStyle">Style for the tooltip background.</param>
        /// <param name="borderStyle">Style for the tooltip border.</param>
        /// <param name="contentStyle">Style for the tooltip content.</param>
        public VisualPopupToolTip(PaletteRedirect redirector,
                                  IContentValues contentValues,
                                  IRenderer renderer,
                                  PaletteBackStyle backStyle,
                                  PaletteBorderStyle borderStyle,
                                  PaletteContentStyle contentStyle)
            : base(renderer, true)
        {
            Debug.Assert(contentValues != null);

            // Remember references needed later
            _contentValues = contentValues;

            // Create the triple redirector needed by view elements
            _palette = new PaletteTripleMetricRedirect(redirector, backStyle, borderStyle, contentStyle, NeedPaintDelegate);

            // Our view contains background and border with content inside
            _drawDocker = new ViewDrawDocker(_palette.Back, _palette.Border, null);
            _drawContent = new ViewDrawContent(_palette.Content, _contentValues, VisualOrientation.Top);
            _drawDocker.Add(_drawContent, ViewDockStyle.Fill);

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawDocker);
        }
 /// <summary>
 /// Sets the inheritence parent.
 /// </summary>
 public void SetInherit(PaletteTripleMetricRedirect inherit)
 {
     base.SetInherit(inherit);
     _inherit = inherit;
 }