Ejemplo n.º 1
0
 private void SetMainFormStyle(eStyle estyle, eTabStripStyle etabStripStyle, eDotNetBarStyle edotNetBarStyle)
 {
     this.styleManager.ManagerStyle = estyle;
     this.tabControlMain.Style = etabStripStyle;
     this.navigationBar.Style = edotNetBarStyle;
     this.dotNetBarManager.Style = edotNetBarStyle;
 }
Ejemplo n.º 2
0
        ///TODO:此处功能还需完善,tab 和 树的皮肤不一致,建议去除无效皮肤
        ///
        /// <summary>
        /// 更改皮肤
        /// </summary>
        /// <param name="style"></param>
        private void ChangeDotNetBarStyle(eDotNetBarStyle style)
        {
            dotNetBarManagerMain.Style = style;

            //if (dotNetBarManagerMain.IsThemeActive)
            //{
            //    barStand.RecalcLayout();
            //}
            if (style == eDotNetBarStyle.Office2003)
            {
                tabControlMain.Style = eTabStripStyle.OneNote;
            }
            else if (style == eDotNetBarStyle.Office2007)
            {
                tabControlMain.Style = eTabStripStyle.Office2007Document;
            }
            else if (style == eDotNetBarStyle.VS2005)
            {
                tabControlMain.Style = eTabStripStyle.VS2005;
            }
            else
            {
                tabControlMain.Style = eTabStripStyle.Flat;
            }
        }
Ejemplo n.º 3
0
        private void ChangeDotNetBarStyle(eDotNetBarStyle style)
        {
            ((ButtonItem)dotNetBarManager1.GetItem("bStyle2000")).Checked = (style == eDotNetBarStyle.Office2000);
            ((ButtonItem)dotNetBarManager1.GetItem("bStyle2003")).Checked = (style == eDotNetBarStyle.Office2003);
            ((ButtonItem)dotNetBarManager1.GetItem("bStyleXP")).Checked   = (style == eDotNetBarStyle.OfficeXP);

            dotNetBarManager1.Style = style;
            if (style == eDotNetBarStyle.Office2003 || style == eDotNetBarStyle.OfficeXP)
            {
                if (dotNetBarManager1.IsThemeActive)
                {
                    BaseItem item = dotNetBarManager1.GetItem("bThemes");
                    item.Visible = true;
                    ((Bar)item.ContainerControl).RecalcLayout();
                }
            }
            else if (dotNetBarManager1.IsThemeActive)
            {
                dotNetBarManager1.GetItem("bThemes").Visible = false;
            }

            if (style == eDotNetBarStyle.Office2003)
            {
                tabStrip1.Style = eTabStripStyle.OneNote;
                dotNetBarManager1.Bars["barTaskPane"].BackColor = Color.Empty;
                ((ControlContainerItem)dotNetBarManager1.GetItem("cTaskShowatstartup")).Control.BackColor = dotNetBarManager1.Bars[0].ColorScheme.BarBackground2;
            }
            else
            {
                tabStrip1.Style = eTabStripStyle.Flat;
                dotNetBarManager1.Bars["barTaskPane"].BackColor = Color.FromArgb(245, 245, 245);
                ((ControlContainerItem)dotNetBarManager1.GetItem("cTaskShowatstartup")).Control.BackColor = Color.FromArgb(245, 245, 245);
            }
        }
Ejemplo n.º 4
0
        public void StyleManagerStyleChanged(eDotNetBarStyle newStyle)
        {
            DGVScrollBar vsb = GetVScrollBar();
            if (vsb != null && vsb.Visible) vsb.Invalidate();

            DGHScrollBar hsb = GetHScrollBar();
            if (hsb != null && hsb.Visible) hsb.Invalidate();

            // Update Style
            Office2007ColorTable ct = null;
            if (GlobalManager.Renderer is Office2007Renderer)
            {
                ct = ((Office2007Renderer)GlobalManager.Renderer).ColorTable;
                m_ColorTable = ct.DataGridView;
                m_ButtonStateColorTable = ct.ButtonItemColors[0].Checked;
            }
            try // Don't like to do this but bug in GridColor setter requires it
            {
                if (!_UseCustomBackgroundColor)
                    this.BackgroundColor = m_ColorTable.BackgroundColor;
                this.ColumnHeadersDefaultCellStyle.ForeColor = m_ColorTable.ColumnHeaderNormalText;
                this.ColumnHeadersDefaultCellStyle.SelectionForeColor = m_ColorTable.ColumnHeaderSelectedText;
                this.DefaultCellStyle.BackColor = m_ColorTable.DefaultCellBackground;
                this.DefaultCellStyle.ForeColor = m_ColorTable.DefaultCellText;
                if (this.PaintEnhancedSelection)
                    this.DefaultCellStyle.SelectionForeColor = m_ButtonStateColorTable.Text;
                this.GridColor = m_ColorTable.GridColor;
                this.RowHeadersDefaultCellStyle.ForeColor = m_ColorTable.ColumnHeaderNormalText;
                this.RowHeadersDefaultCellStyle.SelectionForeColor = m_ColorTable.ColumnHeaderSelectedText;
                this.EnableHeadersVisualStyles = false;
            }
            catch { }
        }
Ejemplo n.º 5
0
        private void ChangeDotNetBarStyle(eDotNetBarStyle style)
        {
            cmdStyleOffice2007Blue.Checked = (style == eDotNetBarStyle.Office2007);
            cmdStyleOffice2003.Checked     = (style == eDotNetBarStyle.Office2003);
            cmdStyleOfficeXP.Checked       = (style == eDotNetBarStyle.OfficeXP);
            cmdStyleVS2005.Checked         = (style == eDotNetBarStyle.VS2005);

            //explorerBar1.ColorScheme = new DevComponents.DotNetBar.ColorScheme(style);

            dotNetBarManager1.Style = style;
            if (style == eDotNetBarStyle.Office2003 || style == eDotNetBarStyle.OfficeXP || style == eDotNetBarStyle.VS2005)
            {
                if (dotNetBarManager1.IsThemeActive)
                {
                    //bThemes.Visible = true;
                    barStandard.RecalcLayout();
                }
            }
            else if (dotNetBarManager1.IsThemeActive)
            {
                //bThemes.Visible = false;
                barStandard.RecalcLayout();
            }

            if (style == eDotNetBarStyle.Office2003)
            {
                tabStrip1.Style = eTabStripStyle.OneNote;
            }
            else if (style == eDotNetBarStyle.Office2007)
            {
                tabStrip1.Style = eTabStripStyle.Office2007Document;
            }
            else if (style == eDotNetBarStyle.VS2005)
            {
                tabStrip1.Style = eTabStripStyle.VS2005;
            }
            else
            {
                tabStrip1.Style = eTabStripStyle.Flat;
            }

            // Status bar style
            bar1.Style = style;

            foreach (Form frm in this.MdiChildren)
            {
                /*if (frm is NPCForm)
                 * {
                 *  ((NPCForm)frm).dotNetBarManager1.Style = style;
                 *  return;
                 * }
                 * if (frm is SkillForm)
                 * {
                 *  ((SkillForm)frm).dotNetBarManager1.Style = style;
                 *  return;
                 * }*/
            }
        }
Ejemplo n.º 6
0
        private void ChangeDotNetBarStyle(eDotNetBarStyle style)
        {
            cmdStyleOffice2007Blue.Checked = (style == eDotNetBarStyle.Office2007);
            cmdStyleOffice2003.Checked = (style == eDotNetBarStyle.Office2003);
            cmdStyleOfficeXP.Checked = (style == eDotNetBarStyle.OfficeXP);
            cmdStyleVS2005.Checked = (style == eDotNetBarStyle.VS2005);

            //explorerBar1.ColorScheme = new DevComponents.DotNetBar.ColorScheme(style);

            dotNetBarManager1.Style = style;
            if (style == eDotNetBarStyle.Office2003 || style == eDotNetBarStyle.OfficeXP || style == eDotNetBarStyle.VS2005)
            {
                if (dotNetBarManager1.IsThemeActive)
                {
                    //bThemes.Visible = true;
                    barStandard.RecalcLayout();
                }
            }
            else if (dotNetBarManager1.IsThemeActive)
            {
                //bThemes.Visible = false;
                barStandard.RecalcLayout();
            }

            if (style == eDotNetBarStyle.Office2003)
            {
                tabStrip1.Style = eTabStripStyle.OneNote;
            }
            else if (style == eDotNetBarStyle.Office2007)
            {
                tabStrip1.Style = eTabStripStyle.Office2007Document;
            }
            else if (style == eDotNetBarStyle.VS2005)
            {
                tabStrip1.Style = eTabStripStyle.VS2005;
            }
            else
            {
                tabStrip1.Style = eTabStripStyle.Flat;
            }

            // Status bar style
            bar1.Style = style;

            foreach (Form frm in this.MdiChildren)
            {
                /*if (frm is NPCForm)
                {
                    ((NPCForm)frm).dotNetBarManager1.Style = style;
                    return;
                }
                if (frm is SkillForm)
                {
                    ((SkillForm)frm).dotNetBarManager1.Style = style;
                    return;
                }*/
            }
        }
Ejemplo n.º 7
0
 public RibbonTabGroupRendererEventArgs(Graphics g, RibbonTabItemGroup group, Rectangle bounds, Rectangle groupBounds, Font font, ItemPaintArgs pa, eDotNetBarStyle effectiveStyle)
 {
     this.Graphics = g;
     this.RibbonTabItemGroup = group;
     this.Bounds = bounds;
     this.GroupBounds = groupBounds;
     this.GroupFont = font;
     this.ItemPaintArgs = pa;
     this.EffectiveStyle = effectiveStyle;
 }
Ejemplo n.º 8
0
        private void ChangeDotNetBarStyle(eDotNetBarStyle style)
        {
            cmdStyleOffice2007Blue.Checked = (style == eDotNetBarStyle.Office2007);
            cmdStyleOffice2003.Checked     = (style == eDotNetBarStyle.Office2003);
            cmdStyleOfficeXP.Checked       = (style == eDotNetBarStyle.OfficeXP);
            cmdStyleVS2005.Checked         = (style == eDotNetBarStyle.VS2005);

            //explorerBar1.ColorScheme = new DevComponents.DotNetBar.ColorScheme(style);

            dotNetBarManager1.Style = style;
            if (style == eDotNetBarStyle.Office2003 || style == eDotNetBarStyle.OfficeXP || style == eDotNetBarStyle.VS2005)
            {
                if (dotNetBarManager1.IsThemeActive)
                {
                    //bThemes.Visible = true;
                    barStandard.RecalcLayout();
                }
            }
            else if (dotNetBarManager1.IsThemeActive)
            {
                //bThemes.Visible = false;
                barStandard.RecalcLayout();
            }

            if (style == eDotNetBarStyle.Office2003)
            {
                tabStrip1.Style = eTabStripStyle.OneNote;
            }
            else if (style == eDotNetBarStyle.Office2007)
            {
                tabStrip1.Style = eTabStripStyle.Office2007Document;
            }
            else if (style == eDotNetBarStyle.VS2005)
            {
                tabStrip1.Style = eTabStripStyle.VS2005;
            }
            else
            {
                tabStrip1.Style = eTabStripStyle.Flat;
            }

            // Status bar style
            bar1.Style = style;
        }
Ejemplo n.º 9
0
        private void UpdateUIStyle()
        {
            eDotNetBarStyle style = UIStyleUtils.GetDotNetBarStyle(UIStyle);

            toolBar.Style = style;

            // Do this to paint slider control correctly if style is not Office 2007
            if (UIStyle == UIStyle.VisualStudio2005)
            {
                UIStyleUtils.GetDotNetBarStyle(UIStyle.Office2007Silver);
            }
            else if (UIStyle == UIStyle.Office2003)
            {
                UIStyleUtils.GetDotNetBarStyle(UIStyle.Office2007Blue);
            }
            statusBar.Style = style;

            tabControl.Style     = UIStyleUtils.GetTabStripStyle(UIStyle);
            outlineControl.Style = UIStyle;
            foreach (PreviewTab tab in FDocuments)
            {
                tab.Style = UIStyle;
            }
        }
Ejemplo n.º 10
0
		public void AddBar(Bar bar)
		{
			if(bar.Style==eDotNetBarStyle.Office2003)
				m_Style=eDotNetBarStyle.Office2003;
			else if(bar.Style==eDotNetBarStyle.VS2005)
				m_Style=eDotNetBarStyle.VS2005;
            else if (bar.Style == eDotNetBarStyle.Office2007)
                m_Style = eDotNetBarStyle.Office2007;
            else if (bar.Style == eDotNetBarStyle.Office2010)
                m_Style = eDotNetBarStyle.Office2010;
            else if (bar.Style == eDotNetBarStyle.Windows7)
                m_Style = eDotNetBarStyle.Windows7;
            else if (bar.Style == eDotNetBarStyle.StyleManagerControlled)
                m_Style = bar.ItemsContainer.EffectiveStyle;
			else
				m_Style=eDotNetBarStyle.OfficeXP;

			PanelBar panel=new PanelBar(this,bar);
			m_Panels.Add(panel);
			if(this.Dock==DockStyle.Right || this.Dock==DockStyle.Left)
			{
				if(panel.PanelSize.Height>this.Width)
					this.Width=panel.PanelSize.Height;
			}
			else
			{
				if(panel.PanelSize.Height>this.Height)
					this.Height=panel.PanelSize.Height;
			}

			if(!this.Visible)
			{
				BarFunctions.SetControlVisible(this,true);
			}
			else
				this.Refresh();
			this.Parent.PerformLayout();
			this.Parent.Update();
		}
Ejemplo n.º 11
0
 public void StyleManagerStyleChanged(eDotNetBarStyle newStyle)
 {
     UpdateTabPanelStyle();
 }
Ejemplo n.º 12
0
		internal void SwitchStyle(eDotNetBarStyle style)
		{
			if(m_Style!=style)
			{
				m_Style=style;
				this.Refresh(null,true);
			}
		}
Ejemplo n.º 13
0
 public DockingHint(eDockingHintSide hintSide, eDotNetBarStyle style) : this(hintSide, false, style) { }
Ejemplo n.º 14
0
 public override void StyleManagerStyleChanged(eDotNetBarStyle newStyle)
 {
     UpdateColorScheme();
 }
Ejemplo n.º 15
0
        private void DrawMouseOverState(ItemPaintArgs p, eDotNetBarStyle effectiveStyle)
        {
            Rectangle rHover = this.DisplayRectangle;
            rHover.Inflate(-1, 0);
            Graphics g = p.Graphics;

            if (BarFunctions.IsOffice2007Style(effectiveStyle) && !(p.Owner is DotNetBarManager) && GlobalManager.Renderer is Office2007Renderer)
            {
                Office2007ButtonItemStateColorTable bt;
                if (this.Expanded)
                    bt = ((Office2007Renderer)GlobalManager.Renderer).ColorTable.ButtonItemColors[0].Expanded;
                else if (_IsPressed)
                    bt = ((Office2007Renderer)GlobalManager.Renderer).ColorTable.ButtonItemColors[0].Pressed;
                else
                    bt = ((Office2007Renderer)GlobalManager.Renderer).ColorTable.ButtonItemColors[0].MouseOver;
                Office2007ButtonItemPainter.PaintBackground(g, bt, rHover, _MenuShape);
            }
            else
            {
                if (!p.Colors.ItemHotBackground2.IsEmpty)
                {
                    System.Drawing.Drawing2D.LinearGradientBrush gradient = BarFunctions.CreateLinearGradientBrush(rHover, p.Colors.ItemHotBackground, p.Colors.ItemHotBackground2, p.Colors.ItemHotBackgroundGradientAngle);
                    g.FillRectangle(gradient, rHover);
                    gradient.Dispose();
                }
                else
                    g.FillRectangle(new SolidBrush(p.Colors.ItemHotBackground), rHover);
                NativeFunctions.DrawRectangle(g, new Pen(p.Colors.ItemHotBorder), rHover);
            }
        }
Ejemplo n.º 16
0
 public override void StyleManagerStyleChanged(eDotNetBarStyle newStyle)
 {
     base.StyleManagerStyleChanged(newStyle);
     UpdateButtonImages();
     this.Style.BackColor1.Color = ((Office2007Renderer)GlobalManager.Renderer).ColorTable.CalendarView.TimeRulerColors[0].Colors[0];
 }
Ejemplo n.º 17
0
 public void StyleManagerStyleChanged(eDotNetBarStyle newStyle)
 {
     if (_ScrollBar != null)
         _ScrollBar.InvalidateScrollBar();
 }
Ejemplo n.º 18
0
 public static bool IsOffice2007StyleOnly(eDotNetBarStyle style)
 {
     if (style == eDotNetBarStyle.StyleManagerControlled)
         style = StyleManager.GetEffectiveStyle();
     return (style == eDotNetBarStyle.Office2007);
 }
Ejemplo n.º 19
0
 public static void DrawMenuCheckBox(ItemPaintArgs pa, System.Drawing.Rectangle r, eDotNetBarStyle style, bool MouseOver)
 {
     System.Drawing.Graphics g = pa.Graphics;
     Color clr;
     if (style != eDotNetBarStyle.Office2000)
     {
         if (MouseOver)
         {
             //clr=g.GetNearestColor(Color.FromArgb(45,SystemColors.Highlight));
             //SolidBrush objBrush=new SolidBrush(clr);
             //g.FillRectangle(objBrush,r);
             //objBrush.Dispose();
         }
         else
         {
             //clr=g.GetNearestColor(Color.FromArgb(96,ColorFunctions.HoverBackColor()));
             clr = pa.Colors.ItemCheckedBackground; //ColorFunctions.CheckBoxBackColor(g);
             SolidBrush objBrush = new SolidBrush(clr);
             g.FillRectangle(objBrush, r);
             objBrush.Dispose();
         }
         //clr=g.GetNearestColor(Color.FromArgb(200,SystemColors.Highlight));
         clr = pa.Colors.ItemCheckedBorder; // SystemColors.Highlight;
         Pen objPen = new Pen(clr, 1);
         // TODO: Beta 2 fix --> g.DrawRectangle(objPen,r);
         NativeFunctions.DrawRectangle(g, objPen, r);
         objPen.Dispose();
         // Draw checker...
         Point[] pt = new Point[3];
         pt[0].X = r.Left + (r.Width - 5) / 2 - 1;
         pt[0].Y = r.Top + (r.Height - 6) / 2 + 3;
         pt[1].X = pt[0].X + 2;
         pt[1].Y = pt[0].Y + 2;
         pt[2].X = pt[1].X + 4;
         pt[2].Y = pt[1].Y - 4;
         objPen = new Pen(pa.Colors.ItemCheckedText);
         g.DrawLines(objPen, pt);
         pt[0].X++;
         pt[1].X++;
         pt[2].X++;
         g.DrawLines(objPen, pt);
         objPen.Dispose();
     }
     else if (style == eDotNetBarStyle.Office2000)
     {
         // Draw checked box
         System.Windows.Forms.ControlPaint.DrawBorder3D(g, r, System.Windows.Forms.Border3DStyle.SunkenOuter, System.Windows.Forms.Border3DSide.All);
         if (!MouseOver)
         {
             r.Inflate(-1, -1);
             g.FillRectangle(ColorFunctions.GetPushedBrush(), r);
         }
         // Draw checker...
         Point[] pt = new Point[3];
         pt[0].X = r.Left + (r.Width - 6) / 2;
         pt[0].Y = r.Top + (r.Height - 6) / 2 + 3;
         pt[1].X = pt[0].X + 2;
         pt[1].Y = pt[0].Y + 2;
         pt[2].X = pt[1].X + 4;
         pt[2].Y = pt[1].Y - 4;
         g.DrawLines(SystemPens.ControlText, pt);
         pt[0].X++;
         pt[1].X++;
         pt[2].X++;
         g.DrawLines(SystemPens.ControlText, pt);
     }
 }
Ejemplo n.º 20
0
 public static bool IsOffice2010Style(eDotNetBarStyle style)
 {
     if (style == eDotNetBarStyle.StyleManagerControlled)
         style = StyleManager.GetEffectiveStyle();
     return (style == eDotNetBarStyle.Office2010 || style == eDotNetBarStyle.Windows7 || style == eDotNetBarStyle.Metro);
 }
Ejemplo n.º 21
0
 public override void StyleManagerStyleChanged(eDotNetBarStyle newStyle)
 {
     base.StyleManagerStyleChanged(newStyle);
     InvalidateNonClient(true);
 }
Ejemplo n.º 22
0
        public DockingHint(eDockingHintSide hintSide, bool middleDockingHint, eDotNetBarStyle style)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            _Style = style;
            m_MiddleDockHint = middleDockingHint;

            this.SetStyle(ControlStyles.Selectable, false);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(DisplayHelp.DoubleBufferFlag, true);
            this.SetStyle(ControlStyles.Opaque, true);

            m_DockingHintSide = hintSide;
            UpdateControlRegion();
        }
Ejemplo n.º 23
0
 private void SetMainFormStyle(eStyle estyle, eTabStripStyle etabStripStyle, eDotNetBarStyle edotNetBarStyle)
 {
     this.styleManager.ManagerStyle = estyle;
     this.tabControlMain.Style = etabStripStyle;
     this.navigationBar.Style = edotNetBarStyle;
     this.dotNetBarManager.Style = edotNetBarStyle;
 }
Ejemplo n.º 24
0
        private void ChangeControlStyle(eDotNetBarStyle newStyle)
        {
            if (newStyle != eDotNetBarStyle.StyleManagerControlled)
            {
                if (newStyle == eDotNetBarStyle.Office2010)
                {
                    // Ensure that proper color table is selected.
                    if (GlobalManager.Renderer is Office2007Renderer)
                    {
                        if (!(((Office2007Renderer)GlobalManager.Renderer).ColorTable is Office2010ColorTable))
                        {
                            ((Office2007Renderer)GlobalManager.Renderer).ColorTable = new Office2010ColorTable();
                        }

                    }
                }
                else if (newStyle == eDotNetBarStyle.Windows7)
                {
                    // Ensure that proper color table is selected.
                    if (GlobalManager.Renderer is Office2007Renderer)
                    {
                        if (!(((Office2007Renderer)GlobalManager.Renderer).ColorTable is Windows7ColorTable))
                        {
                            ((Office2007Renderer)GlobalManager.Renderer).ColorTable = new Windows7ColorTable();
                        }

                    }
                }
                else if (newStyle == eDotNetBarStyle.Office2007)
                {
                    // Ensure that proper color table is selected.
                    if (GlobalManager.Renderer is Office2007Renderer)
                    {
                        if ((((Office2007Renderer)GlobalManager.Renderer).ColorTable is Office2010ColorTable) ||
                            (((Office2007Renderer)GlobalManager.Renderer).ColorTable is Windows7ColorTable))
                            ((Office2007Renderer)GlobalManager.Renderer).ColorTable = new Office2007ColorTable(this.Office2007ColorTable);

                    }
                }
            }

            m_RibbonStrip.Style = newStyle;
            foreach (Control c in this.Controls)
            {
                if (c is RibbonPanel)
                {
                    ((RibbonPanel)c).ColorSchemeStyle = newStyle;

                    foreach (Control r in c.Controls)
                    {
                        if (r is RibbonBar)
                        {
                            RibbonBar rb = r as RibbonBar;
                            TypeDescriptor.GetProperties(rb)["Style"].SetValue(rb, newStyle);
                        }
                    }
                }
            }

            if (m_QatToolbar != null) m_QatToolbar.Style = newStyle;
            if (this.IsHandleCreated)
            {
                this.Invalidate(true);
                this.RecalcLayout();
            }

            if (!this.DesignMode)
            {
                RibbonForm form = this.FindForm() as RibbonForm;
                if (form != null) form.UpdateGlass();
            }

        }
Ejemplo n.º 25
0
 private static void InvokeStyleManagerStyleChanged(object target, eDotNetBarStyle newStyle)
 {
     if (target == null) return;
     try
     {
         MethodInfo mi = target.GetType().GetMethod("StyleManagerStyleChanged");
         if (mi != null)
         {
             mi.Invoke(target, new object[] { newStyle });
         }
     }
     catch { } // target is part of generics with undeclared type and other possibilities...  we don't care if it fails on borderline cases
 }
Ejemplo n.º 26
0
 public void StyleManagerStyleChanged(eDotNetBarStyle newStyle)
 {
     this.Style = this.Style;
 }
Ejemplo n.º 27
0
        private void DrawMenuSideBar(ItemPaintArgs pa, eDotNetBarStyle effectiveStyle)
        {
            Rectangle sideRect = GetMenuSideBounds(pa.RightToLeft);
            Graphics g = pa.Graphics;

            // Draw side bar
            if (!BarFunctions.IsOffice2007Style(effectiveStyle))
            {
                if (this.MenuVisibility == eMenuVisibility.VisibleIfRecentlyUsed && !this.RecentlyUsed)
                {
                    if (!pa.Colors.MenuUnusedSide2.IsEmpty)
                    {
                        System.Drawing.Drawing2D.LinearGradientBrush gradient = BarFunctions.CreateLinearGradientBrush(new Rectangle(m_Rect.Left, m_Rect.Top, sideRect.Width, m_Rect.Height), pa.Colors.MenuUnusedSide, pa.Colors.MenuUnusedSide2, pa.Colors.MenuUnusedSideGradientAngle);
                        g.FillRectangle(gradient, sideRect);
                        gradient.Dispose();
                    }
                    else
                        g.FillRectangle(new SolidBrush(pa.Colors.MenuUnusedSide), sideRect);
                }
                else
                {
                    if (!pa.Colors.MenuSide2.IsEmpty)
                    {
                        System.Drawing.Drawing2D.LinearGradientBrush gradient = BarFunctions.CreateLinearGradientBrush(sideRect, pa.Colors.MenuSide, pa.Colors.MenuSide2, pa.Colors.MenuSideGradientAngle);
                        g.FillRectangle(gradient, sideRect);
                        gradient.Dispose();
                    }
                    else
                        g.FillRectangle(new SolidBrush(pa.Colors.MenuSide), sideRect);
                }
            }
            if (BarFunctions.IsOffice2007Style(effectiveStyle) && GlobalManager.Renderer is Office2007Renderer)
            {
                Office2007MenuColorTable mt = ((Office2007Renderer)GlobalManager.Renderer).ColorTable.Menu;
                if (mt != null)
                {
                    // Draw side bar
                    if (this.MenuVisibility == eMenuVisibility.VisibleIfRecentlyUsed && !this.RecentlyUsed)
                        DisplayHelp.FillRectangle(g, sideRect, mt.SideUnused);
                    else
                        DisplayHelp.FillRectangle(g, sideRect, mt.Side);
                }

                if (mt != null && !mt.SideBorder.IsEmpty)
                {
                    if (pa.RightToLeft)
                        DisplayHelp.DrawGradientLine(g, sideRect.X, sideRect.Y, sideRect.X, sideRect.Bottom - 1, mt.SideBorder, 1);
                    else
                        DisplayHelp.DrawGradientLine(g, sideRect.Right - 2, sideRect.Y, sideRect.Right - 2, sideRect.Bottom - 1, mt.SideBorder, 1);
                }
                if (mt != null && !mt.SideBorderLight.IsEmpty)
                {
                    if (pa.RightToLeft)
                        DisplayHelp.DrawGradientLine(g, sideRect.X + 1, sideRect.Y, sideRect.X + 1, sideRect.Bottom - 1, mt.SideBorderLight, 1);
                    else
                        DisplayHelp.DrawGradientLine(g, sideRect.Right - 1, sideRect.Y, sideRect.Right - 1, sideRect.Bottom - 1, mt.SideBorderLight, 1);
                }
            }
        }
Ejemplo n.º 28
0
		public ColorScheme(eDotNetBarStyle style)
		{
			m_Style=style;
			Refresh(null,true);
		}
Ejemplo n.º 29
0
 public virtual void StyleManagerStyleChanged(eDotNetBarStyle newStyle)
 {
     UpdateFormStyling();
     UpdateRibbonSystemCaptionItem();
 }
Ejemplo n.º 30
0
 public ColorScheme(DevComponents.AdvTree.eColorSchemeStyle cs)
 {
     eDotNetBarStyle style = eDotNetBarStyle.Office2003;
     if (cs == DevComponents.AdvTree.eColorSchemeStyle.VS2005)
         style = eDotNetBarStyle.VS2005;
     else if (cs == DevComponents.AdvTree.eColorSchemeStyle.Office2007)
         style = eDotNetBarStyle.Office2007;
     m_Style = style;
     Refresh(null, true);
 }
Ejemplo n.º 31
0
		public virtual void Deserialize(ItemSerializationContext context)
		{
            System.Xml.XmlElement ItemXmlSource = context.ItemXmlElement;

			m_Name=ItemXmlSource.GetAttribute("name");
            if (ItemXmlSource.HasAttribute("globalname"))
                m_GlobalName = ItemXmlSource.GetAttribute("globalname");
			m_Text=ItemXmlSource.GetAttribute("text");
			m_AccessKey=NativeFunctions.GetAccessKey(m_Text);
			m_IsContainer=System.Xml.XmlConvert.ToBoolean(ItemXmlSource.GetAttribute("iscontainer"));
            if (context._DesignerHost == null)
                m_Visible = System.Xml.XmlConvert.ToBoolean(ItemXmlSource.GetAttribute("visible"));
            else
                TypeDescriptor.GetProperties(this)["Visible"].SetValue(this, System.Xml.XmlConvert.ToBoolean(ItemXmlSource.GetAttribute("visible")));
			if(ItemXmlSource.GetAttribute("itemdata")!="")
				m_ItemData=ItemXmlSource.GetAttribute("itemdata");
			else
				m_ItemData="";
			m_Enabled=System.Xml.XmlConvert.ToBoolean(ItemXmlSource.GetAttribute("enabled"));
			m_BeginGroup=System.Xml.XmlConvert.ToBoolean(ItemXmlSource.GetAttribute("begingroup"));
			m_Style=(eDotNetBarStyle)System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("style"));
			m_Description=ItemXmlSource.GetAttribute("desc");
			m_Tooltip=ItemXmlSource.GetAttribute("tooltip");
			m_Category=ItemXmlSource.GetAttribute("category");
			m_CanCustomize=System.Xml.XmlConvert.ToBoolean(ItemXmlSource.GetAttribute("cancustomize"));
			m_ShowSubItems=System.Xml.XmlConvert.ToBoolean(ItemXmlSource.GetAttribute("showsubitems"));
			m_ItemAlignment=(eItemAlignment)System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("itemalignment"));
			if(ItemXmlSource.HasAttribute("stretch"))
				m_Stretch=System.Xml.XmlConvert.ToBoolean(ItemXmlSource.GetAttribute("stretch"));
			else
				m_Stretch=false;
			if(ItemXmlSource.HasAttribute("global"))
				m_GlobalItem=System.Xml.XmlConvert.ToBoolean(ItemXmlSource.GetAttribute("global"));

			if(ItemXmlSource.HasAttribute("themes"))
				m_ThemeAware=System.Xml.XmlConvert.ToBoolean(ItemXmlSource.GetAttribute("themes"));

			if(ItemXmlSource.HasAttribute("adefdesc"))
				m_AccessibleDefaultActionDescription=ItemXmlSource.GetAttribute("adefdesc");
			if(ItemXmlSource.HasAttribute("adesc"))
				m_AccessibleDescription=ItemXmlSource.GetAttribute("adesc");
			if(ItemXmlSource.HasAttribute("aname"))
				m_AccessibleName=ItemXmlSource.GetAttribute("aname");
			if(ItemXmlSource.HasAttribute("arole"))
				m_AccessibleRole=(System.Windows.Forms.AccessibleRole)System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("arole"));
			if(ItemXmlSource.HasAttribute("autocollapse"))
				m_AutoCollapseOnClick=System.Xml.XmlConvert.ToBoolean(ItemXmlSource.GetAttribute("autocollapse"));
			else
                m_AutoCollapseOnClick=true;
			
			if(ItemXmlSource.HasAttribute("autorepeat"))
				m_ClickAutoRepeat=System.Xml.XmlConvert.ToBoolean(ItemXmlSource.GetAttribute("autorepeat"));
			else
				m_ClickAutoRepeat=false;
			if(ItemXmlSource.HasAttribute("clickrepinterv"))
				m_ClickRepeatInterval=System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("clickrepinterv"));
			else
				m_ClickRepeatInterval=600;

            //if (ItemXmlSource.HasAttribute("GenerateCommandLink"))
            //    m_GenerateCommandLink = System.Xml.XmlConvert.ToBoolean(ItemXmlSource.GetAttribute("GenerateCommandLink"));
            //else
            //    m_GenerateCommandLink = false;
			
			// Load Cursor
			if(ItemXmlSource.HasAttribute("cur"))
			{
				switch(ItemXmlSource.GetAttribute("cur"))
				{
					case "4":
						m_Cursor=System.Windows.Forms.Cursors.Hand;
						break;
					case "1":
						m_Cursor=System.Windows.Forms.Cursors.AppStarting;
						break;
					case "2":
						m_Cursor=System.Windows.Forms.Cursors.Arrow;
						break;
					case "3":
						m_Cursor=System.Windows.Forms.Cursors.Cross;
						break;
					case "5":
						m_Cursor=System.Windows.Forms.Cursors.Help;
						break;
					case "6":
						m_Cursor=System.Windows.Forms.Cursors.HSplit;
						break;
					case "7":
						m_Cursor=System.Windows.Forms.Cursors.IBeam;
						break;
					case "8":
						m_Cursor=System.Windows.Forms.Cursors.No;
						break;
					case "9":
						m_Cursor=System.Windows.Forms.Cursors.NoMove2D;
						break;
					case "10":
						m_Cursor=System.Windows.Forms.Cursors.NoMoveHoriz;
						break;
					case "11":
						m_Cursor=System.Windows.Forms.Cursors.NoMoveVert;
						break;
					case "12":
						m_Cursor=System.Windows.Forms.Cursors.PanEast;
						break;
					case "13":
						m_Cursor=System.Windows.Forms.Cursors.PanNE;
						break;
					case "14":
						m_Cursor=System.Windows.Forms.Cursors.PanNorth;
						break;
					case "15":
						m_Cursor=System.Windows.Forms.Cursors.PanNW;
						break;
					case "16":
						m_Cursor=System.Windows.Forms.Cursors.PanSE;
						break;
					case "17":
						m_Cursor=System.Windows.Forms.Cursors.PanSouth;
						break;
					case "18":
						m_Cursor=System.Windows.Forms.Cursors.PanSW;
						break;
					case "19":
						m_Cursor=System.Windows.Forms.Cursors.PanWest;
						break;
					case "20":
						m_Cursor=System.Windows.Forms.Cursors.SizeAll;
						break;
					case "21":
						m_Cursor=System.Windows.Forms.Cursors.SizeNESW;
						break;
					case "22":
						m_Cursor=System.Windows.Forms.Cursors.SizeNS;
						break;
					case "23":
						m_Cursor=System.Windows.Forms.Cursors.SizeNWSE;
						break;
					case "24":
						m_Cursor=System.Windows.Forms.Cursors.SizeWE;
						break;
					case "25":
						m_Cursor=System.Windows.Forms.Cursors.UpArrow;
						break;
					case "26":
						m_Cursor=System.Windows.Forms.Cursors.VSplit;
						break;
					case "27":
						m_Cursor=System.Windows.Forms.Cursors.WaitCursor;
						break;
				}
			}

			System.Xml.XmlNodeList list=ItemXmlSource.GetElementsByTagName("subitems");
			if(list.Count>0)
			{
				foreach(System.Xml.XmlElement xmlChild in list[0].ChildNodes)
				{
//					BaseItem oi=null;
//					System.Reflection.Assembly a=System.Reflection.Assembly.Load(xmlChild.GetAttribute("assembly"));
//					if(a==null) continue;
//					oi=a.CreateInstance(xmlChild.GetAttribute("class")) as BaseItem;
					BaseItem oi=context.CreateItemFromXml(xmlChild);
					if(oi!=null)
					{
						this.SubItems.Add(oi);
                        context.ItemXmlElement = xmlChild;
						oi.Deserialize(context);
                        context.ItemXmlElement = ItemXmlSource;
					}
				}
			}
			if(ItemXmlSource.HasAttribute("shortcuts"))
			{
				if(m_Shortcuts==null)
					m_Shortcuts=new ShortcutsCollection(this);
				m_Shortcuts.FromString(ItemXmlSource.GetAttribute("shortcuts"),",");
			}

            if (context.HasDeserializeItemHandlers)
            {
                System.Xml.XmlNodeList customDataList=ItemXmlSource.GetElementsByTagName("customData");
                if (customDataList.Count > 0)
                {
                    System.Xml.XmlElement customData = customDataList[0] as System.Xml.XmlElement;
                    SerializeItemEventArgs e = new SerializeItemEventArgs(this, ItemXmlSource, customData);
                    context.Serializer.InvokeDeserializeItem(e);
                }
            }

            MarkupTextChanged();
        }
Ejemplo n.º 32
0
 public void StyleManagerStyleChanged(eDotNetBarStyle newStyle)
 {
     ColorSchemeStyleChanged();
     if (this.IsHandleCreated && this.Visible)
         this.Invalidate(true);
 }
Ejemplo n.º 33
0
		/// <summary>
		/// Creates new instance of BaseItem and assigns item name and item text.
		/// </summary>
		/// <param name="sItemName">Item Name</param>
		/// <param name="ItemText">Item Text</param>
		public BaseItem(string sItemName, string ItemText)
		{
            if (ItemText == null)
                ItemText = "";
			m_Text=ItemText;
			if(m_Text!="")
				m_AccessKey=NativeFunctions.GetAccessKey(m_Text);
			m_Rect=System.Drawing.Rectangle.Empty;
			m_ContainerControl=null;
			m_HotSubItem=null;
			m_IsContainer=false;
			m_SubItems=null;
			m_Parent=null;
			m_NeedRecalcSize=true;
			m_Visible=true;
			m_Expanded=false;
			m_AutoExpand=false;
			m_ItemData="";
			m_Enabled=true;
			m_BeginGroup=false;
			m_Style=eDotNetBarStyle.OfficeXP;
			m_Description="";
			m_Tooltip="";
			m_Name=sItemName;
			m_Category="";
			m_Orientation=eOrientation.Horizontal;
			m_ToolTipWnd=null;
			m_Id=++s_IdCounter;
			m_IsOnCustomizeMenu=false;
			m_IsOnCustomizeDialog=false;
			m_SystemItem=false;
			//m_AccessKey=;
			m_Shortcuts=null;
			m_DesignMode=false;
			m_CanCustomize=true;
			m_ShowSubItems=true;
			m_ItemAlignment=eItemAlignment.Near;
			m_Focused=false;
			m_Owner=null;
            MarkupTextChanged();
        }
Ejemplo n.º 34
0
        public void StyleManagerStyleChanged(eDotNetBarStyle newStyle)
        {

        }
Ejemplo n.º 35
0
        private GraphicsPath GetTabPath(Rectangle r, int cornerSize, bool getBottomPart, eDotNetBarStyle style)
        {
            GraphicsPath path = new GraphicsPath();
            int bottomCorner = (style == eDotNetBarStyle.Windows7 || style == eDotNetBarStyle.Office2010) ? 1 : 2;
            if (style == eDotNetBarStyle.Metro) bottomCorner = 0;
            if (getBottomPart)
                path.AddLine(r.X, r.Bottom, r.X + bottomCorner, r.Bottom - bottomCorner);
            else
                path.AddLine(r.X, r.Bottom, r.X, r.Y + cornerSize);
            r.Inflate(-bottomCorner, 0);

            ElementStyleDisplay.AddCornerArc(path, r, cornerSize, eCornerArc.TopLeft);
            ElementStyleDisplay.AddCornerArc(path, r, cornerSize, eCornerArc.TopRight);

            if (getBottomPart)
                path.AddLine(r.Right, r.Bottom - bottomCorner, r.Right + bottomCorner, r.Bottom);
            else
                path.AddLine(r.Right, r.Y + cornerSize, r.Right, r.Bottom);

            return path;
        }
Ejemplo n.º 36
0
		private void ChangeDotNetBarStyle(eDotNetBarStyle style)
		{
			cmdStyleOffice2007Blue.Checked = (style==eDotNetBarStyle.Office2007);
			cmdStyleOffice2003.Checked = (style==eDotNetBarStyle.Office2003);
			cmdStyleOfficeXP.Checked = (style==eDotNetBarStyle.OfficeXP);
			cmdStyleVS2005.Checked = (style==eDotNetBarStyle.VS2005);
			
			explorerBar1.ColorScheme=new DevComponents.DotNetBar.ColorScheme(style);

            dotNetBarManager1.Style=style;
			if(style==eDotNetBarStyle.Office2003 || style==eDotNetBarStyle.OfficeXP || style==eDotNetBarStyle.VS2005)
			{
				if(dotNetBarManager1.IsThemeActive)
				{
					bThemes.Visible=true;
					barStandard.RecalcLayout();
				}
			}
			else if(dotNetBarManager1.IsThemeActive)
			{
				bThemes.Visible=false;
				barStandard.RecalcLayout();
			}

			if(style==eDotNetBarStyle.Office2003)
			{
				tabStrip1.Style=eTabStripStyle.OneNote;
			}
			else if(style == eDotNetBarStyle.Office2007)
			{
				tabStrip1.Style=eTabStripStyle.Office2007Document;
			}
			else if(style==eDotNetBarStyle.VS2005)
			{
				tabStrip1.Style=eTabStripStyle.VS2005;
			}
			else
			{
				tabStrip1.Style=eTabStripStyle.Flat;
			}

			// Status bar style
			bar1.Style=style;
		}