internal void SetPaletteRedirect(PaletteRedirect redirector)
 {
     _stateCommon.SetRedirector(redirector);
     _stateFocus.SetRedirector(redirector);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Update the redirector with new reference.
 /// </summary>
 /// <param name="redirect">Target redirector.</param>
 public void SetRedirector(PaletteRedirect redirect)
 {
     _redirect = redirect;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initialize a new instance of the KryptonPaletteRibbonGroupLabelText class.
 /// </summary>
 /// <param name="redirect">Redirector to inherit values from.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public KryptonPaletteRibbonGroupLabelText(PaletteRedirect redirect,
                                           NeedPaintHandler needPaint)
     : base(redirect, PaletteRibbonTextStyle.RibbonGroupLabelText, needPaint)
 {
 }
 /// <summary>
 /// Initialize a new instance of the PaletteHeaderGroupRedirect class.
 /// </summary>
 /// <param name="redirect">Inheritence redirection instance.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public PaletteHeaderGroupRedirect(PaletteRedirect redirect,
                                   NeedPaintHandler needPaint)
     : this(redirect, redirect, redirect, needPaint)
 {
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Update the redirector with new reference.
 /// </summary>
 /// <param name="redirect">Target redirector.</param>
 public virtual void SetRedirector(PaletteRedirect redirect)
 {
     _backInherit.SetRedirector(redirect);
     _borderInherit.SetRedirector(redirect);
     _contentInherit.SetRedirector(redirect);
 }
 /// <summary>
 /// Initialize a new instance of the PaletteContentInheritRedirect class.
 /// </summary>
 /// <param name="redirect">Source for inherit requests.</param>
 public PaletteContentInheritRedirect(PaletteRedirect redirect)
     : this(redirect, PaletteContentStyle.ButtonStandalone)
 {
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Update the redirector with new reference.
 /// </summary>
 /// <param name="redirect">Target redirector.</param>
 public void SetRedirector(PaletteRedirect redirect)
 {
     StateCommon.SetRedirector(redirect);
 }
 /// <summary>
 /// Create a palette redirector for remapping button spec colors.
 /// </summary>
 /// <param name="redirector">Base palette class.</param>
 /// <param name="buttonSpec">ButtonSpec instance.</param>
 /// <returns>Palette redirector for the button spec instance.</returns>
 public override PaletteRedirect CreateButtonSpecRemap(PaletteRedirect redirector,
                                                       ButtonSpec buttonSpec)
 {
     return new ButtonSpecRemapByContentCache(redirector, buttonSpec);
 }
 /// <summary>
 /// Update the redirector with new reference.
 /// </summary>
 /// <param name="redirect">Target redirector.</param>
 public void SetRedirector(PaletteRedirect redirect)
 {
     _inheritBack.SetRedirector(redirect);
 }
 /// <summary>
 /// Initialize a new instance of the PaletteBorderInheritRedirect class.
 /// </summary>
 /// <param name="redirect">Source for inherit requests.</param>
 /// <param name="style">Style used in requests.</param>
 public PaletteBorderInheritRedirect(PaletteRedirect redirect,
                                     PaletteBorderStyle style)
 {
     _redirect = redirect;
     Style     = style;
 }
 /// <summary>
 /// Update the redirector with new reference.
 /// </summary>
 /// <param name="redirect">Target redirector.</param>
 public override void SetRedirector(PaletteRedirect redirect)
 {
     base.SetRedirector(redirect);
     _ribbonBackInherit.SetRedirector(redirect);
     _ribbonBorderInherit.SetRedirector(redirect);
 }
Ejemplo n.º 12
0
        /// <summary>
        /// Initialize a new instance of the ViewLayoutMonths class.
        /// </summary>
        /// <param name="provider">Provider of context menu information.</param>
        /// <param name="monthCalendar">Reference to owning month calendar entry.</param>
        /// <param name="viewManager">Owning view manager instance.</param>
        /// <param name="calendar">Reference to calendar provider.</param>
        /// <param name="redirector">Redirector for getting values.</param>
        /// <param name="needPaintDelegate">Delegate for requesting paint changes.</param>
        public ViewLayoutMonths(IContextMenuProvider provider,
                                KryptonContextMenuMonthCalendar monthCalendar,
                                ViewContextMenuManager viewManager,
                                IKryptonMonthCalendar calendar,
                                PaletteRedirect redirector,
                                NeedPaintHandler needPaintDelegate)
        {
            Provider                = provider;
            Calendar                = calendar;
            _oldSelectionStart      = Calendar.SelectionStart;
            _oldSelectionEnd        = Calendar.SelectionEnd;
            _displayMonth           = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
            _redirector             = redirector;
            _needPaintDelegate      = needPaintDelegate;
            _showToday              = true;
            _showTodayCircle        = true;
            CloseOnTodayClick       = false;
            _firstTimeSync          = true;
            AllowButtonSpecToolTips = false;

            // Use a controller that can work against all the displayed months
            MonthCalendarController controller = new MonthCalendarController(monthCalendar, viewManager, this, _needPaintDelegate);

            MouseController  = controller;
            SourceController = controller;
            KeyController    = controller;

            _borderForced = new PaletteBorderInheritForced(Calendar.StateNormal.Header.Border);
            _borderForced.ForceBorderEdges(PaletteDrawBorders.None);
            _drawHeader   = new ViewDrawDocker(Calendar.StateNormal.Header.Back, _borderForced, null);
            _emptyContent = new ViewDrawEmptyContent(Calendar.StateDisabled.Header.Content, Calendar.StateNormal.Header.Content);
            _drawHeader.Add(_emptyContent, ViewDockStyle.Fill);
            Add(_drawHeader);

            // Using a button spec manager to add the buttons to the header
            ButtonSpecs   = new MonthCalendarButtonSpecCollection(this);
            ButtonManager = new ButtonSpecManagerDraw(Calendar.CalendarControl, redirector, ButtonSpecs, null,
                                                      new ViewDrawDocker[] { _drawHeader },
                                                      new IPaletteMetric[] { Calendar.StateCommon },
                                                      new PaletteMetricInt[] { PaletteMetricInt.HeaderButtonEdgeInsetCalendar },
                                                      new PaletteMetricPadding[] { PaletteMetricPadding.None },
                                                      Calendar.GetToolStripDelegate, _needPaintDelegate);

            // Create the manager for handling tooltips
            _toolTipManager                = new ToolTipManager();
            _toolTipManager.ShowToolTip   += OnShowToolTip;
            _toolTipManager.CancelToolTip += OnCancelToolTip;
            ButtonManager.ToolTipManager   = _toolTipManager;

            // Create the bottom header used for showing 'today' and defined button specs
            _remapPalette            = (ButtonSpecRemapByContentView)ButtonManager.CreateButtonSpecRemap(redirector, new ButtonSpecAny());
            _remapPalette.Foreground = _emptyContent;

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

            _drawToday        = new ViewDrawToday(Calendar, _palette, _palette, _palette, _palette, _needPaintDelegate);
            _drawToday.Click += OnTodayClick;
            _drawHeader.Add(_drawToday, ViewDockStyle.Left);
        }
 /// <summary>
 /// Update the redirector with new reference.
 /// </summary>
 /// <param name="redirect">Target redirector.</param>
 public void SetRedirector(PaletteRedirect redirect)
 {
     _stateCommon.SetRedirector(redirect);
     _stateFocus.SetRedirector(redirect);
 }
        /// <summary>
        /// Initialize a new instance of the KryptonPaletteButtonSpecs class.
        /// </summary>
        /// <param name="redirector">Palette redirector for sourcing inherited values.</param>
        internal KryptonPaletteButtonSpecs(PaletteRedirect redirector)
        {
            Debug.Assert(redirector != null);

            // Create exposed button specifications
            Common            = new KryptonPaletteButtonSpecTyped(redirector);
            Generic           = new KryptonPaletteButtonSpecTyped(redirector);
            Close             = new KryptonPaletteButtonSpecTyped(redirector);
            Context           = new KryptonPaletteButtonSpecTyped(redirector);
            Next              = new KryptonPaletteButtonSpecTyped(redirector);
            Previous          = new KryptonPaletteButtonSpecTyped(redirector);
            ArrowLeft         = new KryptonPaletteButtonSpecTyped(redirector);
            ArrowRight        = new KryptonPaletteButtonSpecTyped(redirector);
            ArrowUp           = new KryptonPaletteButtonSpecTyped(redirector);
            ArrowDown         = new KryptonPaletteButtonSpecTyped(redirector);
            DropDown          = new KryptonPaletteButtonSpecTyped(redirector);
            PinVertical       = new KryptonPaletteButtonSpecTyped(redirector);
            PinHorizontal     = new KryptonPaletteButtonSpecTyped(redirector);
            FormClose         = new KryptonPaletteButtonSpecTyped(redirector);
            FormMax           = new KryptonPaletteButtonSpecTyped(redirector);
            FormMin           = new KryptonPaletteButtonSpecTyped(redirector);
            FormRestore       = new KryptonPaletteButtonSpecTyped(redirector);
            FormHelp          = new KryptonPaletteButtonSpecTyped(redirector);
            PendantClose      = new KryptonPaletteButtonSpecTyped(redirector);
            PendantMin        = new KryptonPaletteButtonSpecTyped(redirector);
            PendantRestore    = new KryptonPaletteButtonSpecTyped(redirector);
            WorkspaceMaximize = new KryptonPaletteButtonSpecTyped(redirector);
            WorkspaceRestore  = new KryptonPaletteButtonSpecTyped(redirector);
            RibbonMinimize    = new KryptonPaletteButtonSpecTyped(redirector);
            RibbonExpand      = new KryptonPaletteButtonSpecTyped(redirector);

            // Create redirector for inheriting from style specific to style common
            PaletteRedirectButtonSpec redirectCommon = new(redirector, Common);

            // Inform the button spec to use the new redirector
            Generic.SetRedirector(redirectCommon);
            Close.SetRedirector(redirectCommon);
            Context.SetRedirector(redirectCommon);
            Next.SetRedirector(redirectCommon);
            Previous.SetRedirector(redirectCommon);
            ArrowLeft.SetRedirector(redirectCommon);
            ArrowRight.SetRedirector(redirectCommon);
            ArrowUp.SetRedirector(redirectCommon);
            ArrowDown.SetRedirector(redirectCommon);
            DropDown.SetRedirector(redirectCommon);
            PinVertical.SetRedirector(redirectCommon);
            PinHorizontal.SetRedirector(redirectCommon);
            FormClose.SetRedirector(redirectCommon);
            FormMax.SetRedirector(redirectCommon);
            FormMin.SetRedirector(redirectCommon);
            FormRestore.SetRedirector(redirectCommon);
            FormHelp.SetRedirector(redirectCommon);
            PendantClose.SetRedirector(redirectCommon);
            PendantMin.SetRedirector(redirectCommon);
            PendantRestore.SetRedirector(redirectCommon);
            WorkspaceMaximize.SetRedirector(redirectCommon);
            WorkspaceRestore.SetRedirector(redirectCommon);
            RibbonMinimize.SetRedirector(redirectCommon);
            RibbonExpand.SetRedirector(redirectCommon);

            // Hook into the storage change events
            Common.ButtonSpecChanged            += OnButtonSpecChanged;
            Generic.ButtonSpecChanged           += OnButtonSpecChanged;
            Close.ButtonSpecChanged             += OnButtonSpecChanged;
            Context.ButtonSpecChanged           += OnButtonSpecChanged;
            Next.ButtonSpecChanged              += OnButtonSpecChanged;
            Previous.ButtonSpecChanged          += OnButtonSpecChanged;
            ArrowLeft.ButtonSpecChanged         += OnButtonSpecChanged;
            ArrowRight.ButtonSpecChanged        += OnButtonSpecChanged;
            ArrowUp.ButtonSpecChanged           += OnButtonSpecChanged;
            ArrowDown.ButtonSpecChanged         += OnButtonSpecChanged;
            DropDown.ButtonSpecChanged          += OnButtonSpecChanged;
            PinVertical.ButtonSpecChanged       += OnButtonSpecChanged;
            PinHorizontal.ButtonSpecChanged     += OnButtonSpecChanged;
            FormClose.ButtonSpecChanged         += OnButtonSpecChanged;
            FormMax.ButtonSpecChanged           += OnButtonSpecChanged;
            FormMin.ButtonSpecChanged           += OnButtonSpecChanged;
            FormRestore.ButtonSpecChanged       += OnButtonSpecChanged;
            FormHelp.ButtonSpecChanged          += OnButtonSpecChanged;
            PendantClose.ButtonSpecChanged      += OnButtonSpecChanged;
            PendantMin.ButtonSpecChanged        += OnButtonSpecChanged;
            PendantRestore.ButtonSpecChanged    += OnButtonSpecChanged;
            WorkspaceMaximize.ButtonSpecChanged += OnButtonSpecChanged;
            WorkspaceRestore.ButtonSpecChanged  += OnButtonSpecChanged;
            RibbonMinimize.ButtonSpecChanged    += OnButtonSpecChanged;
            RibbonExpand.ButtonSpecChanged      += OnButtonSpecChanged;
        }
 /// <summary>
 /// Update the redirector with new reference.
 /// </summary>
 /// <param name="redirect">Target redirector.</param>
 public void SetRedirector(PaletteRedirect redirect)
 {
     Day.SetRedirector(redirect);
 }
Ejemplo n.º 16
0
        /// <summary>
        /// Initialize a new instance of the PaletteDoubleRedirect class.
        /// </summary>
        /// <param name="redirect">Inheritence redirection instance.</param>
        /// <param name="panelBackStyle">Initial background style.</param>
        /// <param name="needPaint">Paint delegate.</param>
        public PaletteRibbonRedirect(PaletteRedirect redirect,
                                     PaletteBackStyle panelBackStyle,
                                     NeedPaintHandler needPaint)
            : base(redirect)
        {
            Debug.Assert(redirect != null);

            // Store the provided paint notification delegate
            NeedPaint = needPaint;

            // Create the style redirection instances
            _groupButtonInherit          = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonButtonSpec, PaletteBorderStyle.ButtonButtonSpec, PaletteContentStyle.ButtonButtonSpec, needPaint);
            _groupClusterButtonInherit   = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonStandalone, PaletteBorderStyle.ButtonStandalone, PaletteContentStyle.ButtonStandalone, needPaint);
            _groupCollapsedButtonInherit = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonButtonSpec, PaletteBorderStyle.ButtonButtonSpec, PaletteContentStyle.ButtonButtonSpec, needPaint);
            _groupDialogButtonInherit    = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonButtonSpec, PaletteBorderStyle.ButtonButtonSpec, PaletteContentStyle.ButtonButtonSpec, needPaint);
            _keyTipInherit    = new PaletteTripleRedirect(redirect, PaletteBackStyle.ControlToolTip, PaletteBorderStyle.ControlToolTip, PaletteContentStyle.LabelKeyTip, needPaint);
            _qatButtonInherit = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonButtonSpec, PaletteBorderStyle.ButtonButtonSpec, PaletteContentStyle.ButtonButtonSpec, needPaint);
            _scrollerInherit  = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonStandalone, PaletteBorderStyle.ButtonStandalone, PaletteContentStyle.ButtonStandalone, needPaint);

            // Create the redirection instances
            _ribbonAppButtonInherit                 = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonAppButton);
            _ribbonAppMenuInnerInherit              = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonAppMenuInner);
            _ribbonAppMenuOuterInherit              = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonAppMenuOuter);
            _ribbonAppMenuDocsInherit               = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonAppMenuDocs);
            _ribbonAppMenuDocsTitleInherit          = new PaletteRibbonTextInheritRedirect(redirect, PaletteRibbonTextStyle.RibbonAppMenuDocsTitle);
            _ribbonAppMenuDocsEntryInherit          = new PaletteRibbonTextInheritRedirect(redirect, PaletteRibbonTextStyle.RibbonAppMenuDocsEntry);
            _ribbonGeneralInherit                   = new PaletteRibbonGeneralInheritRedirect(redirect);
            _ribbonGroupAreaInherit                 = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonGroupArea);
            _ribbonGroupButtonTextInherit           = new PaletteRibbonTextInheritRedirect(redirect, PaletteRibbonTextStyle.RibbonGroupButtonText);
            _ribbonGroupCheckBoxTextInherit         = new PaletteRibbonTextInheritRedirect(redirect, PaletteRibbonTextStyle.RibbonGroupCheckBoxText);
            _ribbonGroupCollapsedBackInherit        = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonGroupCollapsedBack);
            _ribbonGroupCollapsedBorderInherit      = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonGroupCollapsedBorder);
            _ribbonGroupCollapsedFrameBackInherit   = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonGroupCollapsedFrameBack);
            _ribbonGroupCollapsedFrameBorderInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonGroupCollapsedFrameBorder);
            _ribbonGroupCollapsedTextInherit        = new PaletteRibbonTextInheritRedirect(redirect, PaletteRibbonTextStyle.RibbonGroupCollapsedText);
            _ribbonGroupNormalBorderInherit         = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonGroupNormalBorder);
            _ribbonGroupNormalTitleInherit          = new PaletteRibbonDoubleInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonGroupNormalTitle, PaletteRibbonTextStyle.RibbonGroupNormalTitle);
            _ribbonGroupRadioButtonTextInherit      = new PaletteRibbonTextInheritRedirect(redirect, PaletteRibbonTextStyle.RibbonGroupRadioButtonText);
            _ribbonGroupLabelTextInherit            = new PaletteRibbonTextInheritRedirect(redirect, PaletteRibbonTextStyle.RibbonGroupLabelText);
            _ribbonTabInherit         = new PaletteRibbonDoubleInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonTab, PaletteRibbonTextStyle.RibbonTab);
            _ribbonQATFullbarInherit  = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonQATFullbar);
            _ribbonQATMinibarInherit  = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonQATMinibar);
            _ribbonQATOverflowInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonQATOverflow);

            // Create storage that maps onto the inherit instances
            _ribbonAppButton                 = new PaletteRibbonBack(_ribbonAppButtonInherit, needPaint);
            _ribbonAppMenuInner              = new PaletteRibbonBack(_ribbonAppMenuInnerInherit, needPaint);
            _ribbonAppMenuOuter              = new PaletteRibbonBack(_ribbonAppMenuOuterInherit, needPaint);
            _ribbonAppMenuDocs               = new PaletteRibbonBack(_ribbonAppMenuDocsInherit, needPaint);
            _ribbonAppMenuDocsTitle          = new PaletteRibbonText(_ribbonAppMenuDocsTitleInherit, needPaint);
            _ribbonAppMenuDocsEntry          = new PaletteRibbonText(_ribbonAppMenuDocsEntryInherit, needPaint);
            _ribbonGeneral                   = new PaletteRibbonGeneral(_ribbonGeneralInherit, needPaint);
            _ribbonGroupArea                 = new PaletteRibbonBack(_ribbonGroupAreaInherit, needPaint);
            _ribbonGroupButtonText           = new PaletteRibbonText(_ribbonGroupButtonTextInherit, needPaint);
            _ribbonGroupCheckBoxText         = new PaletteRibbonText(_ribbonGroupCheckBoxTextInherit, needPaint);
            _ribbonGroupCollapsedBack        = new PaletteRibbonBack(_ribbonGroupCollapsedBackInherit, needPaint);
            _ribbonGroupCollapsedBorder      = new PaletteRibbonBack(_ribbonGroupCollapsedBorderInherit, needPaint);
            _ribbonGroupCollapsedFrameBack   = new PaletteRibbonBack(_ribbonGroupCollapsedFrameBackInherit, needPaint);
            _ribbonGroupCollapsedFrameBorder = new PaletteRibbonBack(_ribbonGroupCollapsedFrameBorderInherit, needPaint);
            _ribbonGroupCollapsedText        = new PaletteRibbonText(_ribbonGroupCollapsedTextInherit, needPaint);
            _ribbonGroupNormalBorder         = new PaletteRibbonBack(_ribbonGroupNormalBorderInherit, needPaint);
            _ribbonGroupNormalTitle          = new PaletteRibbonDouble(_ribbonGroupNormalTitleInherit, _ribbonGroupNormalTitleInherit, needPaint);
            _ribbonGroupRadioButtonText      = new PaletteRibbonText(_ribbonGroupRadioButtonTextInherit, needPaint);
            _ribbonGroupLabelText            = new PaletteRibbonText(_ribbonGroupLabelTextInherit, needPaint);
            _ribbonTab                = new PaletteRibbonDouble(_ribbonTabInherit, _ribbonTabInherit, needPaint);
            _ribbonQATFullbar         = new PaletteRibbonBack(_ribbonQATFullbarInherit, needPaint);
            _ribbonQATMinibarActive   = new PaletteRibbonBack(_ribbonQATMinibarInherit, needPaint);
            _ribbonQATMinibarInactive = new PaletteRibbonBack(_ribbonQATMinibarInherit, needPaint);
            _ribbonQATOverflow        = new PaletteRibbonBack(_ribbonQATOverflowInherit, needPaint);
            _ribbonImages             = new PaletteRibbonImages(redirect, NeedPaintDelegate);
        }
Ejemplo n.º 17
0
 /// <summary>
 /// Initialize a new instance of the PaletteDoubleRedirect class.
 /// </summary>
 /// <param name="redirect">Inheritence redirection instance.</param>
 /// <param name="backStyle">Initial background style.</param>
 /// <param name="borderStyle">Initial border style.</param>
 public PaletteDoubleRedirect(PaletteRedirect redirect,
                              PaletteBackStyle backStyle,
                              PaletteBorderStyle borderStyle)
     : this(redirect, backStyle, borderStyle, null)
 {
 }
 /// <summary>
 /// Initialize a new instance of the PaletteBackInheritRedirect class.
 /// </summary>
 /// <param name="redirect">Source for inherit requests.</param>
 public PaletteBackInheritRedirect(PaletteRedirect redirect)
     : this(redirect, PaletteBackStyle.ButtonStandalone)
 {
 }
 /// <summary>
 /// Initialize a new instance of the PaletteContentInheritRedirect class.
 /// </summary>
 /// <param name="redirect">Source for inherit requests.</param>
 /// <param name="style">Style used in requests.</param>
 public PaletteContentInheritRedirect(PaletteRedirect redirect,
                                      PaletteContentStyle style)
 {
     _redirect = redirect;
     Style     = style;
 }
 /// <summary>
 /// Initialize a new instance of the PaletteBackInheritRedirect class.
 /// </summary>
 /// <param name="redirect">Source for inherit requests.</param>
 /// <param name="style">Style used in requests.</param>
 public PaletteBackInheritRedirect(PaletteRedirect redirect,
                                   PaletteBackStyle style)
 {
     _redirect = redirect;
     Style     = style;
 }
        /// <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();
        }
Ejemplo n.º 22
0
 /// <summary>
 /// Update the redirector with new reference.
 /// </summary>
 /// <param name="redirect">Target redirector.</param>
 public void SetRedirector(PaletteRedirect redirect)
 {
     OverrideFocus.SetRedirector(redirect);
     StateCommon.SetRedirector(redirect);
 }
 /// <summary>
 /// Update the redirector with new reference.
 /// </summary>
 /// <param name="redirect">Target redirector.</param>
 public void SetRedirector(PaletteRedirect redirect)
 {
     _drawRedirect.SetRedirector(redirect);
     _contentInherit.SetRedirector(redirect);
 }
 /// <summary>
 /// Update the redirector with new reference.
 /// </summary>
 /// <param name="redirect">Target redirector.</param>
 public void SetRedirector(PaletteRedirect redirect)
 {
     // Update our cached reference
     _redirect = redirect;
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Update the redirector with new reference.
 /// </summary>
 /// <param name="redirect">Target redirector.</param>
 public void SetRedirector(PaletteRedirect redirect)
 {
     _stateInherit.SetRedirector(redirect);
 }
        /// <summary>
        /// Initialize a new instance of the VisualPanel class.
        /// </summary>
        protected VisualPanel()
        {
            #region Default ControlStyle Values
            // Default style values for Control are:-
            //    True  - AllPaintingInWmPaint
            //    False - CacheText
            //    False - ContainerControl
            //    False - EnableNotifyMessage
            //    False - FixedHeight
            //    False - FixedWidth
            //    False - Opaque
            //    False - OptimizedDoubleBuffer
            //    False - ResizeRedraw
            //    True  - Selectable
            //    True  - StandardClick
            //    True  - StandardDoubleClick
            //    False - SupportsTransparentBackColor
            //    False - UserMouse
            //    True  - UserPaint
            //    True  - UseTextForAccessibility
            #endregion

            // We use double buffering to reduce drawing flicker
            SetStyle(ControlStyles.OptimizedDoubleBuffer |
                     ControlStyles.AllPaintingInWmPaint |
                     ControlStyles.UserPaint, true);

            // We need to allow a transparent background
            SetStyle(ControlStyles.SupportsTransparentBackColor, true);

            // We need to repaint entire control whenever resized
            SetStyle(ControlStyles.ResizeRedraw, true);

            // We act as a container for child controls
            SetStyle(ControlStyles.ContainerControl, true);

            // Cannot select a panel
            SetStyle(ControlStyles.Selectable, false);

            // Yes, we want to be drawn double buffered by default
            DoubleBuffered = true;

            // Setup the invoke used to refresh display
            _refreshCall = OnPerformRefresh;

            // Setup the need paint delegate
            NeedPaintDelegate = OnNeedPaint;

            // Must layout before first draw attempt
            _layoutDirty     = true;
            _evalTransparent = true;
            _lastLayoutSize  = Size.Empty;

            // Set the palette to the defaults as specified by the manager
            _localPalette = null;
            SetPalette(KryptonManager.CurrentGlobalPalette);
            _paletteMode = PaletteMode.Global;

            // Create constant target for resolving palette delegates
            Redirector = new PaletteRedirect(_palette);

            AttachGlobalEvents();
        }
Ejemplo n.º 27
0
 /// <summary>
 /// Update the redirector with new reference.
 /// </summary>
 /// <param name="redirect">Target redirector.</param>
 public override void SetRedirector(PaletteRedirect redirect)
 {
     base.SetRedirector(redirect);
     _ribbonTabInherit.SetRedirector(redirect);
 }
Ejemplo n.º 28
0
 /// <summary>
 /// Update the redirector with new reference.
 /// </summary>
 /// <param name="redirect">Target redirector.</param>
 public override void SetRedirector(PaletteRedirect redirect)
 {
     base.SetRedirector(redirect);
     _redirect = redirect;
 }
        /// <summary>
        /// Initialize a new instance of the ViewDrawMonth class.
        /// </summary>
        /// <param name="calendar">Reference to calendar provider.</param>
        /// <param name="months">Reference to months instance.</param>
        /// <param name="redirector">Redirector for getting values.</param>
        /// <param name="needPaintDelegate">Delegate for requesting paint changes.</param>
        public ViewDrawMonth(IKryptonMonthCalendar calendar,
                             ViewLayoutMonths months,
                             PaletteRedirect redirector,
                             NeedPaintHandler needPaintDelegate)
            : base(false)
        {
            _calendar = calendar;
            _months   = months;

            // Add a header for showing the month/year value
            _drawContent  = new ViewDrawContent(_calendar.StateNormal.Header.Content, this, VisualOrientation.Top);
            _borderForced = new PaletteBorderInheritForced(_calendar.StateNormal.Header.Border);
            _borderForced.ForceBorderEdges(PaletteDrawBorders.None);
            _drawHeader = new ViewDrawDocker(_calendar.StateNormal.Header.Back, _borderForced, null)
            {
                { _drawContent, ViewDockStyle.Fill }
            };
            Add(_drawHeader);

            // Create the left/right arrows for moving the months
            _arrowPrev        = new ButtonSpecCalendar(this, PaletteButtonSpecStyle.Previous, RelativeEdgeAlign.Near);
            _arrowNext        = new ButtonSpecCalendar(this, PaletteButtonSpecStyle.Next, RelativeEdgeAlign.Far);
            _arrowPrev.Click += OnPrevMonth;
            _arrowNext.Click += OnNextMonth;
            _buttonSpecs      = new CalendarButtonSpecCollection(this)
            {
                _arrowPrev,
                _arrowNext
            };

            // Using a button spec manager to add the buttons to the header
            _buttonManager = new ButtonSpecManagerDraw(_calendar.CalendarControl, redirector, null, _buttonSpecs,
                                                       new ViewDrawDocker[] { _drawHeader },
                                                       new IPaletteMetric[] { _calendar.StateCommon },
                                                       new PaletteMetricInt[] { PaletteMetricInt.HeaderButtonEdgeInsetCalendar },
                                                       new PaletteMetricPadding[] { PaletteMetricPadding.None },
                                                       _calendar.GetToolStripDelegate, needPaintDelegate);

            // Create stacks for holding display items
            ViewLayoutStack namesStack = new ViewLayoutStack(true);
            ViewLayoutStack weeksStack = new ViewLayoutStack(true);
            ViewLayoutStack daysStack  = new ViewLayoutStack(false);

            _numberStack = new ViewLayoutStack(false);
            weeksStack.Add(_numberStack);
            weeksStack.Add(daysStack);

            // Add day names
            _drawMonthDayNames = new ViewDrawMonthDayNames(_calendar, _months);
            _drawWeekCorner    = new ViewLayoutWeekCorner(_calendar, _months, _calendar.StateNormal.Header.Border);
            namesStack.Add(_drawWeekCorner);
            namesStack.Add(_drawMonthDayNames);
            Add(namesStack);
            Add(weeksStack);

            // Add border between week numbers and days area
            _borderEdgeRedirect = new PaletteBorderEdgeRedirect(_calendar.StateNormal.Header.Border, null);
            _borderEdge         = new PaletteBorderEdge(_borderEdgeRedirect, null);
            _drawBorderEdge     = new ViewDrawBorderEdge(_borderEdge, Orientation.Vertical);
            _drawWeekNumbers    = new ViewDrawWeekNumbers(_calendar, _months);
            ViewLayoutDocker borderLeftDock = new ViewLayoutDocker
            {
                { _drawWeekNumbers, ViewDockStyle.Left },
                { new ViewLayoutSeparator(0, 4), ViewDockStyle.Top },
                { _drawBorderEdge, ViewDockStyle.Fill },
                { new ViewLayoutSeparator(0, 4), ViewDockStyle.Bottom }
            };

            _numberStack.Add(borderLeftDock);

            // Add border between day names and individual days
            PaletteBorderEdgeRedirect borderEdgeRedirect = new PaletteBorderEdgeRedirect(_calendar.StateNormal.Header.Border, null);
            PaletteBorderEdge         borderEdge         = new PaletteBorderEdge(borderEdgeRedirect, null);
            ViewDrawBorderEdge        drawBorderEdge     = new ViewDrawBorderEdge(borderEdge, Orientation.Horizontal);
            ViewLayoutDocker          borderTopDock      = new ViewLayoutDocker
            {
                { new ViewLayoutSeparator(4, 1), ViewDockStyle.Left },
                { drawBorderEdge, ViewDockStyle.Fill },
                { new ViewLayoutSeparator(4, 1), ViewDockStyle.Right },
                { new ViewLayoutSeparator(1, 3), ViewDockStyle.Bottom }
            };

            daysStack.Add(borderTopDock);

            // Add the actual individual days
            ViewDrawMonthDays = new ViewDrawMonthDays(_calendar, _months);
            daysStack.Add(ViewDrawMonthDays);

            // Adding buttons manually means we have to ask for buttons to be created
            _buttonManager.RecreateButtons();
        }
        public static void InitColors()
        {
            // add Palette Handler
            if (_palette != null)
            {
                _palette.PalettePaint += new EventHandler <PaletteLayoutEventArgs>(OnPalettePaint);
            }

            KryptonManager.GlobalPaletteChanged += new EventHandler(OnGlobalPaletteChanged);

            _palette         = KryptonManager.CurrentGlobalPalette;
            _paletteRedirect = new PaletteRedirect(_palette);

            //Init Colors
            // hot state
            thumbColours[0, 0] = Color.FromArgb(96, 111, 148);  // border color
            thumbColours[0, 1] = Color.FromArgb(232, 233, 233); // left/top start color
            thumbColours[0, 2] = Color.FromArgb(230, 233, 241); // left/top end color
            thumbColours[0, 3] = Color.FromArgb(233, 237, 242); // right/bottom line color
            thumbColours[0, 4] = Color.FromArgb(209, 218, 228); // right/bottom start color
            thumbColours[0, 5] = Color.FromArgb(218, 227, 235); // right/bottom end color
            thumbColours[0, 6] = Color.FromArgb(190, 202, 219); // right/bottom middle color
            thumbColours[0, 7] = Color.FromArgb(96, 11, 148);   // left/top line color

            // over state
            thumbColours[1, 0] = Color.FromArgb(60, 110, 176);
            thumbColours[1, 1] = Color.FromArgb(187, 204, 228);
            thumbColours[1, 2] = Color.FromArgb(205, 227, 254);
            thumbColours[1, 3] = Color.FromArgb(252, 253, 255);
            thumbColours[1, 4] = Color.FromArgb(170, 207, 247);
            thumbColours[1, 5] = Color.FromArgb(219, 232, 251);
            thumbColours[1, 6] = Color.FromArgb(190, 202, 219);
            thumbColours[1, 7] = Color.FromArgb(233, 233, 235);

            // pressed state
            thumbColours[2, 0] = Color.FromArgb(23, 73, 138);
            thumbColours[2, 1] = Color.FromArgb(154, 184, 225);
            thumbColours[2, 2] = Color.FromArgb(166, 202, 250);
            thumbColours[2, 3] = Color.FromArgb(221, 235, 251);
            thumbColours[2, 4] = Color.FromArgb(110, 166, 240);
            thumbColours[2, 5] = Color.FromArgb(194, 218, 248);
            thumbColours[2, 6] = Color.FromArgb(190, 202, 219);
            thumbColours[2, 7] = Color.FromArgb(194, 211, 231);

            /* picture of colors and indices
             *(0,0)
             * -----------------------------------------------
             * |                                             |
             * | |-----------------------------------------| |
             * | |                  (2)                    | |
             * | | |-------------------------------------| | |
             * | | |                (0)                  | | |
             * | | |                                     | | |
             * | | |                                     | | |
             * | |3|                (1)                  |3| |
             * | |6|                (4)                  |6| |
             * | | |                                     | | |
             * | | |                (5)                  | | |
             * | | |-------------------------------------| | |
             * | |                  (12)                   | |
             * | |-----------------------------------------| |
             * |                                             |
             * ----------------------------------------------- (15,17)
             */

            // hot state
            arrowColours[0, 0] = Color.FromArgb(223, 236, 252);
            arrowColours[0, 1] = Color.FromArgb(207, 225, 248);
            arrowColours[0, 2] = Color.FromArgb(245, 249, 255);
            arrowColours[0, 3] = Color.FromArgb(237, 244, 252);
            arrowColours[0, 4] = Color.FromArgb(244, 249, 255);
            arrowColours[0, 5] = Color.FromArgb(244, 249, 255);
            arrowColours[0, 6] = Color.FromArgb(251, 253, 255);
            arrowColours[0, 7] = Color.FromArgb(251, 253, 255);

            // over state
            arrowColours[1, 0] = Color.FromArgb(205, 222, 243); //Colore bottone sul tracking
            arrowColours[1, 1] = Color.FromArgb(186, 208, 235);
            arrowColours[1, 2] = Color.FromArgb(238, 244, 252);
            arrowColours[1, 3] = Color.FromArgb(229, 237, 247);
            arrowColours[1, 4] = Color.FromArgb(223, 234, 247);
            arrowColours[1, 5] = Color.FromArgb(241, 246, 254);
            arrowColours[1, 6] = Color.FromArgb(243, 247, 252);
            arrowColours[1, 7] = Color.FromArgb(250, 252, 255);

            // pressed state
            arrowColours[2, 0] = Color.FromArgb(215, 220, 225);
            arrowColours[2, 1] = Color.FromArgb(195, 202, 210);
            arrowColours[2, 2] = Color.FromArgb(242, 244, 245);
            arrowColours[2, 3] = Color.FromArgb(232, 235, 238);
            arrowColours[2, 4] = Color.FromArgb(226, 228, 230);
            arrowColours[2, 5] = Color.FromArgb(230, 233, 236);
            arrowColours[2, 6] = Color.FromArgb(244, 245, 245);
            arrowColours[2, 7] = Color.FromArgb(245, 247, 248);

            // background colors
            backgroundColours[0] = Color.FromArgb(235, 237, 239);
            backgroundColours[1] = Color.FromArgb(252, 252, 252);
            backgroundColours[2] = Color.FromArgb(247, 247, 247);
            backgroundColours[3] = Color.FromArgb(238, 238, 238);
            backgroundColours[4] = Color.FromArgb(240, 240, 240);

            // track colors
            trackColours[0] = Color.FromArgb(204, 204, 204);
            trackColours[1] = Color.FromArgb(220, 220, 220);

            // arrow border colors
            arrowBorderColours[0] = Color.FromArgb(135, 146, 160);
            arrowBorderColours[1] = Color.FromArgb(140, 151, 165);
            arrowBorderColours[2] = Color.FromArgb(128, 139, 153);
            arrowBorderColours[3] = Color.FromArgb(99, 110, 125);

            //Border colors
            borderColours[0] = _palette.GetBorderColor1(PaletteBorderStyle.InputControlCustom1, PaletteState.Normal);
            borderColours[1] = _palette.GetBorderColor1(PaletteBorderStyle.InputControlCustom1, PaletteState.Normal);;

            //Grip colors
            gripColours[0] = _palette.ColorTable.GripLight;
            gripColours[1] = _palette.ColorTable.GripDark;
        }