/// <summary> /// Initialize a new instance of the KryptonGroup class. /// </summary> public KryptonGroup() { SetStyle(ControlStyles.SupportsTransparentBackColor | ControlStyles.OptimizedDoubleBuffer, true); // Create the palette storage StateCommon = new PaletteDoubleRedirect(Redirector, PaletteBackStyle.ControlClient, PaletteBorderStyle.ControlClient, NeedPaintDelegate); StateDisabled = new PaletteDouble(StateCommon, NeedPaintDelegate); StateNormal = new PaletteDouble(StateCommon, NeedPaintDelegate); // Create the internal panel used for containing content Panel = new KryptonGroupPanel(this, StateCommon, StateDisabled, StateNormal, OnGroupPanelPaint) { // Make sure the panel back style always mimics our back style PanelBackStyle = PaletteBackStyle.ControlClient }; // Create the element that fills the remainder space and remembers fill rectangle _layoutFill = new ViewLayoutFill(Panel); // Create view for the control border and background _drawDocker = new ViewDrawDocker(StateNormal.Back, StateNormal.Border) { { _layoutFill, ViewDockStyle.Fill } }; // Create the view manager instance ViewManager = new ViewManager(this, _drawDocker); // We want to default to shrinking and growing (base class defaults to GrowOnly) AutoSizeMode = AutoSizeMode.GrowAndShrink; // Add panel to the controls collection ((KryptonReadOnlyControls)Controls).AddInternal(Panel); }
/// <summary> /// Initialize a new instance of the PaletteComboBoxRedirect class. /// </summary> /// <param name="redirect">Inheritence redirection instance.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteComboBoxRedirect(PaletteRedirect redirect, NeedPaintHandler needPaint) { Debug.Assert(redirect != null); // Store the provided paint notification delegate NeedPaint = needPaint; // Create storage that maps onto the inherit instances _itemRedirect = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonListItem, PaletteBorderStyle.ButtonListItem, PaletteContentStyle.ButtonListItem, NeedPaint); _comboBoxRedirect = new PaletteInputControlTripleRedirect(redirect, PaletteBackStyle.InputControlStandalone, PaletteBorderStyle.InputControlStandalone, PaletteContentStyle.InputControlStandalone, NeedPaint); _dropBackRedirect = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ControlClient, PaletteBorderStyle.ButtonStandalone, NeedPaint); }
/// <summary> /// Initialize a new instance of the KryptonGroup class. /// </summary> public KryptonGroup() { // Create the palette storage _stateCommon = new PaletteDoubleRedirect(Redirector, PaletteBackStyle.ControlClient, PaletteBorderStyle.ControlClient, NeedPaintDelegate); _stateDisabled = new PaletteDouble(_stateCommon, NeedPaintDelegate); _stateNormal = new PaletteDouble(_stateCommon, NeedPaintDelegate); // Create the internal panel used for containing content _panel = new KryptonGroupPanel(this, _stateCommon, _stateDisabled, _stateNormal, new NeedPaintHandler(OnGroupPanelPaint)); // Make sure the panel back style always mimics our back style _panel.PanelBackStyle = PaletteBackStyle.ControlClient; // Create the element that fills the remainder space and remembers fill rectange _layoutFill = new ViewLayoutFill(_panel); // Create view for the control border and background _drawDocker = new ViewDrawDocker(_stateNormal.Back, _stateNormal.Border); _drawDocker.Add(_layoutFill, ViewDockStyle.Fill); // Create the view manager instance ViewManager = new ViewManager(this, _drawDocker); // We want to default to shrinking and growing (base class defaults to GrowOnly) AutoSizeMode = AutoSizeMode.GrowAndShrink; // Add panel to the controls collection ((KryptonReadOnlyControls)Controls).AddInternal(_panel); }
/// <summary> /// Initialize a new instance of the PaletteComboBoxRedirect class. /// </summary> /// <param name="redirect">inheritance redirection instance.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteComboBoxRedirect(PaletteRedirect redirect, NeedPaintHandler needPaint) { Debug.Assert(redirect != null); // Store the provided paint notification delegate NeedPaint = needPaint; // Create storage that maps onto the inherit instances Item = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonListItem, PaletteBorderStyle.ButtonListItem, PaletteContentStyle.ButtonListItem, NeedPaint); ComboBox = new PaletteInputControlTripleRedirect(redirect, PaletteBackStyle.InputControlStandalone, PaletteBorderStyle.InputControlStandalone, PaletteContentStyle.InputControlStandalone, NeedPaint) { Content = { // Set directly to prevent a Paint redirect _shortTextH = PaletteRelativeAlign.Near } }; _dropBackRedirect = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ControlClient, PaletteBorderStyle.ButtonStandalone, NeedPaint); }
/// <summary> /// Initialize a new instance of the KryptonGroupPanel class. /// </summary> /// <param name="alignControl">Container control for alignment.</param> /// <param name="stateCommon">Common appearance state to inherit from.</param> /// <param name="stateDisabled">Disabled appearance state.</param> /// <param name="stateNormal">Normal appearance state.</param> /// <param name="layoutHandler">Callback delegate for layout processing.</param> public KryptonGroupBoxPanel(Control alignControl, PaletteDoubleRedirect stateCommon, PaletteDouble stateDisabled, PaletteDouble stateNormal, NeedPaintHandler layoutHandler) : base(alignControl, stateCommon, stateDisabled, stateNormal, layoutHandler) { }
/// <summary> /// Initialize a new instance of the KryptonPanel class. /// </summary> public KryptonPanel() { // Create the palette storage _stateCommon = new PaletteDoubleRedirect(Redirector, PaletteBackStyle.PanelClient, PaletteBorderStyle.ControlClient, NeedPaintDelegate); _stateDisabled = new PaletteDouble(_stateCommon, NeedPaintDelegate); _stateNormal = new PaletteDouble(_stateCommon, NeedPaintDelegate); Construct(); }
/// <summary> /// Initialize a new instance of the ViewDrawMenuImageColumn class. /// </summary> /// <param name="items">Reference to the owning collection.</param> /// <param name="palette">Palette for obtaining drawing values.</param> public ViewDrawMenuImageColumn(KryptonContextMenuItems items, PaletteDoubleRedirect palette) : base(items.StateNormal.Back, items.StateNormal.Border) { // Give the items collection the redirector to use when inheriting values items.SetPaletteRedirect(palette); _separator = new ViewLayoutSeparator(0); Add(_separator); }
/// <summary> /// Initialize a new instance of KryptonPaletteDouble3 KryptonPaletteControl class. /// </summary> /// <param name="redirect">Redirector to inherit values from.</param> /// <param name="backStyle">Background style.</param> /// <param name="borderStyle">Border style.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public KryptonPaletteDouble3(PaletteRedirect redirect, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, NeedPaintHandler needPaint) { // Create the storage objects _stateCommon = new PaletteDoubleRedirect(redirect, backStyle, borderStyle, needPaint); _stateDisabled = new PaletteDouble(_stateCommon, needPaint); _stateNormal = new PaletteDouble(_stateCommon, needPaint); }
/// <summary> /// Initialize a new instance of KryptonPaletteDouble3 KryptonPaletteControl class. /// </summary> /// <param name="redirect">Redirector to inherit values from.</param> /// <param name="backStyle">Background style.</param> /// <param name="borderStyle">Border style.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> protected KryptonPaletteDouble3(PaletteRedirect redirect, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, NeedPaintHandler needPaint) { // Create the storage objects _stateCommon = new PaletteDoubleRedirect(redirect, backStyle, borderStyle, needPaint); _stateDisabled = new PaletteDouble(_stateCommon, needPaint); _stateNormal = new PaletteDouble(_stateCommon, needPaint); }
/// <summary> /// Initialize a new instance of the KryptonPanel class. /// </summary> public KryptonPanel() { SetStyle(ControlStyles.SupportsTransparentBackColor | ControlStyles.OptimizedDoubleBuffer, true); // Create the palette storage _stateCommon = new PaletteDoubleRedirect(Redirector, PaletteBackStyle.PanelClient, PaletteBorderStyle.ControlClient, NeedPaintDelegate); _stateDisabled = new PaletteDouble(_stateCommon, NeedPaintDelegate); _stateNormal = new PaletteDouble(_stateCommon, NeedPaintDelegate); Construct(); }
/// <summary> /// Initialize a new instance of the KryptonContextMenuSeparator class. /// </summary> public KryptonContextMenuSeparator() { // Default fields _horizontal = true; // Create the redirector that can get values from the krypton context menu _redirectSeparator = new PaletteRedirectDouble(); // Create the separator storage for overriding specific values _stateNormal = new PaletteDoubleRedirect(_redirectSeparator, PaletteBackStyle.ContextMenuSeparator, PaletteBorderStyle.ContextMenuSeparator); }
/// <summary> /// Initialize a new instance of the KryptonContextMenuSeparator class. /// </summary> public KryptonContextMenuSeparator() { // Default fields _horizontal = true; // Create the redirector that can get values from the krypton context menu _redirectSeparator = new PaletteRedirectDouble(); // Create the separator storage for overriding specific values StateNormal = new PaletteDoubleRedirect(_redirectSeparator, PaletteBackStyle.ContextMenuSeparator, PaletteBorderStyle.ContextMenuSeparator); }
/// <summary> /// Initialize a new instance of the PaletteContextMenuItemState class. /// </summary> /// <param name="redirectItemHighlight">Redirector for ItemHighlight.</param> /// <param name="redirectItemImage">Redirector for ItemImage.</param> /// <param name="redirectItemShortcutText">Redirector for ItemShortcutText.</param> /// <param name="redirectItemSplit">Redirector for ItemSplit.</param> /// <param name="redirectItemTextAlternate">Redirector for ItemTextStandard.</param> /// <param name="redirectItemTextStandard">Redirector for ItemTextAlternate.</param> public PaletteContextMenuItemState(PaletteDoubleMetricRedirect redirectItemHighlight, PaletteTripleJustImageRedirect redirectItemImage, PaletteContentInheritRedirect redirectItemShortcutText, PaletteDoubleRedirect redirectItemSplit, PaletteContentInheritRedirect redirectItemTextStandard, PaletteContentInheritRedirect redirectItemTextAlternate) { ItemHighlight = new PaletteDoubleMetric(redirectItemHighlight); ItemImage = new PaletteTripleJustImage(redirectItemImage); ItemShortcutText = new PaletteContentJustShortText(redirectItemShortcutText); ItemSplit = new PaletteDouble(redirectItemSplit); ItemTextStandard = new PaletteContentJustText(redirectItemTextStandard); ItemTextAlternate = new PaletteContentJustText(redirectItemTextAlternate); }
/// <summary> /// Initialize a new instance of the PaletteDataGridViewRedirect class. /// </summary> /// <param name="redirect">Source for inheriting values.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteDataGridViewRedirect(PaletteRedirect redirect, NeedPaintHandler needPaint) { Debug.Assert(redirect != null); // Store the provided paint notification delegate NeedPaint = needPaint; // Create storage that maps onto the inherit instances _background = new PaletteDoubleRedirect(redirect, PaletteBackStyle.GridBackgroundList, PaletteBorderStyle.GridDataCellList, needPaint); _dataCell = new PaletteDataGridViewTripleRedirect(redirect, PaletteBackStyle.GridDataCellList, PaletteBorderStyle.GridDataCellList, PaletteContentStyle.GridDataCellList, needPaint); _headerColumn = new PaletteDataGridViewTripleRedirect(redirect, PaletteBackStyle.GridHeaderColumnList, PaletteBorderStyle.GridHeaderColumnList, PaletteContentStyle.GridHeaderColumnList, needPaint); _headerRow = new PaletteDataGridViewTripleRedirect(redirect, PaletteBackStyle.GridHeaderRowList, PaletteBorderStyle.GridHeaderRowList, PaletteContentStyle.GridHeaderRowList, needPaint); }
/// <summary> /// Initialize a new instance of the PaletteContextMenuItemState class. /// </summary> /// <param name="redirectItemHighlight">Redirector for ItemHighlight.</param> /// <param name="redirectItemImage">Redirector for ItemImage.</param> /// <param name="redirectItemShortcutText">Redirector for ItemShortcutText.</param> /// <param name="redirectItemSplit">Redirector for ItemSplit.</param> /// <param name="redirectItemTextAlternate">Redirector for ItemTextStandard.</param> /// <param name="redirectItemTextStandard">Redirector for ItemTextAlternate.</param> public PaletteContextMenuItemState(PaletteDoubleMetricRedirect redirectItemHighlight, PaletteTripleJustImageRedirect redirectItemImage, PaletteContentInheritRedirect redirectItemShortcutText, PaletteDoubleRedirect redirectItemSplit, PaletteContentInheritRedirect redirectItemTextStandard, PaletteContentInheritRedirect redirectItemTextAlternate) { _paletteItemHighlight = new PaletteDoubleMetric(redirectItemHighlight); _paletteItemImage = new PaletteTripleJustImage(redirectItemImage); _paletteItemShortcutText = new PaletteContentJustShortText(redirectItemShortcutText); _paletteItemSplit = new PaletteDouble(redirectItemSplit); _paletteItemTextStandard = new PaletteContentJustText(redirectItemTextStandard); _paletteItemTextAlternate = new PaletteContentJustText(redirectItemTextAlternate); }
/// <summary> /// Initialize a new instance of the PaletteTrackBarRedirect class. /// </summary> /// <param name="redirect">Inheritence redirection instance.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteTrackBarRedirect(PaletteRedirect redirect, NeedPaintHandler needPaint) { Debug.Assert(redirect != null); // Store the provided paint notification delegate NeedPaint = needPaint; // Create storage that maps onto the inherit instances _backRedirect = new PaletteDoubleRedirect(redirect, PaletteBackStyle.PanelClient, PaletteBorderStyle.ControlClient, NeedPaint); _tickRedirect = new PaletteElementColorRedirect(redirect, PaletteElement.TrackBarTick, NeedPaint); _trackRedirect = new PaletteElementColorRedirect(redirect, PaletteElement.TrackBarTrack, NeedPaint); _positionRedirect = new PaletteElementColorRedirect(redirect, PaletteElement.TrackBarPosition, NeedPaint); }
/// <summary> /// Initialize a new instance of the PaletteTrackBarRedirect class. /// </summary> /// <param name="redirect">inheritance redirection instance.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteTrackBarRedirect(PaletteRedirect redirect, NeedPaintHandler needPaint) { Debug.Assert(redirect != null); // Store the provided paint notification delegate NeedPaint = needPaint; // Create storage that maps onto the inherit instances _backRedirect = new PaletteDoubleRedirect(redirect, PaletteBackStyle.PanelClient, PaletteBorderStyle.ControlClient, NeedPaint); Tick = new PaletteElementColorRedirect(redirect, PaletteElement.TrackBarTick, NeedPaint); Track = new PaletteElementColorRedirect(redirect, PaletteElement.TrackBarTrack, NeedPaint); Position = new PaletteElementColorRedirect(redirect, PaletteElement.TrackBarPosition, NeedPaint); }
private void CreateViewElements() { // Create redirector for the accessing the background palette _redirectCaption = new PaletteDoubleRedirect(_redirect, PaletteBackStyle.HeaderForm, PaletteBorderStyle.HeaderForm, NeedPaintDelegate); // Create a top half for use in KryptonForm and another for use inside this caption area _captionAppButton = new ViewLayoutRibbonAppButton(_ribbon, false); _otherAppButton = new ViewLayoutRibbonAppButton(_ribbon, false); // Connect up the application button controller to the two button elements _appButtonController = new AppButtonController(_ribbon) { Target1 = _captionAppButton.AppButton, Target2 = _otherAppButton.AppButton }; _appButtonController.NeedPaint += new NeedPaintHandler(OnAppButtonNeedPaint); _captionAppButton.MouseController = _appButtonController; _otherAppButton.MouseController = _appButtonController; _appTabController = new AppTabController(_ribbon); _appTabController.NeedPaint += new NeedPaintHandler(OnAppButtonNeedPaint); // When not showing the app button we show this spacer instead _spaceInsteadOfAppButton = new ViewLayoutSeparator(0) { Visible = false }; // Quick access toolbar, minibar versions _captionQAT = new ViewLayoutRibbonQATMini(_ribbon, _needIntegratedDelegate); _nonCaptionQAT = new ViewLayoutRibbonQATMini(_ribbon, NeedPaintDelegate); // Layout needed to position and draw the context titles _contextTiles = new ViewLayoutRibbonContextTitles(_ribbon, this) { ReverseRenderOrder = true }; // Create composition right border and attach to composition area _compRightBorder = new ViewDrawRibbonCompoRightBorder(); _compositionArea.CompRightBorder = _compRightBorder; // Place app button on left side and fill remainder with context titles Add(_contextTiles, ViewDockStyle.Fill); Add(_nonCaptionQAT, ViewDockStyle.Left); Add(_otherAppButton, ViewDockStyle.Left); // Update base class to use correct palette interface base.SetPalettes(_redirectCaption.PaletteBack, _redirectCaption.PaletteBorder); }
/// <summary> /// Initialize a new instance of the KryptonPanel class. /// </summary> /// <param name="stateCommon">Common appearance state to inherit from.</param> /// <param name="stateDisabled">Disabled appearance state.</param> /// <param name="stateNormal">Normal appearance state.</param> public KryptonPanel(PaletteDoubleRedirect stateCommon, PaletteDouble stateDisabled, PaletteDouble stateNormal) { Debug.Assert(stateCommon != null); Debug.Assert(stateDisabled != null); Debug.Assert(stateNormal != null); // Remember the palette storage _stateCommon = stateCommon; _stateDisabled = stateDisabled; _stateNormal = stateNormal; Construct(); }
/// <summary> /// Initialize a new instance of the ViewDrawMenuSeparator class. /// </summary> /// <param name="separator">Reference to owning separator entry.</param> /// <param name="palette">Palette for obtaining drawing values.</param> public ViewDrawMenuSeparator(KryptonContextMenuSeparator separator, PaletteDoubleRedirect palette) : base(separator.StateNormal.Back, separator.StateNormal.Border) { // Draw the separator by default Draw = true; // Give the separator object the redirector to use when inheriting values separator.SetPaletteRedirect(palette); Orientation = separator.Horizontal ? VisualOrientation.Top : VisualOrientation.Left; // We need to be big enough to contain 1 pixel square spacer Add(new ViewLayoutSeparator(1)); }
/// <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 KryptonPanel class. /// </summary> /// <param name="stateCommon">Common appearance state to inherit from.</param> /// <param name="stateDisabled">Disabled appearance state.</param> /// <param name="stateNormal">Normal appearance state.</param> public KryptonPanel(PaletteDoubleRedirect stateCommon, PaletteDouble stateDisabled, PaletteDouble stateNormal) { SetStyle(ControlStyles.SupportsTransparentBackColor | ControlStyles.OptimizedDoubleBuffer, true); Debug.Assert(stateCommon != null); Debug.Assert(stateDisabled != null); Debug.Assert(stateNormal != null); // Remember the palette storage _stateCommon = stateCommon; _stateDisabled = stateDisabled; _stateNormal = stateNormal; Construct(); }
/// <summary> /// Initialize a new instance of the ViewDrawMenuSeparator class. /// </summary> /// <param name="separator">Reference to owning separator entry.</param> /// <param name="palette">Palette for obtaining drawing values.</param> public ViewDrawMenuSeparator(KryptonContextMenuSeparator separator, PaletteDoubleRedirect palette) : base(separator.StateNormal.Back, separator.StateNormal.Border) { // Draw the separator by default _draw = true; // Give the separator object the redirector to use when inheriting values separator.SetPaletteRedirect(palette); if (separator.Horizontal) Orientation = VisualOrientation.Top; else Orientation = VisualOrientation.Left; // We need to be big enough to contain 1 pixel square spacer Add(new ViewLayoutSeparator(1)); }
/// <summary> /// Initialize a new instance of the KryptonContextMenuItems class. /// </summary> /// <param name="children">Array of initial child items.</param> public KryptonContextMenuItems(KryptonContextMenuItemBase[] children) { // Default fields _standardStyle = true; _imageColumn = true; _items = new KryptonContextMenuItemCollection(); // Add any initial set of item if (children != null) _items.AddRange(children); // Create the redirector that can get values from the krypton context menu _redirectImageColumn = new PaletteRedirectDouble(); // Create the column image storage for overriding specific values _stateNormal = new PaletteDoubleRedirect(_redirectImageColumn, PaletteBackStyle.ContextMenuItemImageColumn, PaletteBorderStyle.ContextMenuItemImageColumn); }
/// <summary> /// Initialize a new instance of the PaletteContextMenuRedirect class. /// </summary> /// <param name="redirect">Inheritence redirection.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteContextMenuRedirect(PaletteRedirect redirect, NeedPaintHandler needPaint) { Debug.Assert(redirect != null); // Create the palette storage _paletteControlInner = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ContextMenuInner, PaletteBorderStyle.ContextMenuInner, needPaint); _paletteControlOuter = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ContextMenuOuter, PaletteBorderStyle.ContextMenuOuter, needPaint); _paletteHeading = new PaletteTripleRedirect(redirect, PaletteBackStyle.ContextMenuHeading, PaletteBorderStyle.ContextMenuHeading, PaletteContentStyle.ContextMenuHeading, needPaint); _paletteItemHighlight = new PaletteDoubleMetricRedirect(redirect, PaletteBackStyle.ContextMenuItemHighlight, PaletteBorderStyle.ContextMenuItemHighlight, needPaint); _paletteItemImage = new PaletteTripleJustImageRedirect(redirect, PaletteBackStyle.ContextMenuItemImage, PaletteBorderStyle.ContextMenuItemImage, PaletteContentStyle.ContextMenuItemImage, needPaint); _paletteItemImageColumn = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ContextMenuItemImageColumn, PaletteBorderStyle.ContextMenuItemImageColumn, needPaint); _paletteItemShortcutTextRedirect = new PaletteContentInheritRedirect(redirect, PaletteContentStyle.ContextMenuItemShortcutText); _paletteItemShortcutText = new PaletteContentJustShortText(_paletteItemShortcutTextRedirect, needPaint); _paletteItemSplit = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ContextMenuItemSplit, PaletteBorderStyle.ContextMenuItemSplit, needPaint); _paletteItemTextAlternateRedirect = new PaletteContentInheritRedirect(redirect, PaletteContentStyle.ContextMenuItemTextAlternate); _paletteItemTextAlternate = new PaletteContentJustText(_paletteItemTextAlternateRedirect, needPaint); _paletteItemTextStandardRedirect = new PaletteContentInheritRedirect(redirect, PaletteContentStyle.ContextMenuItemTextStandard); _paletteItemTextStandard = new PaletteContentJustText(_paletteItemTextStandardRedirect, needPaint); _paletteSeparator = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ContextMenuSeparator, PaletteBorderStyle.ContextMenuSeparator, needPaint); }
/// <summary> /// Initialize a new instance of the PaletteContextMenuRedirect class. /// </summary> /// <param name="redirect">inheritance redirection.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteContextMenuRedirect(PaletteRedirect redirect, NeedPaintHandler needPaint) { Debug.Assert(redirect != null); // Create the palette storage ControlInner = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ContextMenuInner, PaletteBorderStyle.ContextMenuInner, needPaint); ControlOuter = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ContextMenuOuter, PaletteBorderStyle.ContextMenuOuter, needPaint); Heading = new PaletteTripleRedirect(redirect, PaletteBackStyle.ContextMenuHeading, PaletteBorderStyle.ContextMenuHeading, PaletteContentStyle.ContextMenuHeading, needPaint); ItemHighlight = new PaletteDoubleMetricRedirect(redirect, PaletteBackStyle.ContextMenuItemHighlight, PaletteBorderStyle.ContextMenuItemHighlight, needPaint); ItemImage = new PaletteTripleJustImageRedirect(redirect, PaletteBackStyle.ContextMenuItemImage, PaletteBorderStyle.ContextMenuItemImage, PaletteContentStyle.ContextMenuItemImage, needPaint); ItemImageColumn = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ContextMenuItemImageColumn, PaletteBorderStyle.ContextMenuItemImageColumn, needPaint); ItemShortcutTextRedirect = new PaletteContentInheritRedirect(redirect, PaletteContentStyle.ContextMenuItemShortcutText); ItemShortcutText = new PaletteContentJustShortText(ItemShortcutTextRedirect, needPaint); ItemSplit = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ContextMenuItemSplit, PaletteBorderStyle.ContextMenuItemSplit, needPaint); ItemTextAlternateRedirect = new PaletteContentInheritRedirect(redirect, PaletteContentStyle.ContextMenuItemTextAlternate); ItemTextAlternate = new PaletteContentJustText(ItemTextAlternateRedirect, needPaint); ItemTextStandardRedirect = new PaletteContentInheritRedirect(redirect, PaletteContentStyle.ContextMenuItemTextStandard); ItemTextStandard = new PaletteContentJustText(ItemTextStandardRedirect, needPaint); Separator = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ContextMenuSeparator, PaletteBorderStyle.ContextMenuSeparator, needPaint); }
/// <summary> /// Initialize a new instance of the KryptonContextMenuItems class. /// </summary> /// <param name="children">Array of initial child items.</param> public KryptonContextMenuItems(KryptonContextMenuItemBase[] children) { // Default fields _standardStyle = true; _imageColumn = true; Items = new KryptonContextMenuItemCollection(); // Add any initial set of item if (children != null) { Items.AddRange(children); } // Create the redirector that can get values from the krypton context menu _redirectImageColumn = new PaletteRedirectDouble(); // Create the column image storage for overriding specific values StateNormal = new PaletteDoubleRedirect(_redirectImageColumn, PaletteBackStyle.ContextMenuItemImageColumn, PaletteBorderStyle.ContextMenuItemImageColumn); }
/// <summary> /// Initialize a new instance of the KryptonGroupPanel class. /// </summary> /// <param name="alignControl">Container control for alignment.</param> /// <param name="stateCommon">Common appearance state to inherit from.</param> /// <param name="stateDisabled">Disabled appearance state.</param> /// <param name="stateNormal">Normal appearance state.</param> /// <param name="layoutHandler">Callback delegate for layout processing.</param> public KryptonGroupPanel(Control alignControl, PaletteDoubleRedirect stateCommon, PaletteDouble stateDisabled, PaletteDouble stateNormal, NeedPaintHandler layoutHandler) : base(stateCommon, stateDisabled, stateNormal) { // Remember the delegate used to notify layouts _layoutHandler = layoutHandler; // Create the forced overrides to enforce the graphics option we want _forcedDisabled = new PaletteBackInheritForced(stateDisabled.Back); _forcedNormal = new PaletteBackInheritForced(stateNormal.Back); // We never allow the anti alias option as it prevent transparent background working _forcedDisabled.ForceGraphicsHint = PaletteGraphicsHint.None; _forcedNormal.ForceGraphicsHint = PaletteGraphicsHint.None; // Set the correct initial palettes ViewDrawPanel.SetPalettes(Enabled ? _forcedNormal : _forcedDisabled); // Make sure the alignment of the group panel is as that of the parent ViewManager.AlignControl = alignControl; }
/// <summary> /// Initialize a new instance of the PaletteContextMenuItemStateHighlight class. /// </summary> /// <param name="redirectItemHighlight">Redirector for the ItemHighlight.</param> /// <param name="redirectItemSplit">Redirector for the ItemSplit.</param> public PaletteContextMenuItemStateHighlight(PaletteDoubleMetricRedirect redirectItemHighlight, PaletteDoubleRedirect redirectItemSplit) { _paletteItemHighlight = new PaletteDoubleMetric(redirectItemHighlight); _paletteItemSplit = new PaletteDouble(redirectItemSplit); }
internal void SetPaletteRedirect(PaletteDoubleRedirect redirector) { _redirectImageColumn.SetRedirectStates(redirector, redirector); }
private void CreateViewElements() { // Create redirector for the accessing the background palette _redirectCaption = new PaletteDoubleRedirect(_redirect, PaletteBackStyle.HeaderForm, PaletteBorderStyle.HeaderForm, NeedPaintDelegate); // Create a top half for use in KryptonForm and another for use inside this caption area _captionAppButton = new ViewLayoutRibbonAppButton(_ribbon, false); _otherAppButton = new ViewLayoutRibbonAppButton(_ribbon, false); // Connect up the application button controller to the two button elements _appButtonController = new AppButtonController(_ribbon); _appButtonController.Target1 = _captionAppButton.AppButton; _appButtonController.Target2 = _otherAppButton.AppButton; _appButtonController.NeedPaint += new NeedPaintHandler(OnAppButtonNeedPaint); _captionAppButton.MouseController = _appButtonController; _otherAppButton.MouseController = _appButtonController; _appTabController = new AppTabController(_ribbon); _appTabController.NeedPaint += new NeedPaintHandler(OnAppButtonNeedPaint); // When not showing the app button we show this spacer instead _spaceInsteadOfAppButton = new ViewLayoutSeparator(0); _spaceInsteadOfAppButton.Visible = false; // Quick access toolbar, minibar versions _captionQAT = new ViewLayoutRibbonQATMini(_ribbon, _needIntegratedDelegate); _nonCaptionQAT = new ViewLayoutRibbonQATMini(_ribbon, NeedPaintDelegate); // Layout needed to position and draw the context titles _contextTiles = new ViewLayoutRibbonContextTitles(_ribbon, this); _contextTiles.ReverseRenderOrder = true; // Create composition right border and attach to composition area _compRightBorder = new ViewDrawRibbonCompoRightBorder(); _compositionArea.CompRightBorder = _compRightBorder; // Place app button on left side and fill remainder with context titles Add(_contextTiles, ViewDockStyle.Fill); Add(_nonCaptionQAT, ViewDockStyle.Left); Add(_otherAppButton, ViewDockStyle.Left); // Update base class to use correct palette interface base.SetPalettes(_redirectCaption.PaletteBack, _redirectCaption.PaletteBorder); }
internal void SetPaletteRedirect(PaletteDoubleRedirect redirector) { _redirectSeparator.SetRedirectStates(redirector, redirector); }
/// <summary> /// Initialize a new instance of the PaletteContextMenuItemStateHighlight class. /// </summary> /// <param name="redirectItemHighlight">Redirector for the ItemHighlight.</param> /// <param name="redirectItemSplit">Redirector for the ItemSplit.</param> public PaletteContextMenuItemStateHighlight(PaletteDoubleMetricRedirect redirectItemHighlight, PaletteDoubleRedirect redirectItemSplit) { ItemHighlight = new PaletteDoubleMetric(redirectItemHighlight); ItemSplit = new PaletteDouble(redirectItemSplit); }