Exemplo n.º 1
0
        /// <summary>
        /// Initialize a new instance of the KryptonPaletteTabButtons class.
        /// </summary>
        /// <param name="redirector">Palette redirector for sourcing inherited values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        internal KryptonPaletteTabButtons(PaletteRedirect redirector,
                                          NeedPaintHandler needPaint)
        {
            Debug.Assert(redirector != null);

            // Create the button style specific and common palettes
            TabCommon          = new KryptonPaletteTabButton(redirector, PaletteBackStyle.TabHighProfile, PaletteBorderStyle.TabHighProfile, PaletteContentStyle.TabHighProfile, needPaint);
            TabHighProfile     = new KryptonPaletteTabButton(redirector, PaletteBackStyle.TabHighProfile, PaletteBorderStyle.TabHighProfile, PaletteContentStyle.TabHighProfile, needPaint);
            TabStandardProfile = new KryptonPaletteTabButton(redirector, PaletteBackStyle.TabStandardProfile, PaletteBorderStyle.TabStandardProfile, PaletteContentStyle.TabStandardProfile, needPaint);
            TabLowProfile      = new KryptonPaletteTabButton(redirector, PaletteBackStyle.TabLowProfile, PaletteBorderStyle.TabLowProfile, PaletteContentStyle.TabLowProfile, needPaint);
            TabDock            = new KryptonPaletteTabButton(redirector, PaletteBackStyle.TabDock, PaletteBorderStyle.TabDock, PaletteContentStyle.TabDock, needPaint);
            TabDockAutoHidden  = new KryptonPaletteTabButton(redirector, PaletteBackStyle.TabDockAutoHidden, PaletteBorderStyle.TabDockAutoHidden, PaletteContentStyle.TabDockAutoHidden, needPaint);
            TabOneNote         = new KryptonPaletteTabButton(redirector, PaletteBackStyle.TabOneNote, PaletteBorderStyle.TabOneNote, PaletteContentStyle.TabOneNote, needPaint);
            TabCustom1         = new KryptonPaletteTabButton(redirector, PaletteBackStyle.TabCustom1, PaletteBorderStyle.TabCustom1, PaletteContentStyle.TabCustom1, needPaint);
            TabCustom2         = new KryptonPaletteTabButton(redirector, PaletteBackStyle.TabCustom2, PaletteBorderStyle.TabCustom2, PaletteContentStyle.TabCustom2, needPaint);
            TabCustom3         = new KryptonPaletteTabButton(redirector, PaletteBackStyle.TabCustom3, PaletteBorderStyle.TabCustom3, PaletteContentStyle.TabCustom3, needPaint);

            // Create redirectors for inheriting from style specific to style common
            PaletteRedirectTriple redirectCommon = new PaletteRedirectTriple(redirector,
                                                                             TabCommon.StateDisabled, TabCommon.StateNormal,
                                                                             TabCommon.StatePressed, TabCommon.StateTracking,
                                                                             TabCommon.StateSelected, TabCommon.OverrideFocus);

            // Inform the button style to use the new redirector
            TabHighProfile.SetRedirector(redirectCommon);
            TabStandardProfile.SetRedirector(redirectCommon);
            TabLowProfile.SetRedirector(redirectCommon);
            TabDock.SetRedirector(redirectCommon);
            TabDockAutoHidden.SetRedirector(redirectCommon);
            TabOneNote.SetRedirector(redirectCommon);
            TabCustom1.SetRedirector(redirectCommon);
            TabCustom2.SetRedirector(redirectCommon);
            TabCustom3.SetRedirector(redirectCommon);
        }
        /// <summary>
        /// Initialize a new instance of the KryptonPaletteButtons class.
        /// </summary>
        /// <param name="redirector">Palette redirector for sourcing inherited values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        internal KryptonPaletteCheckButtons(PaletteRedirect redirector,
                                            NeedPaintHandler needPaint)
        {
            Debug.Assert(redirector != null);

            // Create the button style specific and common palettes
            ButtonCommon            = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonStandalone, PaletteBorderStyle.ButtonStandalone, PaletteContentStyle.ButtonStandalone, needPaint);
            ButtonStandalone        = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonStandalone, PaletteBorderStyle.ButtonStandalone, PaletteContentStyle.ButtonStandalone, needPaint);
            ButtonAlternate         = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonAlternate, PaletteBorderStyle.ButtonAlternate, PaletteContentStyle.ButtonAlternate, needPaint);
            ButtonLowProfile        = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonLowProfile, PaletteBorderStyle.ButtonLowProfile, PaletteContentStyle.ButtonLowProfile, needPaint);
            ButtonButtonSpec        = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonButtonSpec, PaletteBorderStyle.ButtonButtonSpec, PaletteContentStyle.ButtonButtonSpec, needPaint);
            ButtonBreadCrumb        = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonBreadCrumb, PaletteBorderStyle.ButtonBreadCrumb, PaletteContentStyle.ButtonBreadCrumb, needPaint);
            ButtonCalendarDay       = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonCalendarDay, PaletteBorderStyle.ButtonCalendarDay, PaletteContentStyle.ButtonCalendarDay, needPaint);
            ButtonCluster           = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonCluster, PaletteBorderStyle.ButtonCluster, PaletteContentStyle.ButtonCluster, needPaint);
            ButtonGallery           = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonGallery, PaletteBorderStyle.ButtonGallery, PaletteContentStyle.ButtonGallery, needPaint);
            ButtonNavigatorStack    = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonNavigatorStack, PaletteBorderStyle.ButtonNavigatorStack, PaletteContentStyle.ButtonNavigatorStack, needPaint);
            ButtonNavigatorOverflow = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonNavigatorOverflow, PaletteBorderStyle.ButtonNavigatorOverflow, PaletteContentStyle.ButtonNavigatorOverflow, needPaint);
            ButtonNavigatorMini     = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonNavigatorMini, PaletteBorderStyle.ButtonNavigatorMini, PaletteContentStyle.ButtonNavigatorMini, needPaint);
            ButtonInputControl      = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonInputControl, PaletteBorderStyle.ButtonInputControl, PaletteContentStyle.ButtonInputControl, needPaint);
            ButtonListItem          = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonListItem, PaletteBorderStyle.ButtonListItem, PaletteContentStyle.ButtonListItem, needPaint);
            ButtonForm      = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonForm, PaletteBorderStyle.ButtonForm, PaletteContentStyle.ButtonForm, needPaint);
            ButtonFormClose = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonFormClose, PaletteBorderStyle.ButtonFormClose, PaletteContentStyle.ButtonFormClose, needPaint);
            ButtonCommand   = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonCommand, PaletteBorderStyle.ButtonCommand, PaletteContentStyle.ButtonCommand, needPaint);
            ButtonCustom1   = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonCustom1, PaletteBorderStyle.ButtonCustom1, PaletteContentStyle.ButtonCustom1, needPaint);
            ButtonCustom2   = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonCustom2, PaletteBorderStyle.ButtonCustom2, PaletteContentStyle.ButtonCustom2, needPaint);
            ButtonCustom3   = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonCustom3, PaletteBorderStyle.ButtonCustom3, PaletteContentStyle.ButtonCustom3, needPaint);

            // Create redirectors for inheriting from style specific to style common
            PaletteRedirectTriple redirectCommon = new PaletteRedirectTriple(redirector,
                                                                             ButtonCommon.StateDisabled, ButtonCommon.StateNormal,
                                                                             ButtonCommon.StatePressed, ButtonCommon.StateTracking,
                                                                             ButtonCommon.StateCheckedNormal, ButtonCommon.StateCheckedPressed,
                                                                             ButtonCommon.StateCheckedTracking, ButtonCommon.OverrideFocus,
                                                                             ButtonCommon.OverrideDefault);

            // Inform the button style to use the new redirector
            ButtonStandalone.SetRedirector(redirectCommon);
            ButtonAlternate.SetRedirector(redirectCommon);
            ButtonLowProfile.SetRedirector(redirectCommon);
            ButtonButtonSpec.SetRedirector(redirectCommon);
            ButtonBreadCrumb.SetRedirector(redirectCommon);
            ButtonCalendarDay.SetRedirector(redirectCommon);
            ButtonCluster.SetRedirector(redirectCommon);
            ButtonGallery.SetRedirector(redirectCommon);
            ButtonNavigatorStack.SetRedirector(redirectCommon);
            ButtonNavigatorOverflow.SetRedirector(redirectCommon);
            ButtonNavigatorMini.SetRedirector(redirectCommon);
            ButtonInputControl.SetRedirector(redirectCommon);
            ButtonListItem.SetRedirector(redirectCommon);
            ButtonForm.SetRedirector(redirectCommon);
            ButtonFormClose.SetRedirector(redirectCommon);
            ButtonCommand.SetRedirector(redirectCommon);
            ButtonCustom1.SetRedirector(redirectCommon);
            ButtonCustom2.SetRedirector(redirectCommon);
            ButtonCustom3.SetRedirector(redirectCommon);
        }
        /// <summary>
        /// Initialize a new instance of the PaletteContextMenuItemStateRedirect class.
        /// </summary>
        public PaletteContextMenuItemStateRedirect()
        {
            _itemHighlight    = new PaletteRedirectDouble();
            _itemImage        = new PaletteRedirectTriple();
            _itemShortcutText = new PaletteRedirectContent();
            _itemSplit        = new PaletteRedirectDouble();
            _itemStandard     = new PaletteRedirectContent();
            _itemAlternate    = new PaletteRedirectContent();

            _redirectItemHighlight     = new PaletteDoubleMetricRedirect(_itemHighlight, PaletteBackStyle.ContextMenuItemHighlight, PaletteBorderStyle.ContextMenuItemHighlight);
            _redirectItemImage         = new PaletteTripleJustImageRedirect(_itemImage, PaletteBackStyle.ContextMenuItemImage, PaletteBorderStyle.ContextMenuItemImage, PaletteContentStyle.ContextMenuItemImage);
            _redirectItemShortcutText  = new PaletteContentInheritRedirect(_itemShortcutText, PaletteContentStyle.ContextMenuItemShortcutText);
            _redirectItemSplit         = new PaletteDoubleRedirect(_itemSplit, PaletteBackStyle.ContextMenuSeparator, PaletteBorderStyle.ContextMenuSeparator);
            _redirectItemTextStandard  = new PaletteContentInheritRedirect(_itemStandard, PaletteContentStyle.ContextMenuItemTextStandard);
            _redirectItemTextAlternate = new PaletteContentInheritRedirect(_itemAlternate, PaletteContentStyle.ContextMenuItemTextAlternate);
        }
        /// <summary>
        /// Initialize a new instance of the KryptonContextMenuHeading class.
        /// </summary>
        /// <param name="initialText">Initial text for display.</param>
        public KryptonContextMenuHeading(string initialText)
        {
            // Default fields
            _text                  = initialText;
            _extraText             = string.Empty;
            _image                 = null;
            _imageTransparentColor = Color.Empty;

            // Create the redirector that can get values from the krypton context menu
            _redirectHeading = new PaletteRedirectTriple();

            // Create the header storage for overriding specific values
            StateNormal = new PaletteTripleRedirect(_redirectHeading,
                                                    PaletteBackStyle.ContextMenuHeading,
                                                    PaletteBorderStyle.ContextMenuHeading,
                                                    PaletteContentStyle.ContextMenuHeading);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Initialize a new instance of the KryptonPaletteInputControls class.
        /// </summary>
        /// <param name="redirector">Palette redirector for sourcing inherited values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        internal KryptonPaletteInputControls(PaletteRedirect redirector,
                                             NeedPaintHandler needPaint)
        {
            Debug.Assert(redirector != null);

            // Create the input control style specific and common palettes
            InputControlCommon     = new KryptonPaletteInputControl(redirector, PaletteBackStyle.InputControlStandalone, PaletteBorderStyle.InputControlStandalone, PaletteContentStyle.InputControlStandalone, needPaint);
            InputControlStandalone = new KryptonPaletteInputControl(redirector, PaletteBackStyle.InputControlStandalone, PaletteBorderStyle.InputControlStandalone, PaletteContentStyle.InputControlStandalone, needPaint);
            InputControlRibbon     = new KryptonPaletteInputControl(redirector, PaletteBackStyle.InputControlRibbon, PaletteBorderStyle.InputControlRibbon, PaletteContentStyle.InputControlRibbon, needPaint);
            InputControlCustom1    = new KryptonPaletteInputControl(redirector, PaletteBackStyle.InputControlCustom1, PaletteBorderStyle.InputControlCustom1, PaletteContentStyle.InputControlCustom1, needPaint);

            // Create redirectors for inheriting from style specific to style common
            PaletteRedirectTriple redirectCommon = new PaletteRedirectTriple(redirector, InputControlCommon.StateDisabled, InputControlCommon.StateNormal, InputControlCommon.StateActive);

            // Inform the input control style to use the new redirector
            InputControlStandalone.SetRedirector(redirectCommon);
            InputControlRibbon.SetRedirector(redirectCommon);
            InputControlCustom1.SetRedirector(redirectCommon);
        }