private void RefreshPalette() { if (m_PaletteMode == PaletteMode.Global) { m_Palette = KryptonManager.CurrentGlobalPalette; } else { m_Palette = KryptonManager.GetPaletteForMode(m_PaletteMode); } m_Renderer = m_Palette.GetRenderer(); m_PaletteRedirect = new PaletteRedirect(m_Palette); m_PaletteTabPageBackground = new PaletteBackInheritRedirect(m_PaletteRedirect); m_PaletteTabPageBackground.Style = PaletteBackStyle.PanelClient; Refresh(); }
/// <summary> /// Initialize a new instance of the ViewLayoutRibbonGroupsArea class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="redirect">Reference to redirector for palette settings.</param> /// <param name="needPaintDelegate">Delegate for notifying paint/layout changes.</param> public ViewLayoutRibbonGroupsArea(KryptonRibbon ribbon, PaletteRedirect redirect, NeedPaintHandler needPaintDelegate) { Debug.Assert(ribbon != null); Debug.Assert(redirect != null); Debug.Assert(needPaintDelegate != null); // Remember the incoming reference _ribbon = ribbon; // Create access to the redirector and use as our palette source _backInherit = new PaletteBackInheritRedirect(redirect, PaletteBackStyle.PanelClient); SetPalettes(_backInherit); // Create and add the only child we need, the groups area border element ViewGroups = new ViewDrawRibbonGroupsBorderSynch(ribbon, needPaintDelegate); Add(ViewGroups); }
public KryptonFlowLayoutPanel() { SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true); _palette = KryptonManager.CurrentGlobalPalette; if (_palette != null) { _palette.PalettePaint += new EventHandler <PaletteLayoutEventArgs>(OnPalettePaint); } KryptonManager.GlobalPaletteChanged += new EventHandler(OnGlobalPaletteChanged); _paletteRedirect = new PaletteRedirect(_palette); _paletteBack = new PaletteBackInheritRedirect(_paletteRedirect); _paletteBorder = new PaletteBorderInheritRedirect(_paletteRedirect); _paletteContent = new PaletteContentInheritRedirect(_paletteRedirect); }
void RefreshPalette() { palette = paletteMode == PaletteMode.Global ? KryptonManager.CurrentGlobalPalette : KryptonManager.GetPaletteForMode(paletteMode); renderer = palette.GetRenderer(); paletteRedirect = new PaletteRedirect(palette); paletteBackground = new PaletteBackInheritRedirect(paletteRedirect); paletteLines = new PaletteBorderInheritRedirect(paletteRedirect); paletteBackButton = new PaletteBackInheritRedirect(paletteRedirect); paletteBorderButton = new PaletteBorderInheritRedirect(paletteRedirect); paletteBackground.Style = PaletteBackStyle.InputControlStandalone; paletteLines.Style = PaletteBorderStyle.GridDataCellList; paletteBackButton.Style = PaletteBackStyle.ButtonListItem; paletteBorderButton.Style = PaletteBorderStyle.ButtonListItem; Refresh(); }
/// <summary> /// Initialize a new instance of the PaletteTripleRedirect class. /// </summary> /// <param name="redirect">inheritance redirection instance.</param> /// <param name="backStyle">Initial background style.</param> /// <param name="borderStyle">Initial border style.</param> /// <param name="contentStyle">Initial content style.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteTripleRedirect(PaletteRedirect redirect, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, PaletteContentStyle contentStyle, NeedPaintHandler needPaint) { // Store the provided paint notification delegate NeedPaint = needPaint; // Store the inherit instances _backInherit = new PaletteBackInheritRedirect(redirect, backStyle); _borderInherit = new PaletteBorderInheritRedirect(redirect, borderStyle); _contentInherit = new PaletteContentInheritRedirect(redirect, contentStyle); // Create storage that maps onto the inherit instances Back = new PaletteBack(_backInherit, needPaint); Border = new PaletteBorder(_borderInherit, needPaint); Content = new PaletteContent(_contentInherit, needPaint); }
/// <summary> /// Initialize a new instance of the PaletteTreeStateRedirect class. /// </summary> /// <param name="redirect">inheritance redirection instance.</param> /// <param name="back">Storage for back values.</param> /// <param name="backInherit">inheritance for back values.</param> /// <param name="border">Storage for border values.</param> /// <param name="borderInherit">inheritance for border values.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteTreeStateRedirect(PaletteRedirect redirect, PaletteBack back, PaletteBackInheritRedirect backInherit, PaletteBorder border, PaletteBorderInheritRedirect borderInherit, NeedPaintHandler needPaint) : base(redirect, back, backInherit, border, borderInherit, needPaint) { Debug.Assert(redirect != null); // Remember the redirect reference _redirect = redirect; // Create the item redirector Node = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonListItem, PaletteBorderStyle.ButtonListItem, PaletteContentStyle.ButtonListItem, needPaint); }
public KryptonToggleSwitchAndroidRenderer() { if (((_palette != null))) { _palette.PalettePaint += OnPalettePaint; } KryptonManager.GlobalPaletteChanged += OnGlobalPaletteChanged; _palette = KryptonManager.CurrentGlobalPalette; _paletteRedirect = new PaletteRedirect(_palette); _paletteBack = new PaletteBackInheritRedirect(_paletteRedirect); _paletteBorder = new PaletteBorderInheritRedirect(_paletteRedirect); _paletteContent = new PaletteContentInheritRedirect(_paletteRedirect); InitialiseColours(); }
public KryptonKnobControl() { this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.SetStyle(ControlStyles.ResizeRedraw, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); //Create redirection object to the base palette if (((this._palette != null))) { this._palette.PalettePaint += new EventHandler <PaletteLayoutEventArgs>(this.OnPalettePaint); } KryptonManager.GlobalPaletteChanged += new EventHandler(this.OnGlobalPaletteChanged); this._palette = KryptonManager.CurrentGlobalPalette; this._paletteRedirect = new PaletteRedirect(this._palette); //Create accessor objects for the back, border and content m_paletteBack = new PaletteBackInheritRedirect(_paletteRedirect); m_paletteBorder = new PaletteBorderInheritRedirect(_paletteRedirect); m_paletteContent = new PaletteContentInheritRedirect(_paletteRedirect); InitColors(); //This call is required by the Windows Form Designer. InitializeComponent(); this.ImeMode = ImeMode.On; this.Name = "Knob"; this.Resize += new EventHandler(this.Knob_Resize); //this.ValueChanged += new ValueChangedEventHandler(this.ValueChanged); DottedPen = new Pen(getDarkColor(_KnobBorderColour, 40)); DottedPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot; DottedPen.DashCap = System.Drawing.Drawing2D.DashCap.Round; setDimensions(); InitColors(); }
/// <summary> /// Initialize a new instance of the PaletteInputControlTripleRedirect class. /// </summary> /// <param name="redirect">inheritance redirection instance.</param> /// <param name="backStyle">Initial background style.</param> /// <param name="borderStyle">Initial border style.</param> /// <param name="contentStyle">Initial content style.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteInputControlTripleRedirect(PaletteRedirect redirect, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, PaletteContentStyle contentStyle, NeedPaintHandler needPaint) { Debug.Assert(redirect != null); // Store the provided paint notification delegate NeedPaint = needPaint; // Store the inherit instances _backInherit = new PaletteBackInheritRedirect(redirect, backStyle); _borderInherit = new PaletteBorderInheritRedirect(redirect, borderStyle); _contentInherit = new PaletteContentInheritRedirect(redirect, contentStyle); _metricRedirect = new PaletteMetricRedirect(redirect); // Create storage that maps onto the inherit instances Back = new PaletteInputControlBackStates(_backInherit, needPaint); Border = new PaletteBorder(_borderInherit, needPaint); Content = new PaletteInputControlContentStates(_contentInherit, needPaint); }
//constructor public KryptonPowerComboBox() { this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.SetStyle(ControlStyles.EnableNotifyMessage, true); UpdateStyles(); this.ComboBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; this.ComboBox.DrawItem += new DrawItemEventHandler(OnDrawItem); this.ForeColor = this.ComboBox.ForeColor; this.Font = this.ComboBox.Font; // Cache the current global palette setting _palette = KryptonManager.CurrentGlobalPalette; // Hook into palette events if (_palette != null) { _palette.PalettePaint += new EventHandler <PaletteLayoutEventArgs>(OnPalettePaint); } // We want to be notified whenever the global palette changes KryptonManager.GlobalPaletteChanged += new EventHandler(OnGlobalPaletteChanged); // Create redirection object to the base palette _paletteRedirect = new PaletteRedirect(_palette); _paletteBack = new PaletteBackInheritRedirect(_paletteRedirect); _paletteBorder = new PaletteBorderInheritRedirect(_paletteRedirect); _paletteContent = new PaletteContentInheritRedirect(_paletteRedirect); InitColours(); if (_alternateRowColorEnabled) { this.GridColour = _alternateRowColor; } }
/// <summary> /// Constructor /// </summary> public KryptonOutlookGridGroupBox() { // To remove flicker we use double buffering for drawing SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true); InitializeComponent(); columnsList = new List <OutlookGridGroupBoxColumn>(); // Cache the current global palette setting _palette = KryptonManager.CurrentGlobalPalette; // Hook into palette events if (_palette != null) { _palette.PalettePaint += new EventHandler <PaletteLayoutEventArgs>(OnPalettePaint); } // (4) We want to be notified whenever the global palette changes KryptonManager.GlobalPaletteChanged += new EventHandler(OnGlobalPaletteChanged); // Create redirection object to the base palette _paletteRedirect = new PaletteRedirect(_palette); // Create accessor objects for the back, border and content // Store the inherit instances _paletteBack = new PaletteBackInheritRedirect(_paletteRedirect); _paletteBorder = new PaletteBorderInheritRedirect(_paletteRedirect); _paletteContent = new PaletteContentInheritRedirect(_paletteRedirect); _paletteDataGridView = new PaletteDataGridViewRedirect(_paletteRedirect, null); _paletteDataGridViewAll = new PaletteDataGridViewAll(_paletteDataGridView, null); // Create storage that maps onto the inherit instances _border = new PaletteBorder(_paletteBorder, null); }
private void RefreshPalette() { if (this.paletteMode == PaletteMode.Global) { this.palette = KryptonManager.CurrentGlobalPalette; } else { this.palette = KryptonManager.GetPaletteForMode(this.paletteMode); } this.renderer = this.palette.GetRenderer(); this.paletteRedirect = new PaletteRedirect(this.palette); this.paletteBorder = new PaletteBorderInheritRedirect(this.paletteRedirect); this.paletteBack = new PaletteBackInheritRedirect(this.paletteRedirect); this.paletteBorderButton = new PaletteBorderInheritRedirect(this.paletteRedirect); this.paletteBackButton = new PaletteBackInheritRedirect(this.paletteRedirect); this.paletteBorder.Style = PaletteBorderStyle.InputControlStandalone; this.paletteBack.Style = PaletteBackStyle.InputControlStandalone; this.paletteBorderButton.Style = PaletteBorderStyle.ButtonInputControl; this.paletteBackButton.Style = PaletteBackStyle.ButtonListItem; }
public KryptonTimeFrame() { SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.OptimizedDoubleBuffer, true); SetStyle(ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); // add Palette Handler if (_palette != null) { _palette.PalettePaint += new EventHandler <PaletteLayoutEventArgs>(OnPalettePaint); } KryptonManager.GlobalPaletteChanged += new EventHandler(OnGlobalPaletteChanged); _palette = KryptonManager.CurrentGlobalPalette; _paletteRedirect = new PaletteRedirect(_palette); _paletteBack = new PaletteBackInheritRedirect(_paletteRedirect); _paletteBorder = new PaletteBorderInheritRedirect(_paletteRedirect); _paletteContent = new PaletteContentInheritRedirect(_paletteRedirect); InitColors(); }
private void RefreshPalette() { Palette = KryptonManager.CurrentGlobalPalette; Renderer = Palette.GetRenderer(); ViewLayoutContext = new ViewLayoutContext(ViewLayoutContextControl, Renderer); PaletteRedirect PaletteRedirect = new PaletteRedirect(Palette); PaletteTabPageBackground = new PaletteBackInheritRedirect(PaletteRedirect); PaletteTabPageBorder = new PaletteBorderInheritRedirect(PaletteRedirect); PaletteTabButtonBackground = new PaletteBackInheritRedirect(PaletteRedirect); PaletteTabButtonBorder = new PaletteBorderInheritRedirect(PaletteRedirect); PaletteTabPageBackground.Style = PaletteBackStyle.ControlToolTip; PaletteTabPageBorder.Style = PaletteBorderStyle.ButtonNavigatorStack; PaletteTabButtonBackground.Style = PaletteBackStyle.ButtonNavigatorStack; PaletteTabButtonBorder.Style = PaletteBorderStyle.ButtonNavigatorMini; TabFontBold = new Font(Palette.GetContentShortTextFont(PaletteContentStyle.ButtonNavigatorStack, PaletteState.Normal), FontStyle.Bold); TabFontRegular = new Font(TabFontBold, FontStyle.Regular); TabBrush = new SolidBrush(Palette.GetContentShortTextColor1(PaletteContentStyle.ButtonNavigatorStack, PaletteState.Normal)); Invalidate(); }
public KryptonTreeViewExt() { SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true); UpdateStyles(); this.DrawMode = TreeViewDrawMode.OwnerDrawAll; //SetStyle(ControlStyles.UserPaint, true); // add Palette Handler // Cache the current global palette setting _palette = KryptonManager.CurrentGlobalPalette; // Hook into palette events if (_palette != null) { _palette.PalettePaint += new EventHandler <PaletteLayoutEventArgs>(OnPalettePaint); } // We want to be notified whenever the global palette changes KryptonManager.GlobalPaletteChanged += new EventHandler(OnGlobalPaletteChanged); // Create redirection object to the base palette _paletteRedirect = new PaletteRedirect(_palette); // Create accessor objects for the back, border and content _paletteBack = new PaletteBackInheritRedirect(_paletteRedirect); _paletteBorder = new PaletteBorderInheritRedirect(_paletteRedirect); _paletteContent = new PaletteContentInheritRedirect(_paletteRedirect); //vista _enableVistaCheckBoxes = Utility.IsVista(); _enableVistaSigns = Utility.IsVista(); InitColors(); //for image list InitializeComponent(); }