/// <summary> /// Default constructor. /// </summary> public PanelEx() { if(!ColorFunctions.ColorsLoaded) { NativeFunctions.RefreshSettings(); NativeFunctions.OnDisplayChange(); ColorFunctions.LoadColors(); } this.SetStyle(ControlStyles.UserPaint,true); this.SetStyle(ControlStyles.AllPaintingInWmPaint,true); this.SetStyle(ControlStyles.Opaque,true); this.SetStyle(ControlStyles.ResizeRedraw,true); this.SetStyle(DisplayHelp.DoubleBufferFlag,true); this.SetStyle(ControlStyles.SupportsTransparentBackColor,true); this.SetStyle(ControlStyles.ContainerControl,true); this.SetStyle(ControlStyles.Selectable,true); //this.SetStyle(ControlStyles.StandardDoubleClick,false); m_ColorScheme=new ColorScheme(m_ColorSchemeStyle); ResetStyle(); ResetStyleMouseOver(); ResetStyleMouseDown(); m_NCPainter = new Controls.NonClientPaintHandler(this, eScrollBarSkin.Optimized); this.BackColor=Color.Transparent; StyleManager.Register(this); }
/// <summary> /// Creates new instance of the object and provides default values. /// </summary> /// <param name="g">Reference to Graphics object</param> /// <param name="item">Reference to CheckBoxItem</param> /// <param name="cs">Reference to legacy ColorScheme</param> /// <param name="f">Indicates the font for the text.</param> /// <param name="rtl">Indicates whether item is in Right-To-Left environment.</param> public CheckBoxItemRenderEventArgs(Graphics g, CheckBoxItem item, ColorScheme cs, Font f, bool rtl) { this.Graphics = g; this.CheckBoxItem = item; this.ColorScheme = cs; this.RightToLeft = rtl; this.Font = f; }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (context!=null && context.Instance!=null && provider!=null) { m_EditorService=(System.Windows.Forms.Design.IWindowsFormsEditorService)provider.GetService(typeof(System.Windows.Forms.Design.IWindowsFormsEditorService)); if(m_EditorService!=null) { if(context.Instance is Bar) { Bar bar=context.Instance as Bar; if(bar.Owner is DotNetBarManager && ((DotNetBarManager)bar.Owner).UseGlobalColorScheme) System.Windows.Forms.MessageBox.Show("Please note that your DotNetBarManager has its UseGlobalColorScheme set to true and any changes you make to ColorScheme object on the bar will not be used."); } else if(context.Instance is DotNetBarManager && !((DotNetBarManager)context.Instance).UseGlobalColorScheme) { System.Windows.Forms.MessageBox.Show("Please note that you need to set UseGlobalColorScheme=true in order for all bars to use ColorScheme you change on this dialog."); } if(value==null) value=new ColorScheme(); ColorSchemeEditor editor=new ColorSchemeEditor(); editor.CreateControl(); editor.ColorScheme=(ColorScheme)value; m_EditorService.ShowDialog(editor); if(editor.ColorSchemeChanged) { value=editor.ColorScheme; context.OnComponentChanged(); ((ColorScheme)value)._DesignTimeSchemeChanged=true; if(context.Instance is Bar) { ((Bar)context.Instance).Refresh(); } } editor.Close(); } } return value; }
/// <summary> /// Creates new instance of the object. /// </summary> public BaseItemControl() { if (!ColorFunctions.ColorsLoaded) { NativeFunctions.RefreshSettings(); NativeFunctions.OnDisplayChange(); ColorFunctions.LoadColors(); } this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.Opaque, true); this.SetStyle(ControlStyles.ResizeRedraw, true); this.SetStyle(ControlStyles.StandardDoubleClick, true); this.SetStyle(DisplayHelp.DoubleBufferFlag, true); this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); m_ColorScheme = new ColorScheme(eDotNetBarStyle.Office2007); m_BackgroundStyle = new ElementStyle(); m_BackgroundStyle.SetColorScheme(m_ColorScheme); m_BackgroundStyle.StyleChanged += new EventHandler(this.VisualPropertyChanged); }
public ItemPaintArgs(IOwner owner, System.Windows.Forms.Control control, System.Drawing.Graphics g, ColorScheme scheme) { this.Graphics=g; this.Colors=scheme; this.ContainerControl=control; this.Owner=owner; if(control!=null) this.RightToLeft = (control.RightToLeft == System.Windows.Forms.RightToLeft.Yes); if (control is MenuPanel || this.ContainerControl is ItemsListBox) this.IsOnMenu = true; else if (control is Bar && ((Bar)control).MenuBar) this.IsOnMenuBar = true; else if (control is Bar && ((Bar)control).BarState == eBarState.Popup) this.IsOnPopupBar = true; else if (control is RibbonBar) this.IsOnRibbonBar = true; else if (control is NavigationBar) this.IsOnNavigationBar = true; if(control!=null) this.Font=control.Font; CreateStringFormat(); }
private void PaintButton(Graphics g, MDISystemItem mdi , SystemButton button, Rectangle r, Office2007ButtonItemStateColorTable ct, ColorScheme colorScheme) { Region oldClip = g.Clip; g.SetClip(r); Office2007ButtonItemPainter.PaintBackground(g, ct, r, RoundRectangleShapeDescriptor.RoundCorner2); r.Inflate(-1, -1); r.Offset(1, 0); using (Bitmap bmp = mdi.GetButtonBitmap(g, button, r, colorScheme)) { if (button == SystemButton.Minimize && !mdi.MinimizeEnabled || button == SystemButton.Restore && !mdi.RestoreEnabled || button == SystemButton.Close && !mdi.CloseEnabled) { float[][] array = new float[5][]; array[0] = new float[5] { 0, 0, 0, 0, 0 }; array[1] = new float[5] { 0, 0, 0, 0, 0 }; array[2] = new float[5] { 0, 0, 0, 0, 0 }; array[3] = new float[5] { .5f, .5f, .5f, .5f, 0 }; array[4] = new float[5] { 0, 0, 0, 0, 0 }; System.Drawing.Imaging.ColorMatrix grayMatrix = new System.Drawing.Imaging.ColorMatrix(array); System.Drawing.Imaging.ImageAttributes disabledImageAttr = new System.Drawing.Imaging.ImageAttributes(); disabledImageAttr.ClearColorKey(); disabledImageAttr.SetColorMatrix(grayMatrix); g.DrawImage(bmp, r, 0, 0, bmp.Width, bmp.Height, GraphicsUnit.Pixel, disabledImageAttr); } else { if (button == mdi.MouseDownButton) r.Offset(1, 1); g.DrawImageUnscaled(bmp, r); } } g.Clip = oldClip; }
/// <summary> /// Generates OneNote style color scheme. /// </summary> private void GenerateRoundHeaderColorScheme() { eWinXPColorScheme xpc=BarFunctions.WinXPColorScheme; if(!m_TabItemSeparatorCustom) m_TabItemSeparator=Color.Empty; if(!m_TabItemSeparatorShadeCustom) m_TabItemSeparatorShade=Color.Empty; ColorScheme cs=new ColorScheme(eDotNetBarStyle.VS2005); switch(xpc) { case eWinXPColorScheme.Blue: { // Tab Control Section if(!m_TabBackgroundCustom) m_TabBackground=GetColor("F9F8F4"); if(!m_TabBackground2Custom) m_TabBackground2=Color.Empty; //m_TabBackgroundGradientAngle=90; if(!m_TabBorderCustom) m_TabBorder=SystemColors.ControlDarkDark;//GetColor("ACA899"); // Tab Item Section if(!m_TabItemBorderCustom) m_TabItemBorder=SystemColors.ControlDarkDark;// GetColor("ACA899"); if(!m_TabItemBorderLightCustom) m_TabItemBorderLight=Color.Empty; if(!m_TabItemBorderDarkCustom) m_TabItemBorderDark=Color.Empty; if(!m_TabItemBackgroundCustom) m_TabItemBackground=GetColor("ECE9D7"); if(!m_TabItemBackground2Custom) m_TabItemBackground2=GetColor("FEFDFD"); //m_TabItemBackgroundGradientAngle=90; if(!m_TabItemTextCustom) m_TabItemText=SystemColors.ControlText; // Tab Panel Section if(!m_TabPanelBackgroundCustom) m_TabPanelBackground=Color.White; if(!m_TabPanelBackground2Custom) m_TabPanelBackground2=m_TabItemBackground; //m_TabPanelBackgroundGradientAngle=90; if(!m_TabPanelBorderCustom) m_TabPanelBorder=m_TabBorder; // Tab Item Hot Section if(!m_TabItemHotBorderCustom) m_TabItemHotBorder=Color.Empty; if(!m_TabItemHotBorderLightCustom) m_TabItemHotBorderLight=Color.Empty; if(!m_TabItemHotBorderDarkCustom) m_TabItemHotBorderDark=Color.Empty; if(!m_TabItemHotBackgroundCustom) m_TabItemHotBackground=Color.Empty; if(!m_TabItemHotBackground2Custom) m_TabItemHotBackground2=Color.Empty; //m_TabItemHotBackgroundGradientAngle=90; if(!m_TabItemHotTextCustom) m_TabItemHotText=SystemColors.ControlText; // Tab Item Selected Section if(!m_TabItemSelectedBorderCustom) m_TabItemSelectedBorder=m_TabItemBorder; if(!m_TabItemSelectedBorderLightCustom) m_TabItemSelectedBorderLight=Color.Empty; if(!m_TabItemSelectedBorderDarkCustom) m_TabItemSelectedBorderDark=Color.Empty; if(!m_TabItemSelectedBackgroundCustom) m_TabItemSelectedBackground=GetColor("0266FB"); //SystemColors.Highlight; if(!m_TabItemSelectedBackground2Custom) m_TabItemSelectedBackground2=Color.FromArgb(45,m_TabItemSelectedBackground); //ControlPaint.LightLight(SystemColors.Highlight); //m_TabItemSelectedBackgroundGradientAngle=90; if(!m_TabItemSelectedTextCustom) m_TabItemSelectedText=SystemColors.ControlText; break; } case eWinXPColorScheme.Silver: { // Tab Control Section if(!m_TabBackgroundCustom) m_TabBackground=SystemColors.Control;//GetColor("E7E7EF"); if(!m_TabBackground2Custom) m_TabBackground2=Color.Empty; //m_TabBackgroundGradientAngle=90; if(!m_TabBorderCustom) m_TabBorder=SystemColors.ControlDarkDark;//GetColor("9D9DA1"); // Tab Item Section if(!m_TabItemBorderCustom) m_TabItemBorder=SystemColors.ControlDarkDark; //m_TabBorder; if(!m_TabItemBorderLightCustom) m_TabItemBorderLight=Color.Empty; if(!m_TabItemBorderDarkCustom) m_TabItemBorderDark=Color.Empty; if(!m_TabItemBackgroundCustom) m_TabItemBackground=GetColor("F2F2F7"); if(!m_TabItemBackground2Custom) m_TabItemBackground2=GetColor("FEFEFE"); //m_TabItemBackgroundGradientAngle=90; if(!m_TabItemTextCustom) m_TabItemText=SystemColors.ControlText; // Tab Panel Section if(!m_TabPanelBackgroundCustom) m_TabPanelBackground=Color.White; if(!m_TabPanelBackground2Custom) m_TabPanelBackground2=m_TabItemBackground; //m_TabPanelBackgroundGradientAngle=90; if(!m_TabPanelBorderCustom) m_TabPanelBorder=m_TabItemBorder; // Tab Item Hot Section if(!m_TabItemHotBorderCustom) m_TabItemHotBorder=Color.Empty; if(!m_TabItemHotBorderLightCustom) m_TabItemHotBorderLight=Color.Empty; if(!m_TabItemHotBorderDarkCustom) m_TabItemHotBorderDark=Color.Empty; if(!m_TabItemHotBackgroundCustom) m_TabItemHotBackground=Color.Empty; if(!m_TabItemHotBackground2Custom) m_TabItemHotBackground2=Color.Empty; //m_TabItemHotBackgroundGradientAngle=90; if(!m_TabItemHotTextCustom) m_TabItemHotText=SystemColors.ControlText; // Tab Item Selected Section if(!m_TabItemSelectedBorderCustom) m_TabItemSelectedBorder=m_TabItemBorder; if(!m_TabItemSelectedBorderLightCustom) m_TabItemSelectedBorderLight=Color.Empty; if(!m_TabItemSelectedBorderDarkCustom) m_TabItemSelectedBorderDark=Color.Empty; if(!m_TabItemSelectedBackgroundCustom) m_TabItemSelectedBackground=SystemColors.Highlight; if(!m_TabItemSelectedBackground2Custom) m_TabItemSelectedBackground2=Color.FromArgb(45,m_TabItemSelectedBackground); //m_TabItemSelectedBackgroundGradientAngle=90; if(!m_TabItemSelectedTextCustom) m_TabItemSelectedText=SystemColors.ControlText; break; } case eWinXPColorScheme.OliveGreen: { // Tab Control Section if(!m_TabBackgroundCustom) m_TabBackground=SystemColors.Control; if(!m_TabBackground2Custom) m_TabBackground2=Color.Empty; //m_TabBackgroundGradientAngle=90; if(!m_TabBorderCustom) m_TabBorder=SystemColors.ControlDarkDark;//GetColor("ACA899"); // Tab Item Section if(!m_TabItemBorderCustom) m_TabItemBorder=SystemColors.ControlDarkDark; if(!m_TabItemBorderLightCustom) m_TabItemBorderLight=Color.Empty; if(!m_TabItemBorderDarkCustom) m_TabItemBorderDark=Color.Empty; if(!m_TabItemBackgroundCustom) m_TabItemBackground=GetColor("ECE9D7"); if(!m_TabItemBackground2Custom) m_TabItemBackground2=GetColor("FEFDFD"); //m_TabItemBackgroundGradientAngle=90; if(!m_TabItemTextCustom) m_TabItemText=SystemColors.ControlText; // Tab Panel Section if(!m_TabPanelBackgroundCustom) m_TabPanelBackground=Color.White; if(!m_TabPanelBackground2Custom) m_TabPanelBackground2=m_TabItemBackground; //m_TabPanelBackgroundGradientAngle=90; if(!m_TabPanelBorderCustom) m_TabPanelBorder=m_TabBorder; // Tab Item Hot Section if(!m_TabItemHotBorderCustom) m_TabItemHotBorder=Color.Empty; if(!m_TabItemHotBorderLightCustom) m_TabItemHotBorderLight=Color.Empty; if(!m_TabItemHotBorderDarkCustom) m_TabItemHotBorderDark=Color.Empty; if(!m_TabItemHotBackgroundCustom) m_TabItemHotBackground=Color.Empty; if(!m_TabItemHotBackground2Custom) m_TabItemHotBackground2=Color.Empty; //m_TabItemHotBackgroundGradientAngle=90; if(!m_TabItemHotTextCustom) m_TabItemHotText=SystemColors.ControlText; // Tab Item Selected Section if(!m_TabItemSelectedBorderCustom) m_TabItemSelectedBorder=GetColor("ACA899"); if(!m_TabItemSelectedBorderLightCustom) m_TabItemSelectedBorderLight=Color.Empty; if(!m_TabItemSelectedBorderDarkCustom) m_TabItemSelectedBorderDark=Color.Empty; if(!m_TabItemSelectedBackgroundCustom) m_TabItemSelectedBackground=SystemColors.Highlight; if(!m_TabItemSelectedBackground2Custom) m_TabItemSelectedBackground2=Color.FromArgb(45,m_TabItemSelectedBackground); //ControlPaint.LightLight(SystemColors.Highlight); //m_TabItemSelectedBackgroundGradientAngle=90; if(!m_TabItemSelectedTextCustom) m_TabItemSelectedText=SystemColors.ControlText; break; } default: { // Tab Control Section if(!m_TabBackgroundCustom) m_TabBackground=SystemColors.Control; if(!m_TabBackground2Custom) m_TabBackground2=Color.Empty; //m_TabBackgroundGradientAngle=90; if(!m_TabBorderCustom) m_TabBorder=SystemColors.ControlDarkDark;//cs.BarBackground2; // Tab Item Section if(!m_TabItemBorderCustom) m_TabItemBorder=SystemColors.ControlDarkDark; if(!m_TabItemBorderLightCustom) m_TabItemBorderLight=Color.Empty; if(!m_TabItemBorderDarkCustom) m_TabItemBorderDark=Color.Empty; if(!m_TabItemBackgroundCustom) m_TabItemBackground=System.Windows.Forms.ControlPaint.Light(cs.BarBackground2); if(!m_TabItemBackground2Custom) m_TabItemBackground2=System.Windows.Forms.ControlPaint.Light(cs.BarBackground); //m_TabItemBackgroundGradientAngle=90; if(!m_TabItemTextCustom) m_TabItemText=SystemColors.ControlText; // Tab Panel Section if(!m_TabPanelBackgroundCustom) m_TabPanelBackground=ControlPaint.LightLight(m_TabItemBackground); if(!m_TabPanelBackground2Custom) m_TabPanelBackground2=m_TabItemBackground; //m_TabPanelBackgroundGradientAngle=90; if(!m_TabPanelBorderCustom) m_TabPanelBorder=m_TabBorder; // Tab Item Hot Section if(!m_TabItemHotBorderCustom) m_TabItemHotBorder=Color.Empty; if(!m_TabItemHotBorderLightCustom) m_TabItemHotBorderLight=Color.Empty; if(!m_TabItemHotBorderDarkCustom) m_TabItemHotBorderDark=Color.Empty; if(!m_TabItemHotBackgroundCustom) m_TabItemHotBackground=Color.Empty; if(!m_TabItemHotBackground2Custom) m_TabItemHotBackground2=Color.Empty; //m_TabItemHotBackgroundGradientAngle=90; if(!m_TabItemHotTextCustom) m_TabItemHotText=Color.Empty; // Tab Item Selected Section if(!m_TabItemSelectedBorderCustom) m_TabItemSelectedBorder=m_TabItemBorder; if(!m_TabItemSelectedBorderLightCustom) m_TabItemSelectedBorderLight=Color.Empty; if(!m_TabItemSelectedBorderDarkCustom) m_TabItemSelectedBorderDark=Color.Empty; if(!m_TabItemSelectedBackgroundCustom) m_TabItemSelectedBackground=SystemColors.Highlight; if(!m_TabItemSelectedBackground2Custom) m_TabItemSelectedBackground2=Color.FromArgb(45,m_TabItemSelectedBackground); //ControlPaint.LightLight(SystemColors.Highlight); //m_TabItemSelectedBackgroundGradientAngle=90; if(!m_TabItemSelectedTextCustom) m_TabItemSelectedText=SystemColors.ControlText; break; } } }
public ItemControl() { // This forces the initialization out of paint loop which speeds up how fast components show up BaseRenderer renderer = Rendering.GlobalManager.Renderer; if(!ColorFunctions.ColorsLoaded) { NativeFunctions.RefreshSettings(); NativeFunctions.OnDisplayChange(); ColorFunctions.LoadColors(); } this.SetStyle(ControlStyles.UserPaint,true); this.SetStyle(ControlStyles.AllPaintingInWmPaint,true); this.SetStyle(ControlStyles.Opaque,true); this.SetStyle(ControlStyles.ResizeRedraw,true); this.SetStyle(DisplayHelp.DoubleBufferFlag,true); this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); m_MoveCursor=null; m_NACursor=null; m_ColorScheme=new ColorScheme(eDotNetBarStyle.Office2003); m_BackgroundStyle.SetColorScheme(m_ColorScheme); m_BackgroundStyle.StyleChanged+=new EventHandler(this.VisualPropertyChanged); this.IsAccessible=true; }
private void btnLoadScheme_Click(object sender, System.EventArgs e) { if(openFileDialog1.ShowDialog()==DialogResult.OK && System.IO.File.Exists(openFileDialog1.FileName)) { DevComponents.DotNetBar.ColorScheme scheme=new ColorScheme(); XmlDocument doc=new XmlDocument(); doc.Load(openFileDialog1.FileName); scheme.Deserialize(doc.FirstChild.FirstChild as XmlElement); this.ColorScheme=scheme; ColorSchemeChanged=true; } }
private static void ChangeStyle(Control cont, eDotNetBarStyle style, bool designMode, ColorScheme cs) { eDotNetBarStyle effectiveStyle = style; if (style == eDotNetBarStyle.StyleManagerControlled) effectiveStyle = StyleManager.GetEffectiveStyle(); bool enumChildControls = true; if (cont is PanelEx && ((PanelEx)cont).ColorSchemeStyle == eDotNetBarStyle.Office2007) { PanelEx pe = cont as PanelEx; pe.ColorSchemeStyle = style; cont.Invalidate(); } if (cont is PanelControl && ((PanelControl)cont).ColorSchemeStyle == eDotNetBarStyle.Office2007) { PanelControl pc = cont as PanelControl; pc.ColorSchemeStyle = style; pc.RefreshStyleSystemColors(); pc.Invalidate(); } else if (cont is ExpandablePanel && ((ExpandablePanel)cont).ColorSchemeStyle == eDotNetBarStyle.Office2007) { ExpandablePanel ep = cont as ExpandablePanel; ep.ColorSchemeStyle = style; cont.Invalidate(); } else if (cont is RibbonControl) { RibbonControl ribbon = (RibbonControl)cont; if (effectiveStyle == eDotNetBarStyle.Office2010 || effectiveStyle == eDotNetBarStyle.Windows7 || effectiveStyle == eDotNetBarStyle.Metro) { BaseItem appButton = GetAppButton(ribbon); if (appButton != null) { if (appButton is ButtonItem && ((ButtonItem)appButton).ImageFixedSize.IsEmpty) ((ButtonItem)appButton).ImageFixedSize = new Size(16, 16); ribbon.QuickToolbarItems.Remove(appButton); ribbon.Items.Insert(0, appButton); } } else if (effectiveStyle == eDotNetBarStyle.Office2007) { if (ribbon.Items.Count > 0 && ribbon.Items[0] is ApplicationButton) { ApplicationButton appButton = (ApplicationButton)ribbon.Items[0]; if (!appButton.ImageFixedSize.IsEmpty) appButton.ImageFixedSize = Size.Empty; ribbon.Items.Remove(appButton); ribbon.QuickToolbarItems.Insert(0, appButton); } } if (style == eDotNetBarStyle.StyleManagerControlled && ribbon.Style == style || style != eDotNetBarStyle.StyleManagerControlled) ribbon.Style = style; ribbon.RibbonStrip.InitDefaultStyles(); ribbon.Invalidate(true); if (ribbon.IsHandleCreated && ribbon.SelectedRibbonTabItem != null && ribbon.SelectedRibbonTabItem.Panel != null) { ribbon.SelectedRibbonTabItem.Panel.PerformLayout(); } enumChildControls = false; } else if (cont is RibbonBar) { RibbonBar rb = cont as RibbonBar; rb.Style = style; cont.Invalidate(); } else if (cont is TabControl) { TabControl tc = cont as TabControl; tc.Style = GetTabControlStyle(tc.TabStrip, style); } else if (cont is TabStrip) { TabStrip ts = cont as TabStrip; ts.Style = GetTabControlStyle(ts, style); } else if (cont is SideBar) { SideBar sb = cont as SideBar; sb.Style = style; sb.Invalidate(); } else if (cont is RibbonForm) { cont.BackColor = ((Office2007Renderer)GlobalManager.Renderer).ColorTable.Form.BackColor; if (cont is OfficeForm) ((OfficeForm)cont).InvalidateNonClient(true); } else if (cont is DockSite && cont.Dock == DockStyle.Top) { // Update any floating bars through DotNetBarManager DockSite ds = cont as DockSite; if (ds.Owner != null) { foreach (Bar bar in ds.Owner.Bars) { if (bar.DockSide == eDockSide.None) { bar.Invalidate(true); ChangeOffice2007ColorTable(bar, cs); } } } } else if (cont is Controls.ComboBoxEx) ((Controls.ComboBoxEx)cont).Style = style; else if (cont is NavigationPane) { NavigationPane pane = (NavigationPane)cont; pane.Style = style; if (BarFunctions.IsOffice2007Style(style)) ((NavigationPane)cont).Office2007ColorTableChanged(); } else if (cont is BaseItemControl) { ((BaseItemControl)cont).Style = style; cont.Invalidate(); } #if FRAMEWORK20 else if (cont is Controls.ListViewEx) { Controls.ListViewEx lv = cont as Controls.ListViewEx; lv.Invalidate(true); lv.ResetCachedColorTableReference(); } else if (cont is Controls.DataGridViewX) cont.Invalidate(true); else if (cont is Controls.DGHScrollBar || cont is Controls.DGVScrollBar) cont.Invalidate(); else if (cont is DevComponents.DotNetBar.Controls.WarningBox) ((DevComponents.DotNetBar.Controls.WarningBox)cont).UpdateColorScheme(); #endif #if !NOTREE else if (cont is AdvTree.AdvTree) cont.Invalidate(); #endif if (enumChildControls) { foreach (Control c in cont.Controls) ChangeOffice2007ColorTable(c, cs); } }
private ElementStyle GetBackgroundStyle() { if (m_CachedStyle != null) return m_CachedStyle; ElementStyle style = new ElementStyle(); if (this.EffectiveStyle == eDotNetBarStyle.Office2000 || this.EffectiveStyle == eDotNetBarStyle.OfficeXP) { style.Border = eStyleBorderType.Solid; style.BorderWidth = 1; style.BorderColor = SystemColors.ControlDark; style.BackColor = SystemColors.Control; style.TextColor = SystemColors.ControlText; } else if (this.EffectiveStyle == eDotNetBarStyle.Office2003 || this.EffectiveStyle == eDotNetBarStyle.VS2005 || BarFunctions.IsOffice2007Style(this.EffectiveStyle)) { ColorScheme scheme = null; if (this.ContainerControl is Bar) scheme = ((Bar)this.ContainerControl).ColorScheme; else if (this.ContainerControl is MenuPanel) scheme = ((MenuPanel)this.ContainerControl).ColorScheme; if (scheme == null) scheme = new ColorScheme(this.EffectiveStyle); style.Border = eStyleBorderType.Solid; style.BorderWidth = 1; style.BorderColorSchemePart = eColorSchemePart.BarDockedBorder; style.BackColorSchemePart = eColorSchemePart.BarBackground; style.BackColor2SchemePart = eColorSchemePart.BarBackground2; style.BackColorGradientAngle = 90; style.TextColorSchemePart = eColorSchemePart.ItemPressedText; } style.TextLineAlignment = eStyleTextAlignment.Center; style.TextAlignment = eStyleTextAlignment.Center; m_CachedStyle = style; return m_CachedStyle; }
/// <summary> /// Returns the color scheme used by control. Color scheme for Office2007 style will be retrieved from the current renderer instead of /// local color scheme referenced by ColorScheme property. /// </summary> /// <returns>An instance of ColorScheme object.</returns> protected virtual ColorScheme GetColorScheme() { BaseRenderer r = GetRenderer(); if (r is Office2007Renderer) return ((Office2007Renderer)r).ColorTable.LegacyColors; if (m_ColorScheme == null) m_ColorScheme = new ColorScheme(eDotNetBarStyle.Metro); return m_ColorScheme; }
protected override void OnPaint(PaintEventArgs p) { eTextFormat format = eTextFormat.Default | eTextFormat.VerticalCenter | eTextFormat.SingleLine; Graphics g=p.Graphics; ColorScheme scheme=null; if (this.BackColor == Color.Transparent || this.BackgroundImage != null) { base.OnPaintBackground(p); } TextRenderingHint textHint = g.TextRenderingHint; SmoothingMode sm = g.SmoothingMode; if (m_AntiAlias) { g.TextRenderingHint = BarUtilities.AntiAliasTextRenderingHint; g.SmoothingMode = SmoothingMode.AntiAlias; } bool office2007Style = BarFunctions.IsOffice2007Style(m_Style); if (office2007Style && m_ColorScheme == null && Rendering.GlobalManager.Renderer is Rendering.Office2007Renderer) scheme = ((Rendering.Office2007Renderer)Rendering.GlobalManager.Renderer).ColorTable.LegacyColors; else if(m_Owner!=null && m_Owner.UseGlobalColorScheme) scheme=m_Owner.ColorScheme; else if(m_ColorScheme!=null) scheme=m_ColorScheme; else scheme=new ColorScheme(m_Style); Rectangle clientRect = this.ClientRectangle; clientRect.Inflate(1, 1); if (scheme.AutoHidePanelBackgroundImage != null) BarFunctions.PaintBackgroundImage(g, clientRect, scheme.AutoHidePanelBackgroundImage, eBackgroundImagePosition.Tile, 255); if (!scheme.AutoHidePanelBackground.IsEmpty) { DisplayHelp.FillRectangle(g, clientRect, scheme.AutoHidePanelBackground, scheme.AutoHidePanelBackground2, 90); } else if (IsGradientStyle) { DisplayHelp.FillRectangle(g, clientRect, scheme.BarBackground, scheme.BarBackground2, scheme.BarBackgroundGradientAngle); } else { using (SolidBrush brush = new SolidBrush(ControlPaint.Light(this.BackColor))) g.FillRectangle(brush, this.DisplayRectangle); } if (m_Style == eDotNetBarStyle.VS2005 || office2007Style) { VS2005TabDisplay td = new VS2005TabDisplay(this, scheme); td.DisplayTextForActiveTabOnly = office2007Style; td.Paint(g, m_Panels); if (m_AntiAlias) { g.TextRenderingHint = textHint; g.SmoothingMode = sm; } return; } const int margin=2; int width=this.Width-2; int height=this.Height-2; Color textColor=Color.Empty; SolidBrush backBrush=null; Pen linePen=null; if(m_Style==eDotNetBarStyle.Office2003) { textColor = scheme.ItemText; linePen=new Pen(scheme.ItemHotBorder,1); } else if (m_Style == eDotNetBarStyle.VS2005 || BarFunctions.IsOffice2007Style(m_Style)) { textColor = scheme.ItemText; linePen=new Pen(scheme.MenuBorder,1); } else { textColor = g.GetNearestColor(ControlPaint.DarkDark(this.BackColor)); backBrush=new SolidBrush(this.BackColor); linePen=new Pen(g.GetNearestColor(ControlPaint.Dark(this.BackColor)),1); } if(this.Dock==DockStyle.Top || this.Dock==DockStyle.Bottom || this.Dock==DockStyle.None) { int x=2; foreach(PanelBar panel in m_Panels) { for(int i=0;i<panel.Tabs.Count;i++) { DockItemTab tab=panel.Tabs[i] as DockItemTab; CompositeImage icon=tab.Icon; tab.DisplayRectangle.X=x; tab.DisplayRectangle.Y=0; tab.DisplayRectangle.Height=height; x+=PanelBar.TabPadding; if(panel.ActiveTab==i || panel.BoundBar.AutoHideTabTextAlwaysVisible) { if(icon!=null) { if(this.Dock==DockStyle.Top) { if((m_Style==eDotNetBarStyle.Office2003 || m_Style==eDotNetBarStyle.VS2005) && !scheme.ItemPressedBackground2.IsEmpty) { using(LinearGradientBrush gradient=BarFunctions.CreateLinearGradientBrush(new Rectangle(tab.DisplayRectangle.X,0,icon.Width+panel.MaxTextWidth+PanelBar.TabPadding*3,height),scheme.ItemPressedBackground,scheme.ItemPressedBackground2,scheme.ItemPressedBackgroundGradientAngle)) g.FillRectangle(gradient,tab.DisplayRectangle.X,0,icon.Width+panel.MaxTextWidth+PanelBar.TabPadding*3,height); } else if(backBrush!=null) g.FillRectangle(backBrush,tab.DisplayRectangle.X,0,icon.Width+panel.MaxTextWidth+PanelBar.TabPadding*3,height); icon.DrawImage(g,new Rectangle(x,(height-icon.Height)/2,icon.Width,icon.Height)); //g.DrawImage(icon,x,(height-icon.Height)/2,icon.Width,icon.Height); } else { if((m_Style==eDotNetBarStyle.Office2003 || m_Style==eDotNetBarStyle.VS2005) && !scheme.ItemPressedBackground2.IsEmpty) { using(LinearGradientBrush gradient=BarFunctions.CreateLinearGradientBrush(new Rectangle(tab.DisplayRectangle.X,margin,icon.Width+panel.MaxTextWidth+PanelBar.TabPadding*3,height),scheme.ItemPressedBackground,scheme.ItemPressedBackground2,scheme.ItemPressedBackgroundGradientAngle)) g.FillRectangle(gradient,tab.DisplayRectangle.X,margin,icon.Width+panel.MaxTextWidth+PanelBar.TabPadding*3,height); } else if(backBrush!=null) g.FillRectangle(backBrush,tab.DisplayRectangle.X,margin,icon.Width+panel.MaxTextWidth+PanelBar.TabPadding*3,height); icon.DrawImage(g,new Rectangle(x,(height-icon.Height)/2+margin,icon.Width,icon.Height)); //g.DrawImage(icon,x,(height-icon.Height)/2+margin,icon.Width,icon.Height); } x+=(icon.Width+PanelBar.TabPadding); } else { if(this.Dock==DockStyle.Top) { if((m_Style==eDotNetBarStyle.Office2003 || m_Style==eDotNetBarStyle.VS2005) && !scheme.ItemPressedBackground2.IsEmpty) { using(LinearGradientBrush gradient=BarFunctions.CreateLinearGradientBrush(new Rectangle(tab.DisplayRectangle.X,0,tab.TextSize.Width+PanelBar.TabPadding*2,height),scheme.ItemPressedBackground,scheme.ItemPressedBackground2,scheme.ItemPressedBackgroundGradientAngle)) g.FillRectangle(gradient,tab.DisplayRectangle.X,0,tab.TextSize.Width+PanelBar.TabPadding*2,height); } else if(backBrush!=null) g.FillRectangle(backBrush,tab.DisplayRectangle.X,0,tab.TextSize.Width+PanelBar.TabPadding*2,height); } else { if((m_Style==eDotNetBarStyle.Office2003 || m_Style==eDotNetBarStyle.VS2005) && !scheme.ItemPressedBackground2.IsEmpty) { using(LinearGradientBrush gradient=BarFunctions.CreateLinearGradientBrush(new Rectangle(tab.DisplayRectangle.X,margin,tab.TextSize.Width+PanelBar.TabPadding*2,height),scheme.ItemPressedBackground,scheme.ItemPressedBackground2,scheme.ItemPressedBackgroundGradientAngle)) g.FillRectangle(gradient,tab.DisplayRectangle.X,margin,tab.TextSize.Width+PanelBar.TabPadding*2,height); } else if(backBrush!=null) g.FillRectangle(backBrush,tab.DisplayRectangle.X,margin,tab.TextSize.Width+PanelBar.TabPadding*2,height); } } TextDrawing.DrawStringLegacy(g,tab.Text,this.Font,textColor,new Rectangle(x,this.Dock==DockStyle.Top?0:margin,(icon==null?tab.TextSize.Width:panel.MaxTextWidth),height),format); x+=((icon==null?tab.TextSize.Width:panel.MaxTextWidth)+PanelBar.TabPadding); tab.DisplayRectangle.Width=x-tab.DisplayRectangle.X; if(this.Dock==DockStyle.Top) tab.DisplayRectangle.Offset(0,-1); else { tab.DisplayRectangle.Offset(0,1); tab.DisplayRectangle.Height+=2; } g.DrawRectangle(linePen,tab.DisplayRectangle); } else { if(icon!=null) { if(this.Dock==DockStyle.Top) { if(backBrush!=null) g.FillRectangle(backBrush,tab.DisplayRectangle.X,0,icon.Width+PanelBar.TabPadding*2,height); icon.DrawImage(g,new Rectangle(x,(height-icon.Height)/2,icon.Width,icon.Height)); //g.DrawImage(icon,x,(height-icon.Height)/2,icon.Width,icon.Height); } else { if(backBrush!=null) g.FillRectangle(backBrush,tab.DisplayRectangle.X,margin,icon.Width+PanelBar.TabPadding*2,height); icon.DrawImage(g,new Rectangle(x,(height-icon.Height)/2+margin,icon.Width,icon.Height)); //g.DrawImage(icon,x,(height-icon.Height)/2+margin,icon.Width,icon.Height); } x+=(icon.Width+PanelBar.TabPadding); } else { TextDrawing.DrawStringLegacy(g,tab.Text,this.Font,textColor,new Rectangle(x,this.Dock==DockStyle.Top?0:margin,tab.TextSize.Width,height),format); x+=(tab.TextSize.Width+PanelBar.TabPadding); } tab.DisplayRectangle.Width=x-tab.DisplayRectangle.X; if(this.Dock==DockStyle.Top) tab.DisplayRectangle.Y--; else { tab.DisplayRectangle.Y++; tab.DisplayRectangle.Height+=2; } g.DrawRectangle(linePen,tab.DisplayRectangle); } if(x>this.Width) break; } x+=4; if(x>this.Width) break; } } else if(this.Dock==DockStyle.Left || this.Dock==DockStyle.Right) { int y=2; foreach(PanelBar panel in m_Panels) { for(int i=0;i<panel.Tabs.Count;i++) { DockItemTab tab=panel.Tabs[i] as DockItemTab; CompositeImage icon=tab.Icon; tab.DisplayRectangle.X=0; tab.DisplayRectangle.Y=y; tab.DisplayRectangle.Width=width; y+=PanelBar.TabPadding; if (panel.ActiveTab == i || panel.BoundBar.AutoHideTabTextAlwaysVisible) { if(icon!=null) { if(this.Dock==DockStyle.Left) { if((m_Style==eDotNetBarStyle.Office2003 || m_Style==eDotNetBarStyle.VS2005) && !scheme.ItemPressedBackground2.IsEmpty) { using(LinearGradientBrush gradient=BarFunctions.CreateLinearGradientBrush(new Rectangle(tab.DisplayRectangle.X,tab.DisplayRectangle.Y,width,icon.Height+panel.MaxTextWidth+PanelBar.TabPadding*3),scheme.ItemPressedBackground,scheme.ItemPressedBackground2,scheme.ItemPressedBackgroundGradientAngle)) g.FillRectangle(gradient,tab.DisplayRectangle.X,tab.DisplayRectangle.Y,width,icon.Height+panel.MaxTextWidth+PanelBar.TabPadding*3); } else if(backBrush!=null) g.FillRectangle(backBrush,tab.DisplayRectangle.X,tab.DisplayRectangle.Y,width,icon.Height+panel.MaxTextWidth+PanelBar.TabPadding*3); icon.DrawImage(g,new Rectangle((width-icon.Width-margin)/2,y,icon.Width,icon.Height)); //g.DrawImage(icon,(width-icon.Width-margin)/2,y,icon.Width,icon.Height); } else { if((m_Style==eDotNetBarStyle.Office2003 || m_Style==eDotNetBarStyle.VS2005) && !scheme.ItemPressedBackground2.IsEmpty) { using(LinearGradientBrush gradient=BarFunctions.CreateLinearGradientBrush(new Rectangle(margin,tab.DisplayRectangle.Y,width,icon.Height+panel.MaxTextWidth+PanelBar.TabPadding*3),scheme.ItemPressedBackground,scheme.ItemPressedBackground2,scheme.ItemPressedBackgroundGradientAngle)) g.FillRectangle(gradient,margin,tab.DisplayRectangle.Y,width,icon.Height+panel.MaxTextWidth+PanelBar.TabPadding*3); } else if(backBrush!=null) g.FillRectangle(backBrush,margin,tab.DisplayRectangle.Y,width,icon.Height+panel.MaxTextWidth+PanelBar.TabPadding*3); icon.DrawImage(g,new Rectangle((width-icon.Width+margin)/2,y,icon.Width,icon.Height)); //g.DrawImage(icon,(width-icon.Width+margin)/2,y,icon.Width,icon.Height); } y+=(icon.Height+PanelBar.TabPadding); } else { if(this.Dock==DockStyle.Left) { if((m_Style==eDotNetBarStyle.Office2003 || m_Style==eDotNetBarStyle.VS2005) && !scheme.ItemPressedBackground2.IsEmpty) { using(LinearGradientBrush gradient=BarFunctions.CreateLinearGradientBrush(new Rectangle(tab.DisplayRectangle.X,tab.DisplayRectangle.Y,width,tab.TextSize.Width+PanelBar.TabPadding*2),scheme.ItemPressedBackground,scheme.ItemPressedBackground2,scheme.ItemPressedBackgroundGradientAngle)) g.FillRectangle(gradient,tab.DisplayRectangle.X,tab.DisplayRectangle.Y,width,tab.TextSize.Width+PanelBar.TabPadding*2); } else if(backBrush!=null) g.FillRectangle(backBrush,tab.DisplayRectangle.X,tab.DisplayRectangle.Y,width,tab.TextSize.Width+PanelBar.TabPadding*2); } else { if((m_Style==eDotNetBarStyle.Office2003 || m_Style==eDotNetBarStyle.VS2005) && !scheme.ItemPressedBackground2.IsEmpty) { using(LinearGradientBrush gradient=BarFunctions.CreateLinearGradientBrush(new Rectangle(margin,tab.DisplayRectangle.Y,width,tab.TextSize.Width+PanelBar.TabPadding*2),scheme.ItemPressedBackground,scheme.ItemPressedBackground2,scheme.ItemPressedBackgroundGradientAngle)) g.FillRectangle(gradient,margin,tab.DisplayRectangle.Y,width,tab.TextSize.Width+PanelBar.TabPadding*2); } else if(backBrush!=null) g.FillRectangle(backBrush,margin,tab.DisplayRectangle.Y,width,tab.TextSize.Width+PanelBar.TabPadding*2); } } g.RotateTransform(90); TextDrawing.DrawStringLegacy(g, tab.Text, this.Font, textColor, new Rectangle(y, -width, (icon == null ? tab.TextSize.Width : panel.MaxTextWidth), width), format); g.ResetTransform(); y+=((icon==null?tab.TextSize.Width:panel.MaxTextWidth)+PanelBar.TabPadding); if(this.Dock==DockStyle.Left) tab.DisplayRectangle.Offset(-1,0); else tab.DisplayRectangle.Offset(1,0); tab.DisplayRectangle.Height=y-tab.DisplayRectangle.Y; g.DrawRectangle(linePen,tab.DisplayRectangle); } else { if(icon!=null) { if(this.Dock==DockStyle.Left) { if(backBrush!=null) g.FillRectangle(backBrush,tab.DisplayRectangle.X,tab.DisplayRectangle.Y,width,icon.Height+PanelBar.TabPadding*2); icon.DrawImage(g,new Rectangle((width-icon.Width-margin)/2,y,icon.Width,icon.Height)); //g.DrawImage(icon,(width-icon.Width-margin)/2,y,icon.Width,icon.Height); } else { if(backBrush!=null) g.FillRectangle(backBrush,margin,tab.DisplayRectangle.Y,width,icon.Height+PanelBar.TabPadding*2); icon.DrawImage(g,new Rectangle((width-icon.Width+margin)/2,y,icon.Width,icon.Height)); //g.DrawImage(icon,(width-icon.Width+margin)/2,y,icon.Width,icon.Height); } y+=(icon.Height+PanelBar.TabPadding); } else { g.RotateTransform(90); TextDrawing.DrawStringLegacy(g, tab.Text, this.Font, textColor, new Rectangle(y, -width, tab.TextSize.Width, width), format); g.ResetTransform(); y+=(tab.TextSize.Width+PanelBar.TabPadding); } tab.DisplayRectangle.Height=y-tab.DisplayRectangle.Y; if(this.Dock==DockStyle.Left) tab.DisplayRectangle.X--; else tab.DisplayRectangle.X++; g.DrawRectangle(linePen,tab.DisplayRectangle); } if(y>this.Height) break; } y+=4; if(y>this.Height) break; } } linePen.Dispose(); if (m_AntiAlias) { g.TextRenderingHint = textHint; g.SmoothingMode = sm; } }
/// <summary> /// Resets color scheme to it's default value. /// </summary> public void ResetColorScheme() { m_ColorScheme=new ColorScheme(eDotNetBarStyle.Office2003); }
/// <summary> /// Creates new instance of side bar control. /// </summary> public ExplorerBar() { if(!ColorFunctions.ColorsLoaded) { NativeFunctions.RefreshSettings(); NativeFunctions.OnDisplayChange(); ColorFunctions.LoadColors(); } m_ColorScheme=new ColorScheme(eDotNetBarStyle.Office2003); m_ItemContainer=new ExplorerBarContainerItem(); m_ItemContainer.GlobalItem=false; m_ItemContainer.ContainerControl=this; m_ItemContainer.Stretch=false; m_ItemContainer.Displayed=true; m_ItemContainer.SetOwner(this); //this.SetStyle(ControlStyles.Selectable,false); this.SetStyle(ControlStyles.UserPaint,true); this.SetStyle(ControlStyles.AllPaintingInWmPaint,true); this.SetStyle(ControlStyles.Opaque,true); this.SetStyle(ControlStyles.ResizeRedraw,true); this.SetStyle(DisplayHelp.DoubleBufferFlag,true); this.SetStyle(ControlStyles.ContainerControl,true); this.SetStyle(ControlStyles.SupportsTransparentBackColor,true); this.TabStop=true; #if TRIAL RemindForm frm=new RemindForm(); frm.ShowDialog(); #endif try { m_MoveCursor=new Cursor(typeof(DevComponents.DotNetBar.DotNetBarManager),"DRAGMOVE.CUR"); m_CopyCursor=new Cursor(typeof(DevComponents.DotNetBar.DotNetBarManager),"DRAGCOPY.CUR"); m_NACursor=new Cursor(typeof(DevComponents.DotNetBar.DotNetBarManager),"DRAGNONE.CUR"); } catch(Exception) { m_MoveCursor=null; m_CopyCursor=null; m_NACursor=null; } ApplyDefaultSettings(); m_BackStyle.StyleChanged+=new EventHandler(this.VisualPropertyChanged); this.AccessibleRole=AccessibleRole.ToolBar; m_BackgroundStyle = new ItemStyleMapper(m_BackStyle); }
private Color GetSingleLineColor() { if (m_SingleLineColorCustom) return m_SingleLineColor; Color c = m_SingleLineColor; eDotNetBarStyle effectiveStyle = EffectiveStyle; if (effectiveStyle == eDotNetBarStyle.Office2003 || effectiveStyle == eDotNetBarStyle.VS2005 || BarFunctions.IsOffice2007Style(this.EffectiveStyle)) { if (BarFunctions.IsOffice2007Style(effectiveStyle)) { if (this.ContainerControl is IRenderingSupport) { Office2007Renderer renderer = ((IRenderingSupport)this.ContainerControl).GetRenderer() as Office2007Renderer; if (renderer == null) renderer = GlobalManager.Renderer as Office2007Renderer; if (renderer != null) c = renderer.ColorTable.Bar.ToolbarBottomBorder; } } else { ColorScheme scheme = null; if (this.ContainerControl is Bar) scheme = ((Bar)this.ContainerControl).ColorScheme; else if (this.ContainerControl is MenuPanel) scheme = ((MenuPanel)this.ContainerControl).ColorScheme; else scheme = new ColorScheme(this.EffectiveStyle); if (scheme != null) m_SingleLineColor = scheme.BarDockedBorder; else m_SingleLineColor = SystemColors.ControlDark; } } return c; }
internal void ApplyColorScheme(ColorScheme cs) { if (this.BackColor1.ColorSchemePart != eColorSchemePart.Custom && this.BackColor1.ColorSchemePart != eColorSchemePart.None) this.BackColor1.SetColor((Color)cs.GetType().GetProperty(this.BackColor1.ColorSchemePart.ToString()).GetValue(cs,null)); if (this.BackColor2.ColorSchemePart != eColorSchemePart.Custom && this.BackColor2.ColorSchemePart != eColorSchemePart.None) this.BackColor2.SetColor((Color)cs.GetType().GetProperty(this.BackColor2.ColorSchemePart.ToString()).GetValue(cs,null)); if (this.BorderColor.ColorSchemePart != eColorSchemePart.Custom && this.BorderColor.ColorSchemePart != eColorSchemePart.None) this.BorderColor.SetColor((Color)cs.GetType().GetProperty(this.BorderColor.ColorSchemePart.ToString()).GetValue(cs, null)); if (this.ForeColor.ColorSchemePart != eColorSchemePart.Custom && this.ForeColor.ColorSchemePart != eColorSchemePart.None) this.ForeColor.SetColor((Color)cs.GetType().GetProperty(this.ForeColor.ColorSchemePart.ToString()).GetValue(cs,null)); }
/// <summary> /// Initializes a new instance of the Bar class. /// </summary> public Bar() { if (!ColorFunctions.ColorsLoaded) { NativeFunctions.RefreshSettings(); NativeFunctions.OnDisplayChange(); ColorFunctions.LoadColors(); } m_ColorScheme = new ColorScheme(); m_ParentItem = null; m_OldContainer = null; m_ClientRect = Rectangle.Empty; m_SideBarRect = Rectangle.Empty; m_SideBarImage = new SideBarImage(); m_ItemContainer = new GenericItemContainer(); m_ItemContainer.GlobalItem = false; m_ItemContainer.ContainerControl = this; m_ItemContainer.WrapItems = true; m_ItemContainer.Stretch = false; m_ItemContainer.Displayed = true; m_ItemContainer.SystemContainer = true; //m_ItemContainer.SetSystemItem(true); //m_OldParent=null; m_InitialContainerWidth = 164; //m_BarState=eBarState.Popup; m_BarState = eBarState.Docked; m_DockOffset = 0; m_DockLine = 0; m_GrabHandleStyle = eGrabHandleStyle.None; m_GrabHandleRect = Rectangle.Empty; m_Owner = null; m_MouseDownPt = Point.Empty; m_MouseDownSize = new Size(0, 0); m_MoveWindow = false; m_FloatingRect = Rectangle.Empty; m_SizeWindow = 0; m_LastDragRect = Rectangle.Empty; m_WrapItemsDock = false; m_WrapItemsFloat = true; m_DockStretch = false; m_MenuBar = false; this.Text = ""; m_Float = null; m_DockingInProgress = false; this.SetStyle(ControlStyles.Selectable, false); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.Opaque, true); this.SetStyle(ControlStyles.ResizeRedraw, true); this.SetStyle(DisplayHelp.DoubleBufferFlag, true); this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.TabStop = false; base.Font = SystemFonts.MenuFont; // System.Windows.Forms.SystemInformation.MenuFont.Clone() as Font; m_CanDockLeft = true; m_CanDockRight = true; m_CanDockTop = true; m_CanDockBottom = true; m_CanUndock = true; Microsoft.Win32.SystemEvents.UserPreferenceChanged += new Microsoft.Win32.UserPreferenceChangedEventHandler(PreferenceChanged); this.IsAccessible = true; m_SystemButtons.MouseDownAutoHideChanged += new EventHandler(this.SysButtonHideTooltip); m_SystemButtons.MouseDownCloseChanged += new EventHandler(this.SysButtonHideTooltip); m_SystemButtons.MouseDownCustomizeChanged += new EventHandler(this.SysButtonHideTooltip); m_SystemButtons.MouseOverAutoHideChanged += new EventHandler(this.SysButtonMouseOverAutoHide); m_SystemButtons.MouseOverCustomizeChanged += new EventHandler(this.SysButtonMouseOverCustomize); m_SystemButtons.MouseOverCloseChanged += new EventHandler(this.SysButtonMouseOverClose); }
private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e) { if(this.BackColor==SystemColors.Info) { // Switch to Office 2003 style colors... ColorScheme scheme=new ColorScheme(eDotNetBarStyle.Office2003); this.BackColor=scheme.ItemCheckedBackground; this.BackColor2=scheme.ItemCheckedBackground2; this.BackColorGradientAngle=scheme.ItemCheckedBackgroundGradientAngle; this.Refresh(); } else { this.BackColor=SystemColors.Info; this.BackColor2=Color.Empty; this.Refresh(); } }
public BarBaseControl() { if(!ColorFunctions.ColorsLoaded) { NativeFunctions.RefreshSettings(); NativeFunctions.OnDisplayChange(); ColorFunctions.LoadColors(); } this.SetStyle(ControlStyles.UserPaint,true); this.SetStyle(ControlStyles.AllPaintingInWmPaint,true); this.SetStyle(ControlStyles.Opaque,true); this.SetStyle(ControlStyles.ResizeRedraw,true); this.SetStyle(DisplayHelp.DoubleBufferFlag,true); try { m_MoveCursor=new Cursor(typeof(DevComponents.DotNetBar.DotNetBarManager),"DRAGMOVE.CUR"); m_CopyCursor=new Cursor(typeof(DevComponents.DotNetBar.DotNetBarManager),"DRAGCOPY.CUR"); m_NACursor=new Cursor(typeof(DevComponents.DotNetBar.DotNetBarManager),"DRAGNONE.CUR"); } catch(Exception) { m_MoveCursor=null; m_CopyCursor=null; m_NACursor=null; } m_ColorScheme=new ColorScheme(eDotNetBarStyle.Office2003); m_BackgroundStyle.BackColor1.Color=SystemColors.Control; m_BackgroundStyle.VisualPropertyChanged+=new EventHandler(this.VisualPropertyChanged); this.IsAccessible=true; }
/// <summary> /// Creates new instance of the class. /// </summary> public VS2005TabDisplay(AutoHidePanel autoHidePanel, ColorScheme colorScheme) { m_AutoHidePanel=autoHidePanel; m_ColorScheme=colorScheme; }
public PopupItemControl() { PainterFactory.InitFactory(); if (!ColorFunctions.ColorsLoaded) { NativeFunctions.RefreshSettings(); NativeFunctions.OnDisplayChange(); ColorFunctions.LoadColors(); } m_PopupItem = CreatePopupItem(); m_PopupItem.GlobalItem = false; m_PopupItem.ContainerControl = this; m_PopupItem.Style = eDotNetBarStyle.Office2007; m_PopupItem.SetOwner(this); m_ColorScheme = new ColorScheme(m_PopupItem.EffectiveStyle); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.Opaque, true); this.SetStyle(ControlStyles.ResizeRedraw, true); this.SetStyle(DisplayHelp.DoubleBufferFlag, true); this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.SetStyle(ControlStyles.ContainerControl, false); this.SetStyle(ControlStyles.Selectable, true); }
/// <summary>Creates new instance of the class.</summary> public AdvTree() { if (!ColorFunctions.ColorsLoaded) { NativeFunctions.RefreshSettings(); NativeFunctions.OnDisplayChange(); ColorFunctions.LoadColors(); } m_SelectedNodes.TreeSelectionControl = this; this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.Opaque, true); this.SetStyle(ControlStyles.ResizeRedraw, true); this.SetStyle(ControlStyles.DoubleBuffer, true); this.SetStyle(ControlStyles.Selectable, true); // This call is required by the Windows.Forms Form Designer. InitializeComponent(); m_BackgroundStyle.StyleChanged += new EventHandler(ElementStyleChanged); m_BackgroundStyle.TreeControl = this; m_Columns.Parent = this; // Setup layout helper m_NodeLayout = new NodeTreeLayout(this, this.ClientRectangle, _LayoutSettings); _LayoutSettings.NodeVerticalSpacing = _NodeSpacing; m_NodeLayout.LeftRight = this.RtlTranslateLeftRight(LeftRightAlignment.Left); #if TRIAL NodeOperations.ColorExpAlt(); #endif // Setup display helper m_NodeDisplay = new NodeTreeDisplay(this); m_Headers = new HeadersCollection(); m_Nodes.TreeControl = this; m_Styles.TreeControl = this; m_ColorScheme = new ColorScheme(eColorSchemeStyle.Office2007); //m_SelectionBoxBorderColor=GetDefaultSelectionBoxBorderColor(); //m_SelectionBoxFillColor=GetDefaultSelectionBoxFillColor(); m_ExpandButtonSize = GetDefaultExpandButtonSize(); this.AllowDrop = true; this.IsAccessible = true; if (BarFunctions.IsWindows7 && DevComponents.DotNetBar.Touch.TouchHandler.IsTouchEnabled) { _TouchHandler = new DevComponents.DotNetBar.Touch.TouchHandler(this, DevComponents.DotNetBar.Touch.eTouchHandlerType.Gesture); _TouchHandler.PanBegin += new EventHandler<DevComponents.DotNetBar.Touch.GestureEventArgs>(TouchHandlerPanBegin); _TouchHandler.Pan += new EventHandler<DevComponents.DotNetBar.Touch.GestureEventArgs>(TouchHandlerPan); _TouchHandler.PanEnd += new EventHandler<DevComponents.DotNetBar.Touch.GestureEventArgs>(TouchHandlerPanEnd); } }
/// <summary> /// Generates VS2005 style color scheme. /// </summary> private void GenerateVS2005ColorScheme(bool dockStyle) { eWinXPColorScheme xpc=BarFunctions.WinXPColorScheme; ColorScheme cs=new ColorScheme(eDotNetBarStyle.VS2005); switch(xpc) { case eWinXPColorScheme.Blue: { // Tab Control Section if (!m_TabBackgroundCustom) m_TabBackground = GetColor("F4F2E8"); if(!m_TabBackground2Custom) m_TabBackground2=Color.Empty; //m_TabBackgroundGradientAngle=90; if(!m_TabBorderCustom) m_TabBorder=GetColor("ACA899"); // Tab Item Section if (!m_TabItemBorderCustom) { if(dockStyle) m_TabItemBorder = GetColor("ACA899"); else m_TabItemBorder = Color.Empty; // GetColor("ACA899"); } if(!m_TabItemBorderLightCustom) m_TabItemBorderLight=Color.Empty; if(!m_TabItemBorderDarkCustom) m_TabItemBorderDark=Color.Empty; if (!m_TabItemBackgroundCustom) m_TabItemBackground = GetColor("F4F2E8"); if (!m_TabItemBackground2Custom) m_TabItemBackground2 = Color.Empty; // GetColor("FEFDFD"); //m_TabItemBackgroundGradientAngle=90; if(!m_TabItemTextCustom) m_TabItemText=SystemColors.ControlText; // Tab Panel Section if(!m_TabPanelBackgroundCustom) m_TabPanelBackground=m_TabItemBackground; if(!m_TabPanelBackground2Custom) m_TabPanelBackground2=Color.White; //m_TabPanelBackgroundGradientAngle=90; if(!m_TabPanelBorderCustom) m_TabPanelBorder=m_TabBorder; // Tab Item Hot Section if(!m_TabItemHotBorderCustom) m_TabItemHotBorder=Color.Empty; if(!m_TabItemHotBorderLightCustom) m_TabItemHotBorderLight=Color.Empty; if(!m_TabItemHotBorderDarkCustom) m_TabItemHotBorderDark=Color.Empty; if(!m_TabItemHotBackgroundCustom) m_TabItemHotBackground=Color.Empty; if(!m_TabItemHotBackground2Custom) m_TabItemHotBackground2=Color.Empty; //m_TabItemHotBackgroundGradientAngle=90; if(!m_TabItemHotTextCustom) m_TabItemHotText=SystemColors.ControlText; // Tab Item Selected Section if (!m_TabItemSelectedBorderCustom) m_TabItemSelectedBorder = GetColor("ACA899"); if(!m_TabItemSelectedBorderLightCustom) m_TabItemSelectedBorderLight=Color.Empty; if(!m_TabItemSelectedBorderDarkCustom) m_TabItemSelectedBorderDark=Color.Empty; if(!m_TabItemSelectedBackgroundCustom) m_TabItemSelectedBackground=Color.White; if(!m_TabItemSelectedBackground2Custom) m_TabItemSelectedBackground2=Color.Empty; //m_TabItemSelectedBackgroundGradientAngle=90; if(!m_TabItemSelectedTextCustom) m_TabItemSelectedText=SystemColors.ControlText; break; } case eWinXPColorScheme.Silver: { // Tab Control Section if(!m_TabBackgroundCustom) m_TabBackground=GetColor("E7E7EF"); if(!m_TabBackground2Custom) m_TabBackground2=Color.Empty; //m_TabBackgroundGradientAngle=90; if(!m_TabBorderCustom) m_TabBorder=GetColor("9D9DA1"); // Tab Item Section if (!m_TabItemBorderCustom) { if(dockStyle) m_TabItemBorder = m_TabBorder; else m_TabItemBorder = Color.Empty; //m_TabBorder; } if(!m_TabItemBorderLightCustom) m_TabItemBorderLight=Color.Empty; if(!m_TabItemBorderDarkCustom) m_TabItemBorderDark=Color.Empty; if (!m_TabItemBackgroundCustom) m_TabItemBackground = GetColor("E7E7EF"); if (!m_TabItemBackground2Custom) m_TabItemBackground2 = Color.Empty; //GetColor("FEFEFE"); //m_TabItemBackgroundGradientAngle=90; if(!m_TabItemTextCustom) m_TabItemText=SystemColors.ControlText; // Tab Panel Section if(!m_TabPanelBackgroundCustom) m_TabPanelBackground=m_TabItemBackground; if(!m_TabPanelBackground2Custom) m_TabPanelBackground2=Color.White; //m_TabPanelBackgroundGradientAngle=90; if(!m_TabPanelBorderCustom) m_TabPanelBorder=m_TabItemBorder; // Tab Item Hot Section if(!m_TabItemHotBorderCustom) m_TabItemHotBorder=Color.Empty; if(!m_TabItemHotBorderLightCustom) m_TabItemHotBorderLight=Color.Empty; if(!m_TabItemHotBorderDarkCustom) m_TabItemHotBorderDark=Color.Empty; if(!m_TabItemHotBackgroundCustom) m_TabItemHotBackground=Color.Empty; if(!m_TabItemHotBackground2Custom) m_TabItemHotBackground2=Color.Empty; //m_TabItemHotBackgroundGradientAngle=90; if(!m_TabItemHotTextCustom) m_TabItemHotText=SystemColors.ControlText; // Tab Item Selected Section if(!m_TabItemSelectedBorderCustom) m_TabItemSelectedBorder=m_TabBorder; if(!m_TabItemSelectedBorderLightCustom) m_TabItemSelectedBorderLight=Color.Empty; if(!m_TabItemSelectedBorderDarkCustom) m_TabItemSelectedBorderDark=Color.Empty; if(!m_TabItemSelectedBackgroundCustom) m_TabItemSelectedBackground=Color.White; if(!m_TabItemSelectedBackground2Custom) m_TabItemSelectedBackground2=Color.Empty; //m_TabItemSelectedBackgroundGradientAngle=90; if(!m_TabItemSelectedTextCustom) m_TabItemSelectedText=SystemColors.ControlText; break; } case eWinXPColorScheme.OliveGreen: { // Tab Control Section if(!m_TabBackgroundCustom) m_TabBackground=GetColor("F4F2E9"); if(!m_TabBackground2Custom) m_TabBackground2=Color.Empty; //m_TabBackgroundGradientAngle=90; if(!m_TabBorderCustom) m_TabBorder=GetColor("ACA899"); // Tab Item Section if (!m_TabItemBorderCustom) { if(dockStyle) m_TabItemBorder = m_TabBorder; else m_TabItemBorder = Color.Empty; //m_TabBorder; } if(!m_TabItemBorderLightCustom) m_TabItemBorderLight=Color.Empty; if(!m_TabItemBorderDarkCustom) m_TabItemBorderDark=Color.Empty; if(!m_TabItemBackgroundCustom) m_TabItemBackground=GetColor("F4F2E9"); if(!m_TabItemBackground2Custom) m_TabItemBackground2= Color.Empty; //GetColor("FEFDFD"); //m_TabItemBackgroundGradientAngle=90; if(!m_TabItemTextCustom) m_TabItemText=SystemColors.ControlText; // Tab Panel Section if(!m_TabPanelBackgroundCustom) m_TabPanelBackground=m_TabItemBackground; if(!m_TabPanelBackground2Custom) m_TabPanelBackground2=Color.White; //m_TabPanelBackgroundGradientAngle=90; if(!m_TabPanelBorderCustom) m_TabPanelBorder=m_TabBorder; // Tab Item Hot Section if(!m_TabItemHotBorderCustom) m_TabItemHotBorder=Color.Empty; if(!m_TabItemHotBorderLightCustom) m_TabItemHotBorderLight=Color.Empty; if(!m_TabItemHotBorderDarkCustom) m_TabItemHotBorderDark=Color.Empty; if(!m_TabItemHotBackgroundCustom) m_TabItemHotBackground=Color.Empty; if(!m_TabItemHotBackground2Custom) m_TabItemHotBackground2=Color.Empty; //m_TabItemHotBackgroundGradientAngle=90; if(!m_TabItemHotTextCustom) m_TabItemHotText=SystemColors.ControlText; // Tab Item Selected Section if(!m_TabItemSelectedBorderCustom) m_TabItemSelectedBorder=GetColor("ACA899"); if(!m_TabItemSelectedBorderLightCustom) m_TabItemSelectedBorderLight=Color.Empty; if(!m_TabItemSelectedBorderDarkCustom) m_TabItemSelectedBorderDark=Color.Empty; if(!m_TabItemSelectedBackgroundCustom) m_TabItemSelectedBackground=Color.White; if(!m_TabItemSelectedBackground2Custom) m_TabItemSelectedBackground2=Color.Empty; //m_TabItemSelectedBackgroundGradientAngle=90; if(!m_TabItemSelectedTextCustom) m_TabItemSelectedText=SystemColors.ControlText; break; } default: { // Tab Control Section if(!m_TabBackgroundCustom) m_TabBackground=cs.BarBackground; if(!m_TabBackground2Custom) m_TabBackground2=Color.Empty; //m_TabBackgroundGradientAngle=90; if(!m_TabBorderCustom) m_TabBorder=cs.BarBackground2; // Tab Item Section if (!m_TabItemBorderCustom) { if(dockStyle) m_TabItemBorder = m_TabBorder; else m_TabItemBorder = Color.Empty; //m_TabBorder; } if(!m_TabItemBorderLightCustom) m_TabItemBorderLight=Color.Empty; if(!m_TabItemBorderDarkCustom) m_TabItemBorderDark=Color.Empty; if(!m_TabItemBackgroundCustom) m_TabItemBackground=m_TabBackground; if(!m_TabItemBackground2Custom) m_TabItemBackground2=Color.Empty; // System.Windows.Forms.ControlPaint.Light(cs.BarBackground); //m_TabItemBackgroundGradientAngle=90; if(!m_TabItemTextCustom) m_TabItemText=SystemColors.ControlText; // Tab Panel Section if(!m_TabPanelBackgroundCustom) m_TabPanelBackground=m_TabItemBackground; if(!m_TabPanelBackground2Custom) m_TabPanelBackground2=ControlPaint.LightLight(m_TabItemBackground); //m_TabPanelBackgroundGradientAngle=90; if(!m_TabPanelBorderCustom) m_TabPanelBorder=Color.Empty; // Tab Item Hot Section if(!m_TabItemHotBorderCustom) m_TabItemHotBorder=Color.Empty; if(!m_TabItemHotBorderLightCustom) m_TabItemHotBorderLight=Color.Empty; if(!m_TabItemHotBorderDarkCustom) m_TabItemHotBorderDark=Color.Empty; if(!m_TabItemHotBackgroundCustom) m_TabItemHotBackground=Color.Empty; if(!m_TabItemHotBackground2Custom) m_TabItemHotBackground2=Color.Empty; //m_TabItemHotBackgroundGradientAngle=90; if(!m_TabItemHotTextCustom) m_TabItemHotText=Color.Empty; // Tab Item Selected Section if(!m_TabItemSelectedBorderCustom) m_TabItemSelectedBorder=cs.BarFloatingBorder; if(!m_TabItemSelectedBorderLightCustom) m_TabItemSelectedBorderLight=Color.Empty; if(!m_TabItemSelectedBorderDarkCustom) m_TabItemSelectedBorderDark=Color.Empty; if (!m_TabItemSelectedBackgroundCustom) m_TabItemSelectedBackground = System.Windows.Forms.ControlPaint.LightLight(cs.BarBackground); if (!m_TabItemSelectedBackground2Custom) m_TabItemSelectedBackground2 = Color.Empty; // System.Windows.Forms.ControlPaint.Light(m_TabItemBackground2); //m_TabItemSelectedBackgroundGradientAngle=90; if(!m_TabItemSelectedTextCustom) m_TabItemSelectedText=SystemColors.ControlText; break; } } if (!m_TabItemSeparatorCustom) m_TabItemSeparator = m_TabItemSelectedBorder; if (!m_TabItemSeparatorShadeCustom) m_TabItemSeparatorShade = m_TabItemSelectedBorderLight; // Tab Panel Section // if(!m_TabPanelBackgroundCustom) m_TabPanelBackground=m_TabItemSelectedBackground2; // if(!m_TabPanelBackground2Custom) m_TabPanelBackground2=m_TabItemSelectedBackground; // m_TabPanelBackgroundGradientAngle=90; // if(!m_TabPanelBorderCustom) m_TabPanelBorder=m_TabItemSelectedBorder; }
private ColorScheme GetColorScheme() { ColorScheme scheme = null; Control cc = this.ContainerControl as Control; if (cc is Bar) scheme = ((Bar)cc).ColorScheme; else if (cc is MenuPanel) scheme = ((MenuPanel)cc).ColorScheme; else if (cc is ItemControl) scheme = ((ItemControl)cc).ColorScheme; else if (cc is BaseItemControl) scheme = ((BaseItemControl)cc).ColorScheme; if (scheme == null) scheme = new ColorScheme(this.EffectiveStyle); return scheme; }
/// <summary> /// Creates new instance of the object. /// </summary> public ExpandableSplitter():base() { this.SetStyle(ControlStyles.UserPaint,true); this.SetStyle(ControlStyles.AllPaintingInWmPaint,true); this.SetStyle(ControlStyles.Opaque,true); this.SetStyle(ControlStyles.ResizeRedraw,true); this.SetStyle(DisplayHelp.DoubleBufferFlag,true); if(!ColorFunctions.ColorsLoaded) { NativeFunctions.RefreshSettings(); NativeFunctions.OnDisplayChange(); ColorFunctions.LoadColors(); } m_ColorScheme=new ColorScheme(eDotNetBarStyle.Office2003); this.ApplyStyle(eSplitterStyle.Office2003); StyleManager.Register(this); }
public static void SetExplorerBarStyle(ExplorerBar bar, eExplorerBarStockStyle stockStyle) { if (stockStyle == eExplorerBarStockStyle.SystemColors) { bar.BackStyle.Reset(); bar.BackStyle.BackColorSchemePart = eColorSchemePart.ExplorerBarBackground; bar.BackStyle.BackColor2SchemePart = eColorSchemePart.ExplorerBarBackground2; bar.BackStyle.BackColorGradientAngle = bar.ColorScheme.ExplorerBarBackgroundGradientAngle; } else if (stockStyle != eExplorerBarStockStyle.Custom) { ePredefinedColorScheme scheme = ePredefinedColorScheme.Blue2003; if (stockStyle == eExplorerBarStockStyle.Silver || stockStyle == eExplorerBarStockStyle.SilverSpecial) scheme = ePredefinedColorScheme.Silver2003; else if (stockStyle == eExplorerBarStockStyle.OliveGreen || stockStyle == eExplorerBarStockStyle.OliveGreenSpecial) scheme = ePredefinedColorScheme.OliveGreen2003; ColorScheme cs = new ColorScheme(eDotNetBarStyle.Office2003); cs.PredefinedColorScheme = scheme; bar.BackStyle.Reset(); bar.BackStyle.BackColor = cs.ExplorerBarBackground; bar.BackStyle.BackColor2 = cs.ExplorerBarBackground2; bar.BackStyle.BackColorGradientAngle = cs.ExplorerBarBackgroundGradientAngle; } }
private static void ChangeOffice2007ColorTable(Control cont, ColorScheme cs) { bool enumChildControls = true; if (cont is PanelEx && ((PanelEx)cont).ColorSchemeStyle == eDotNetBarStyle.Office2007) { PanelEx pe = cont as PanelEx; pe.ColorSchemeStyle = eDotNetBarStyle.Office2007; cont.Invalidate(); } if (cont is PanelControl && ((PanelControl)cont).EffectiveColorSchemeStyle == eDotNetBarStyle.Office2007) { PanelControl pc = cont as PanelControl; pc.RefreshStyleSystemColors(); pc.Invalidate(); } else if (cont is ExpandablePanel && ((ExpandablePanel)cont).ColorSchemeStyle == eDotNetBarStyle.Office2007) { //ExpandablePanel ep = cont as ExpandablePanel; //ep.ColorScheme = cs; cont.Invalidate(); } else if (cont is RibbonControl) { ((RibbonControl)cont).RibbonStrip.InitDefaultStyles(); cont.Invalidate(true); //RibbonControl rc = cont as RibbonControl; //SetRibbonControlStyle(rc, eDotNetBarStyle.Office2007); //enumChildControls = false; } else if (cont is RibbonBar) { cont.Invalidate(); //RibbonBar rb = cont as RibbonBar; //ApplyOffice2007ColorScheme(rb); } else if (cont is TabControl) { TabControl tc = cont as TabControl; if (tc.Style == eTabStripStyle.Office2007Dock || tc.Style == eTabStripStyle.Office2007Document) tc.Style = tc.Style; } else if (cont is TabStrip) { TabStrip ts = cont as TabStrip; if (ts.Style == eTabStripStyle.Office2007Dock || ts.Style == eTabStripStyle.Office2007Document) ts.Style = ts.Style; } else if (cont is SideBar) { SideBar sb = cont as SideBar; if (sb.Style == eDotNetBarStyle.Office2007) sb.Invalidate(); } else if (cont is RibbonForm) { cont.BackColor = ((Office2007Renderer)GlobalManager.Renderer).ColorTable.Form.BackColor; if (cont is OfficeForm) ((OfficeForm)cont).InvalidateNonClient(true); } else if (cont is DockSite && cont.Dock == DockStyle.Top) { // Update any floating bars through DotNetBarManager DockSite ds = cont as DockSite; if (ds.Owner != null) { foreach (Bar bar in ds.Owner.Bars) { if (bar.DockSide == eDockSide.None) { bar.Invalidate(true); ChangeOffice2007ColorTable(bar, cs); } } } } else if (cont is Controls.ComboBoxEx) ((Controls.ComboBoxEx)cont).Style = ((Controls.ComboBoxEx)cont).Style; else if (cont is NavigationPane) ((NavigationPane)cont).Office2007ColorTableChanged(); else if (cont is BaseItemControl && ((BaseItemControl)cont).Style == eDotNetBarStyle.Office2007) cont.Invalidate(); #if FRAMEWORK20 else if (cont is Controls.ListViewEx) { Controls.ListViewEx lv = cont as Controls.ListViewEx; lv.Invalidate(true); lv.ResetCachedColorTableReference(); } else if (cont is Controls.DataGridViewX) cont.Invalidate(true); else if (cont is Controls.DGHScrollBar || cont is Controls.DGVScrollBar) cont.Invalidate(); else if (cont is DevComponents.DotNetBar.Controls.WarningBox) ((DevComponents.DotNetBar.Controls.WarningBox)cont).UpdateColorScheme(); #endif #if !NOTREE else if (cont is AdvTree.AdvTree) cont.Invalidate(); #endif if (enumChildControls) { foreach (Control c in cont.Controls) ChangeOffice2007ColorTable(c, cs); } }
private NodeCellRendererEventArgs GetCellDisplayInfo(ElementStyle style, Graphics g, Cell cell, Point cellOffset, ColorScheme cs) { m_CellDisplayInfo.Cell=cell; m_CellDisplayInfo.Graphics=g; m_CellDisplayInfo.Style=style; m_CellDisplayInfo.CellOffset=cellOffset; m_CellDisplayInfo.ColorScheme = cs; return m_CellDisplayInfo; }
/// <summary> /// Apply default splitter style colors. /// </summary> /// <param name="style">Style colors to apply.</param> public void ApplyStyle(eSplitterStyle style) { if(style==eSplitterStyle.Office2003) { m_ColorScheme=new ColorScheme(eDotNetBarStyle.Office2003); this.BackColorSchemePart=eColorSchemePart.PanelBackground; this.BackColor2SchemePart=eColorSchemePart.PanelBorder; this.GripLightColorSchemePart=eColorSchemePart.BarBackground; this.GripDarkColorSchemePart=eColorSchemePart.ItemText; this.ExpandFillColorSchemePart=eColorSchemePart.PanelBorder; this.ExpandLineColorSchemePart=eColorSchemePart.ItemText; this.HotBackColorSchemePart=eColorSchemePart.ItemPressedBackground; this.HotBackColor2SchemePart=eColorSchemePart.ItemPressedBackground2; this.HotGripLightColorSchemePart=eColorSchemePart.BarBackground; this.HotGripDarkColorSchemePart=eColorSchemePart.PanelBorder; this.HotExpandFillColorSchemePart=eColorSchemePart.PanelBorder; this.HotExpandLineColorSchemePart=eColorSchemePart.ItemText; } else if (style == eSplitterStyle.Office2007) { m_ColorScheme = new ColorScheme(eDotNetBarStyle.Office2007); this.BackColorSchemePart = eColorSchemePart.PanelBackground; this.BackColor2SchemePart = eColorSchemePart.PanelBorder; this.GripLightColorSchemePart = eColorSchemePart.BarBackground; this.GripDarkColorSchemePart = eColorSchemePart.ItemText; this.ExpandFillColorSchemePart = eColorSchemePart.PanelBorder; this.ExpandLineColorSchemePart = eColorSchemePart.ItemText; this.HotBackColorSchemePart = eColorSchemePart.ItemPressedBackground; this.HotBackColor2SchemePart = eColorSchemePart.ItemPressedBackground2; this.HotGripLightColorSchemePart = eColorSchemePart.BarBackground; this.HotGripDarkColorSchemePart = eColorSchemePart.PanelBorder; this.HotExpandFillColorSchemePart = eColorSchemePart.PanelBorder; this.HotExpandLineColorSchemePart = eColorSchemePart.ItemText; } else if(style==eSplitterStyle.Mozilla) { m_ColorScheme=new ColorScheme(eDotNetBarStyle.VS2005); this.BackColorSchemePart=eColorSchemePart.None; this.BackColor=SystemColors.ControlLight; this.BackColor2SchemePart=eColorSchemePart.None; this.BackColor2=Color.Empty; this.GripLightColorSchemePart=eColorSchemePart.MenuBackground; this.GripDarkColorSchemePart=eColorSchemePart.ItemPressedBorder; this.ExpandFillColorSchemePart=eColorSchemePart.ItemPressedBackground; this.ExpandLineColorSchemePart=eColorSchemePart.ItemPressedBorder; this.HotBackColorSchemePart=eColorSchemePart.ItemCheckedBackground; this.HotBackColor2=Color.Empty; this.HotBackColor2SchemePart=eColorSchemePart.None; this.HotGripLightColorSchemePart=eColorSchemePart.MenuBackground; this.HotGripDarkColorSchemePart=eColorSchemePart.ItemPressedBorder; this.HotExpandFillColorSchemePart=eColorSchemePart.ItemPressedBackground; this.HotExpandLineColorSchemePart=eColorSchemePart.ItemPressedBorder; } }