• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# TabVS2005类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TabVS2005的典型用法代码示例。如果您正苦于以下问题:C# TabVS2005类的具体用法?C# TabVS2005怎么用?C# TabVS2005使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TabVS2005类属于命名空间,在下文中一共展示了TabVS2005类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DrawTab_Document

        private void DrawTab_Document(Graphics g, TabVS2005 tab, Rectangle rect)
        {
            if (tab.TabWidth == 0)
                return;

            Rectangle rectIcon = new Rectangle(
                rect.X + DocumentIconGapLeft,
                rect.Y + rect.Height - 1 - DocumentIconGapBottom - DocumentIconHeight,
                DocumentIconWidth, DocumentIconHeight);
            Rectangle rectText = rectIcon;

            String tabStyle = PluginCore.PluginBase.MainForm.GetThemeValue("VS2005DockPaneStrip.TabStyle");

            // Adjust text
            double scale = ScaleHelper.GetScale();
            if (scale >= 1.5)
            {
                String tabSize = PluginCore.PluginBase.MainForm.GetThemeValue("VS2005DockPaneStrip.TabSize");
                if (tabSize == "Default") rectText.Y += ScaleHelper.Scale(1);
            }
            else rectText.Y += ScaleHelper.Scale(2);
            if (Font.SizeInPoints <= 8F) rectText.Y -= ScaleHelper.Scale(1);

            if (DockPane.DockPanel.ShowDocumentIcon)
            {
                rectText.X += rectIcon.Width + DocumentIconGapRight;
                rectText.Y = rect.Y;
                rectText.Width = rect.Width - rectIcon.Width - DocumentIconGapLeft -
                    DocumentIconGapRight - DocumentTextGapRight;
                rectText.Height = rect.Height;
            }
            else
                rectText.Width = rect.Width - DocumentIconGapLeft - DocumentTextGapRight;

            Rectangle rectTab = DrawHelper.RtlTransform(this, rect);
            rectText = DrawHelper.RtlTransform(this, rectText);
            rectIcon = DrawHelper.RtlTransform(this, rectIcon);
            GraphicsPath path = GetTabOutline(tab, true, false);

            Color stripColor = tab.Content.DockHandler.TabColor;
            if (stripColor != Color.Transparent)
            {
                Color temp = PluginCore.PluginBase.MainForm.GetThemeColor("VS2005DockPaneStrip.TabStripColor");
                if (temp != Color.Empty) stripColor = temp;
            }

            if (DockPane.ActiveContent == tab.Content)
            {
                if (tabStyle == "Rect") g.FillRectangle(BrushDocumentActiveBackground, rectTab);
                else g.FillPath(BrushDocumentActiveBackground, path);

                // Change by Mika: add color strip to tabs
                SolidBrush stripBrush = new SolidBrush(stripColor);
                Rectangle stripRect = rectTab;
                stripRect.X = stripRect.X + stripRect.Width - 2;
                stripRect.Height -= 1;
                stripRect.Width = 2;
                stripRect.Y += 1;
                g.FillRectangle(stripBrush, stripRect);

                if (tabStyle == "Rect") g.DrawRectangle(PenDocumentTabActiveBorder, rectTab);
                else g.DrawPath(PenDocumentTabActiveBorder, path);

                Color sepColor = PluginCore.PluginBase.MainForm.GetThemeColor("VS2005DockPaneStrip.TabSeparatorColor");

                // CHANGED to eliminate line between selected tab and content - NICK
                RectangleF r = path.GetBounds();
                float right = stripColor == Color.Transparent ? r.Right - 1 : r.Right - 3;

                // Choose color
                if (sepColor == Color.Empty)
                {
                    if (PluginCore.PluginBase.Settings.UseSystemColors)
                    {
                        sepColor = SystemColors.ControlLight;
                    }
                    else sepColor = Color.FromArgb(240, 239, 243);
                }
                
                // Draw separator
                using (Pen pen = new Pen(sepColor))
                {
                    if (tabStyle == "Rect") g.DrawLine(pen, rectTab.Left + 2, rectTab.Bottom - 1, right, rectTab.Bottom - 1);
                    else g.DrawLine(pen, r.Left + 2, r.Bottom - 1, right, r.Bottom - 1);
                }

                if (DockPane.IsActiveDocumentPane)
                {
                    TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, BoldFont, rectText, ColorDocumentActiveText, DocumentTextFormat);
                }
                else TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, Font, rectText, ColorDocumentInactiveText, DocumentTextFormat);
            }
            else
            {
                // CHANGE by NICK: emulate VS-style inactive tab gradient
                Brush tabBrush = new LinearGradientBrush(rectTab, SystemColors.ControlLightLight, SystemColors.ControlLight, LinearGradientMode.Vertical);

                // Choose color
                Color color = PluginCore.PluginBase.MainForm.GetThemeColor("VS2005DockPaneStrip.DocInactiveBackColor");
                if (color != Color.Empty)
//.........这里部分代码省略.........
开发者ID:zaynyatyi,项目名称:flashdevelop,代码行数:101,代码来源:VS2005DockPaneStrip.cs


示例2: DrawTab_ToolWindow

		private void DrawTab_ToolWindow(Graphics g, TabVS2005 tab, Rectangle rect)
		{
			Rectangle rectIcon = new Rectangle(
				rect.X + ToolWindowImageGapLeft,
				rect.Y + rect.Height - 1 - ToolWindowImageGapBottom - ToolWindowImageHeight,
				ToolWindowImageWidth, ToolWindowImageHeight);
			Rectangle rectText = rectIcon;
			rectText.X += rectIcon.Width + ToolWindowImageGapRight;
			rectText.Width = rect.Width - rectIcon.Width - ToolWindowImageGapLeft - 
				ToolWindowImageGapRight - ToolWindowTextGapRight;
            if (TextFont.Height > rectIcon.Height)
            { 
                rectText.Y -= TextFont.Height - rectIcon.Height;
                rectText.Height = TextFont.Height;
            }
            //rectText.Y = rect.Y + Convert.ToInt32((rect.Height - TextFont.Height) / 2) - 1;
            //rectText.Height = TextFont.Height;

            Rectangle rectTab = DrawHelper.RtlTransform(this, rect);
            rectText = DrawHelper.RtlTransform(this, rectText);
            rectIcon = DrawHelper.RtlTransform(this, rectIcon);
            GraphicsPath path = GetTabOutline(tab, true, false);
			if (DockPane.ActiveContent == tab.Content)
			{
				g.FillPath(BrushToolWindowActiveBackground, path);
                g.DrawPath(PenToolWindowTabBorder, path);
                TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, ColorToolWindowActiveText, ToolWindowTextFormat);
			}
			else
			{
                if (Tabs.IndexOf(DockPane.ActiveContent) != Tabs.IndexOf(tab) + 1)
                {
                    Point pt1 = new Point(rect.Right, rect.Top + ToolWindowTabSeperatorGapTop);
                    Point pt2 = new Point(rect.Right, rect.Bottom - ToolWindowTabSeperatorGapBottom); 
                    g.DrawLine(PenToolWindowTabBorder, DrawHelper.RtlTransform(this, pt1), DrawHelper.RtlTransform(this, pt2));
                }
				TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, ColorToolWindowInactiveText, ToolWindowTextFormat);
			}

			if (rectTab.Contains(rectIcon))
				g.DrawIcon(tab.Content.DockHandler.Icon, rectIcon);
		}
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:42,代码来源:VS2005DockPaneStrip.cs


示例3: DrawTab_ToolWindow

        private void DrawTab_ToolWindow(Graphics g, TabVS2005 tab, Rectangle rect)
        {
            Rectangle rectIcon = new Rectangle(
                rect.X + ToolWindowImageGapLeft,
                rect.Y + rect.Height - 1 - ToolWindowImageGapBottom - ToolWindowImageHeight,
                ToolWindowImageWidth, ToolWindowImageHeight);
            Rectangle rectText = rectIcon;
            rectText.X += rectIcon.Width + ToolWindowImageGapRight;
            rectText.Width = rect.Width - rectIcon.Width - ToolWindowImageGapLeft -
                ToolWindowImageGapRight - ToolWindowTextGapRight;

            Rectangle rectTab = DrawHelper.RtlTransform(this, rect);
            rectText = DrawHelper.RtlTransform(this, rectText);
            rectIcon = DrawHelper.RtlTransform(this, rectIcon);
            GraphicsPath path = GetTabOutline(tab, true, false);
            if (DockPane.ActiveContent == tab.Content)
            {
                using (LinearGradientBrush brush = new LinearGradientBrush(ClientRectangle, PaletteHelper.ActiveBackColor1, PaletteHelper.ActiveBackColor2, LinearGradientMode.Vertical))
                {
                    brush.Blend = PaletteHelper.ActiveBackColorGradientBlend;
                    g.FillPath(brush, path);
                }
                //g.FillPath(BrushToolWindowActiveBackground, path);
                g.DrawPath(PaletteHelper.PenToolWindowTabBorder, path);
                TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, 
                    PaletteHelper.ColorToolWindowActiveText, ToolWindowTextFormat);
            }
            else
            {
                if (Tabs.IndexOf(DockPane.ActiveContent) != Tabs.IndexOf(tab) + 1)
                {
                    Point pt1 = new Point(rect.Right, rect.Top + ToolWindowTabSeperatorGapTop);
                    Point pt2 = new Point(rect.Right, rect.Bottom - ToolWindowTabSeperatorGapBottom);
                    g.DrawLine(PaletteHelper.PenToolWindowTabBorder, DrawHelper.RtlTransform(this, pt1), DrawHelper.RtlTransform(this, pt2));
                }
                TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, 
                    PaletteHelper.ColorToolWindowInactiveText, ToolWindowTextFormat);
            }

            if (rectTab.Contains(rectIcon))
                g.DrawIcon(tab.Content.DockHandler.Icon, rectIcon);
        }
开发者ID:BachelorEric,项目名称:ModelFirst,代码行数:42,代码来源:VS2005DockPaneStrip.cs


示例4: DrawTab_ToolWindow

        private void DrawTab_ToolWindow(Graphics g, TabVS2005 tab, Rectangle rect)
        {
            Rectangle rectIcon = new Rectangle(
                rect.X + ToolWindowImageGapLeft,
                rect.Y + rect.Height - 1 - ToolWindowImageGapBottom - ToolWindowImageHeight,
                ToolWindowImageWidth, ToolWindowImageHeight);
            Rectangle rectText = rectIcon;
            rectText.X += rectIcon.Width + ToolWindowImageGapRight;
            rectText.Width = rect.Width - rectIcon.Width - ToolWindowImageGapLeft - 
                ToolWindowImageGapRight - ToolWindowTextGapRight;

            Rectangle rectTab = DrawHelper.RtlTransform(this, rect);
            rectText = DrawHelper.RtlTransform(this, rectText);
            rectIcon = DrawHelper.RtlTransform(this, rectIcon);
            GraphicsPath path = GetTabOutline(tab, true, false);
            if (DockPane.ActiveContent == tab.Content)
            {
                g.FillPath(BrushToolWindowActiveBackground, path);
                g.DrawPath(PenToolWindowTabActiveBorder, path);

                // NICK: eliminate line between tab and content
                RectangleF r = path.GetBounds();
                Color color = PluginCore.PluginBase.MainForm.GetThemeColor("VS2005DockPaneStrip.ToolSeparatorColor");
                if (color == Color.Empty) color = Color.FromArgb(240, 239, 243);
                using (Pen pen = new Pen(color)) g.DrawLine(pen, r.Left + 1, r.Top, r.Right - 1, r.Top);

                TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, Font, rectText, ColorToolWindowActiveText, ToolWindowTextFormat);
            }
            else
            {
                // NICK: remove separators, too busy for FD
                /*if (Tabs.IndexOf(DockPane.ActiveContent) != Tabs.IndexOf(tab) + 1)
                {
                    Point pt1 = new Point(rect.Right, rect.Top + ToolWindowTabSeperatorGapTop);
                    Point pt2 = new Point(rect.Right, rect.Bottom - ToolWindowTabSeperatorGapBottom); 
                    g.DrawLine(PenToolWindowTabBorder, DrawHelper.RtlTransform(this, pt1), DrawHelper.RtlTransform(this, pt2));
                }*/
                TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, Font, rectText, ColorToolWindowInactiveText, ToolWindowTextFormat);
            }

            if (rectTab.Contains(rectIcon))
                g.DrawIcon(tab.Content.DockHandler.Icon, rectIcon);
        }
开发者ID:zaynyatyi,项目名称:flashdevelop,代码行数:43,代码来源:VS2005DockPaneStrip.cs


示例5: GetTabOutline

        private GraphicsPath GetTabOutline(TabVS2005 tab, bool transformed, bool rtlTransform)
        {
            DockState dockState = tab.Content.DockHandler.DockState;
            Rectangle rectTab = GetTabRectangle(tab, transformed);
            if (rtlTransform)
                rectTab = RtlTransform(rectTab, dockState);
            bool upTab = (dockState == DockState.DockLeftAutoHide || dockState == DockState.DockBottomAutoHide);
            DrawHelper.GetRoundedCornerTab(GraphicsPath, rectTab, upTab);

            return GraphicsPath;
        }
开发者ID:Gr33z00,项目名称:flashdevelop,代码行数:11,代码来源:VS2005AutoHideStrip.cs


示例6: GetTabRectangle

		private Rectangle GetTabRectangle(TabVS2005 tab)
		{
			return GetTabRectangle(tab, false);
		}
开发者ID:Gr33z00,项目名称:flashdevelop,代码行数:4,代码来源:VS2005AutoHideStrip.cs


示例7: DrawTab

        private void DrawTab(Graphics g, TabVS2005 tab)
        {
            Rectangle rectTabOrigin = GetTabRectangle(tab);
            if (rectTabOrigin.IsEmpty)
                return;

            DockState dockState = tab.Content.DockHandler.DockState;
            IDockContent content = tab.Content;

            GraphicsPath path = GetTabOutline(tab, false, true);
            g.FillPath(BrushTabBackground, path);

            String tabStyle = PluginCore.PluginBase.MainForm.GetThemeValue("VS2005AutoHideStrip.TabStyle");
            Color tabUlColor = PluginCore.PluginBase.MainForm.GetThemeColor("VS2005AutoHideStrip.TabUnderlineColor");

            if (tabStyle == "Underlined")
            {
                Int32 spacing = ScaleHelper.Scale(4);
                Brush brush = tabUlColor != Color.Empty ? new SolidBrush(tabUlColor) : SystemBrushes.Highlight;
                if (dockState == DockState.DockRightAutoHide)
                {
                    g.FillRectangle(brush, new Rectangle(rectTabOrigin.Left + spacing, rectTabOrigin.Y, rectTabOrigin.Width - (spacing * 2), spacing));
                    rectTabOrigin.Y += spacing;
                }
                else if (dockState == DockState.DockTopAutoHide)
                {
                    g.FillRectangle(brush, new Rectangle(rectTabOrigin.X + spacing, rectTabOrigin.Bottom - (spacing / 3), rectTabOrigin.Width - (spacing * 2), rectTabOrigin.Bottom));
                    rectTabOrigin.Y -= (spacing / 3);
                }
                else
                {
                    g.FillRectangle(brush, new Rectangle(rectTabOrigin.X + spacing, rectTabOrigin.Bottom - spacing, rectTabOrigin.Width - (spacing * 2), rectTabOrigin.Bottom));
                    rectTabOrigin.Y -= spacing;
                }
            }
            else g.DrawPath(PenTabBorder, path);

            // Set no rotate for drawing icon and text
            Matrix matrixRotate = g.Transform;
            g.Transform = MatrixIdentity;

            // Draw the icon
            Rectangle rectImage = rectTabOrigin;

            // HACK - This makes the Silk icon set look better (although it is NOT VS 2005 behavior)
            if (dockState == DockState.DockLeftAutoHide || dockState == DockState.DockRightAutoHide)
                rectImage.Y -= 1;

            rectImage.X += ImageGapLeft;
            rectImage.Y += ImageGapTop;
            int imageHeight = rectTabOrigin.Height - ImageGapTop - ImageGapBottom;
            int imageWidth = ImageWidth;
            if (imageHeight > ImageHeight)
                imageWidth = ImageWidth * (imageHeight/ImageHeight);
            rectImage.Height = imageHeight;
            rectImage.Width = imageWidth;
            rectImage = GetTransformedRectangle(dockState, rectImage);

            if (tabStyle != "Underlined") g.DrawIcon(((Form)content).Icon, RtlTransform(rectImage, dockState));

            // Draw the text
            Rectangle rectText = rectTabOrigin;

            // CHANGED - Mika
            if (Font.SizeInPoints > 8F) rectText.Y += 1;

            if (tabStyle == "Underlined") rectText.X += TextGapRight;
            else
            {
                rectText.X += ImageGapLeft + imageWidth + ImageGapRight + TextGapLeft;
                rectText.Width -= ImageGapLeft + imageWidth + ImageGapRight + TextGapLeft;
            }

            rectText = RtlTransform(GetTransformedRectangle(dockState, rectText), dockState);
            if (dockState == DockState.DockLeftAutoHide || dockState == DockState.DockRightAutoHide)
                g.DrawString(content.DockHandler.TabText, Font, BrushTabText, rectText, StringFormatTabVertical);
            else
                g.DrawString(content.DockHandler.TabText, Font, BrushTabText, rectText, StringFormatTabHorizontal);

            // Set rotate back
            g.Transform = matrixRotate;
        }
开发者ID:ImaginationSydney,项目名称:flashdevelop,代码行数:82,代码来源:VS2005AutoHideStrip.cs


示例8: DrawTab_Document

        private void DrawTab_Document(Graphics g, TabVS2005 tab, Rectangle rect)
        {
            if (tab.TabWidth == 0)
                return;

            Rectangle rectIcon = new Rectangle(
                rect.X + DocumentIconGapLeft,
                rect.Y + rect.Height - 1 - DocumentIconGapBottom - DocumentIconHeight,
                DocumentIconWidth, DocumentIconHeight);
            Rectangle rectText = rectIcon;
            rectIcon.Y += 1;
            if (DockPane.DockPanel.ShowDocumentIcon)
            {
                rectText.X += rectIcon.Width + DocumentIconGapRight;
                rectText.Y = rect.Y;
                rectText.Width = rect.Width - rectIcon.Width - DocumentIconGapLeft -
                    DocumentIconGapRight - DocumentTextGapRight;
                rectText.Height = rect.Height;
            }
            else
                rectText.Width = rect.Width - DocumentIconGapLeft - DocumentTextGapRight;

            Rectangle rectTab = DrawHelper.RtlTransform(this, rect);
            Rectangle rectBack = DrawHelper.RtlTransform(this, rect);
            rectBack.Width += rect.X;
            rectBack.X = 0;

            rectText = DrawHelper.RtlTransform(this, rectText);
            rectIcon = DrawHelper.RtlTransform(this, rectIcon);
            GraphicsPath path = GetTabOutline(tab, true, false);
            if (DockPane.ActiveContent == tab.Content)
            {
                Color startColor = DockPane.DockPanel.Skin.DockPaneStripSkin.DocumentGradient.ActiveTabGradient.StartColor;
                Color endColor = DockPane.DockPanel.Skin.DockPaneStripSkin.DocumentGradient.ActiveTabGradient.EndColor;
                LinearGradientMode gradientMode = DockPane.DockPanel.Skin.DockPaneStripSkin.DocumentGradient.ActiveTabGradient.LinearGradientMode;
                g.FillPath(new LinearGradientBrush(rectBack, startColor, endColor, gradientMode), path);
                g.DrawPath(PenDocumentTabActiveBorder, path);

                Color textColor = DockPane.DockPanel.Skin.DockPaneStripSkin.DocumentGradient.ActiveTabGradient.TextColor;
                if (DockPane.IsActiveDocumentPane)
                    TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, BoldFont, rectText, textColor, DocumentTextFormat);
                else
                    TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, textColor, DocumentTextFormat);
            }
            else
            {
                Color startColor = DockPane.DockPanel.Skin.DockPaneStripSkin.DocumentGradient.InactiveTabGradient.StartColor;
                Color endColor = DockPane.DockPanel.Skin.DockPaneStripSkin.DocumentGradient.InactiveTabGradient.EndColor;
                LinearGradientMode gradientMode = DockPane.DockPanel.Skin.DockPaneStripSkin.DocumentGradient.InactiveTabGradient.LinearGradientMode;
                g.FillPath(new LinearGradientBrush(rectBack, startColor, endColor, gradientMode), path);
                g.DrawPath(PenDocumentTabInactiveBorder, path);

                Color textColor = DockPane.DockPanel.Skin.DockPaneStripSkin.DocumentGradient.InactiveTabGradient.TextColor;
                TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, textColor, DocumentTextFormat);
            }

            if (rectTab.Contains(rectIcon) && DockPane.DockPanel.ShowDocumentIcon)
                g.DrawIcon(new Icon(tab.Content.DockHandler.Icon, new Size(rectIcon.Width, rectIcon.Height)), rectIcon);
        }
开发者ID:n1nj4n,项目名称:renderdoc,代码行数:59,代码来源:VS2005DockPaneStrip.cs


示例9: DrawTab

		private void DrawTab(Graphics g, TabVS2005 tab)
		{
            OfficeColorTable colorTable = StyleBuilderFactory.GetOffice2007ColorTable(StyleManager.Style);
			Rectangle rectTabOrigin = GetTabRectangle(tab);
			if (rectTabOrigin.IsEmpty)
				return;
            
			DockState dockState = tab.Content.DockHandler.DockState;
			IDockContent content = tab.Content;

            GraphicsPath path = GetTabOutline(tab, false, true);
            //g.FillPath(BrushTabBackground, path);
            //g.FillPath(new SolidBrush(colorTable.TabControlPageBackColor), path);
            g.FillPath(new LinearGradientBrush(rectTabOrigin, colorTable.TabControlPageNormalBackColor1, colorTable.TabControlPageNormalBackColor4, 2), path);
            //g.DrawPath(PenTabBorder, path);//Modify by Agan 2013-06-09
            //g.DrawPath(new Pen(colorTable.TabControlBorderColor), path);
            g.DrawPath(new Pen(colorTable.TabControlBorderColor), path);
            // Set no rotate for drawing icon and text
			Matrix matrixRotate = g.Transform;
			g.Transform = MatrixIdentity;

			// Draw the icon
			Rectangle rectImage = rectTabOrigin;
			rectImage.X += ImageGapLeft;
			rectImage.Y += ImageGapTop;
			int imageHeight = rectTabOrigin.Height - ImageGapTop - ImageGapBottom;
			int imageWidth = ImageWidth;
			if (imageHeight > ImageHeight)
				imageWidth = ImageWidth * (imageHeight/ImageHeight);
			rectImage.Height = imageHeight;
			rectImage.Width = imageWidth;
			rectImage = GetTransformedRectangle(dockState, rectImage);
			g.DrawIcon(((Form)content).Icon, RtlTransform(rectImage, dockState));
		
			// Draw the text
			Rectangle rectText = rectTabOrigin;
			rectText.X += ImageGapLeft + imageWidth + ImageGapRight + TextGapLeft;
			rectText.Width -= ImageGapLeft + imageWidth + ImageGapRight + TextGapLeft;
			rectText = RtlTransform(GetTransformedRectangle(dockState, rectText), dockState);
			if (dockState == DockState.DockLeftAutoHide || dockState == DockState.DockRightAutoHide)
				g.DrawString(content.DockHandler.TabText, TextFont, BrushTabText, rectText, StringFormatTabVertical);
                //g.DrawString(content.DockHandler.TabText, TextFont, new SolidBrush(colorTable.TabControlBorderColor), rectText, StringFormatTabVertical);
            else
				g.DrawString(content.DockHandler.TabText, TextFont, BrushTabText, rectText, StringFormatTabHorizontal);
                //g.DrawString(content.DockHandler.TabText, TextFont, new SolidBrush(colorTable.TabControlBorderColor), rectText, StringFormatTabHorizontal);

			// Set rotate back
			g.Transform = matrixRotate;
		}
开发者ID:GarnettLuo,项目名称:XiaoCai.WinformUI,代码行数:49,代码来源:VS2005AutoHideStrip.cs


示例10: DrawTab_Document

        private void DrawTab_Document(Graphics g, TabVS2005 tab, Rectangle rect)
        {
            if (tab.TabWidth == 0)
                return;

            Rectangle rectIcon = new Rectangle(
                rect.X + DocumentIconGapLeft,
                rect.Y + rect.Height - 1 - DocumentIconGapBottom - DocumentIconHeight,
                DocumentIconWidth, DocumentIconHeight);
            Rectangle rectText = rectIcon;
            if (DockPane.DockPanel.ShowDocumentIcon)
            {
                rectText.X += rectIcon.Width + DocumentIconGapRight;
                rectText.Y = rect.Y;
                rectText.Width = rect.Width - rectIcon.Width - DocumentIconGapLeft -
                    DocumentIconGapRight - DocumentTextGapRight;
                rectText.Height = rect.Height;
            }
            else
                rectText.Width = rect.Width - DocumentIconGapLeft - DocumentTextGapRight;

            Rectangle rectTab = DrawHelper.RtlTransform(this, rect);
            rectText = DrawHelper.RtlTransform(this, rectText);
            rectIcon = DrawHelper.RtlTransform(this, rectIcon);
            GraphicsPath path = GetTabOutline(tab, true, false);
            if (DockPane.ActiveContent == tab.Content)
            {
                g.FillPath(BrushDocumentActiveBackground, path);
                g.DrawPath(PenDocumentTabActiveBorder, path);
                if (DockPane.IsActiveDocumentPane) {
                    using (SolidBrush brush = new SolidBrush(ColorDocumentActiveText))
                        g.DrawString(tab.Content.DockHandler.TabText, BoldFont, brush,
                                     rectText, DocumentStringFormat);
                } else {
                    using (SolidBrush brush = new SolidBrush(ColorDocumentActiveText))
                        g.DrawString(tab.Content.DockHandler.TabText, TextFont, brush,
                                     rectText, DocumentStringFormat);
                }
            }
            else
            {
                g.FillPath(BrushDocumentInactiveBackground, path);
                g.DrawPath(PenDocumentTabInactiveBorder, path);
                using (SolidBrush brush = new SolidBrush(ColorDocumentInactiveText))
                    g.DrawString(tab.Content.DockHandler.TabText, TextFont, brush,
                                 rectText, DocumentStringFormat);
            }

            if (rectTab.Contains(rectIcon) && DockPane.DockPanel.ShowDocumentIcon)
                g.DrawIcon(tab.Content.DockHandler.Icon, rectIcon);
        }
开发者ID:lazanet,项目名称:messylab,代码行数:51,代码来源:VS2005DockPaneStrip.cs


示例11: DrawTab_Document

        private void DrawTab_Document(Graphics g, TabVS2005 tab, Rectangle rect)
        {
            if (tab.TabWidth == 0)
                return;

            Rectangle rectIcon = new Rectangle(
                rect.X + DocumentIconGapLeft,
                rect.Y + rect.Height - 1 - DocumentIconGapBottom - DocumentIconHeight,
                DocumentIconWidth, DocumentIconHeight);
            Rectangle rectText = rectIcon;

            // CHANGED - NICK
            rectText.Y += 2;

            // CHANGED - MIKA
            if (Font.SizeInPoints <= 8F) rectText.Y -= 1;

            if (DockPane.DockPanel.ShowDocumentIcon)
            {
                rectText.X += rectIcon.Width + DocumentIconGapRight;
                rectText.Y = rect.Y;
                rectText.Width = rect.Width - rectIcon.Width - DocumentIconGapLeft -
                    DocumentIconGapRight - DocumentTextGapRight;
                rectText.Height = rect.Height;
            }
            else
                rectText.Width = rect.Width - DocumentIconGapLeft - DocumentTextGapRight;

            Rectangle rectTab = DrawHelper.RtlTransform(this, rect);
            rectText = DrawHelper.RtlTransform(this, rectText);
            rectIcon = DrawHelper.RtlTransform(this, rectIcon);
            GraphicsPath path = GetTabOutline(tab, true, false);
            if (DockPane.ActiveContent == tab.Content)
            {
                g.FillPath(BrushDocumentActiveBackground, path);
                g.DrawPath(PenDocumentTabActiveBorder, path);

                // CHANGED to eliminate line between selected tab and content - NICK
                RectangleF r = path.GetBounds();
                /*if (PluginCore.PluginBase.Settings.UseSystemColors)
                {
                    using (Pen pen = new Pen(SystemColors.ControlLight))
                    {
                        g.DrawLine(pen, r.Left + 2, r.Bottom - 1, r.Right - 1, r.Bottom - 1);
                    }
                }
                else
                {*/
                    using (Pen pen = new Pen(Color.FromArgb(240, 239, 243)))
                    {
                        g.DrawLine(pen, r.Left + 2, r.Bottom - 1, r.Right - 1, r.Bottom - 1);
                    }
                //}
                if (DockPane.IsActiveDocumentPane)
                    TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, BoldFont, rectText, ColorDocumentActiveText, DocumentTextFormat);
                else
                    TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, Font, rectText, ColorDocumentInactiveText, DocumentTextFormat);
            }
            else
            {
                // CHANGE by NICK: emulate VS-style inactive tab gradient
                Brush tabBrush = new LinearGradientBrush(rectTab,
                    SystemColors.ControlLightLight, SystemColors.ControlLight, LinearGradientMode.Vertical);

                //g.FillPath(BrushDocumentInactiveBackground, path);
                g.FillPath(tabBrush, path);
                g.DrawPath(PenDocumentTabInactiveBorder, path);
                TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, Font, rectText, ColorDocumentInactiveText, DocumentTextFormat);
            }

            if (rectTab.Contains(rectIcon) && DockPane.DockPanel.ShowDocumentIcon)
                g.DrawIcon(tab.Content.DockHandler.Icon, rectIcon);
        }
开发者ID:rudybear,项目名称:moai-ide,代码行数:73,代码来源:VS2005DockPaneStrip.cs


示例12: DrawTab_Document

		private void DrawTab_Document(Graphics g, TabVS2005 tab, Rectangle rect)
		{
            if (tab.TabWidth == 0)
                return;

            Rectangle rectIcon = new Rectangle(
                rect.X + DocumentIconGapLeft,
                rect.Y + rect.Height - 1 - DocumentIconGapBottom - DocumentIconHeight,
                DocumentIconWidth, DocumentIconHeight);
            Rectangle rectText = rectIcon;
            if (DockPane.DockPanel.ShowDocumentIcon)
            {
                rectText.X += rectIcon.Width + DocumentIconGapRight;
                rectText.Y = rect.Y;
                rectText.Width = rect.Width - rectIcon.Width - DocumentIconGapLeft -
                    DocumentIconGapRight - DocumentTextGapRight;
                rectText.Height = rect.Height;
            }
            else
                rectText.Width = rect.Width - DocumentIconGapLeft - DocumentTextGapRight;

            Rectangle rectTab = DrawHelper.RtlTransform(this, rect);
            rectText = DrawHelper.RtlTransform(this, rectText);
            rectIcon = DrawHelper.RtlTransform(this, rectIcon);
            GraphicsPath path = GetTabOutline(tab, true, false);
            OfficeColorTable colorTable = StyleBuilderFactory.GetOffice2007ColorTable(StyleManager.Style);
            if (DockPane.ActiveContent == tab.Content)
            {
               
                g.FillPath(new SolidBrush(colorTable.TabControlPageHoverColor2), path);
                g.DrawPath(new Pen(colorTable.TabControlBorderColor), path);
                 //g.FillPath(BrushDocumentActiveBackground, path);
                //g.DrawPath(PenDocumentTabActiveBorder, path);//Mark by Agan  2013/06/08
                if (DockPane.IsActiveDocumentPane)
                    //TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, BoldFont, rectText, ColorDocumentActiveText, DocumentTextFormat);
                    TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, BoldFont, rectText, colorTable.TabControlPageTextColor, DocumentTextFormat);
                else
                    //TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, ColorDocumentActiveText, DocumentTextFormat);
                    TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, colorTable.TabControlPageTextColor, DocumentTextFormat);
            }
            else
            {
                g.FillPath(new SolidBrush(colorTable.TabControlPageBackColor), path);
                g.DrawPath(new Pen(colorTable.TabControlBorderColor), path);
                
                //Modify by Agan 2013/06/08
                //g.FillPath(BrushDocumentInactiveBackground, path);
                //g.DrawPath(PenDocumentTabInactiveBorder, path);

                //TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, ColorDocumentInactiveText, DocumentTextFormat);
                TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, colorTable.TabControlPageTextColor, DocumentTextFormat);
            }

            if (rectTab.Contains(rectIcon) && DockPane.DockPanel.ShowDocumentIcon)
                g.DrawIcon(tab.Content.DockHandler.Icon, rectIcon);
        }
开发者ID:GarnettLuo,项目名称:XiaoCai.WinformUI,代码行数:56,代码来源:VS2005DockPaneStrip.cs


示例13: DrawTab_ToolWindow

		private void DrawTab_ToolWindow(Graphics g, TabVS2005 tab, Rectangle rect)
		{
			Rectangle rectIcon = new Rectangle(
				rect.X + ToolWindowImageGapLeft,
				rect.Y + rect.Height - 1 - ToolWindowImageGapBottom - ToolWindowImageHeight,
				ToolWindowImageWidth, ToolWindowImageHeight);
			Rectangle rectText = rectIcon;
			rectText.X += rectIcon.Width + ToolWindowImageGapRight;
			rectText.Width = rect.Width - rectIcon.Width - ToolWindowImageGapLeft - 
				ToolWindowImageGapRight - ToolWindowTextGapRight;

            Rectangle rectTab = DrawHelper.RtlTransform(this, rect);
            rectText = DrawHelper.RtlTransform(this, rectText);
            rectIcon = DrawHelper.RtlTransform(this, rectIcon);
            GraphicsPath path = GetTabOutline(tab, true, false);
			if (DockPane.ActiveContent == tab.Content)
			{
                OfficeColorTable colorTable = StyleBuilderFactory.GetOffice2007ColorTable(StyleManager.Style);

                g.FillPath(new SolidBrush(colorTable.TabControlPageHoverColor2), path);
                g.DrawPath(new Pen(colorTable.TabControlBorderColor), path);
                //Modify by Agan 2013-06-09
                    //g.FillPath(BrushToolWindowActiveBackground, path);
                    //g.DrawPath(PenToolWindowTabBorder, path);  

                
                TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, ColorToolWindowActiveText, ToolWindowTextFormat);
			}
			else
			{
                if (Tabs.IndexOf(DockPane.ActiveContent) != Tabs.IndexOf(tab) + 1)
                {
                    Point pt1 = new Point(rect.Right, rect.Top + ToolWindowTabSeperatorGapTop);
                    Point pt2 = new Point(rect.Right, rect.Bottom - ToolWindowTabSeperatorGapBottom); 
                    g.DrawLine(PenToolWindowTabBorder, DrawHelper.RtlTransform(this, pt1), DrawHelper.RtlTransform(this, pt2));
                    //g.DrawLine(new Pen(Color.Red), DrawHelper.RtlTransform(this, pt1), DrawHelper.RtlTransform(this, pt2));
                }
				TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, ColorToolWindowInactiveText, ToolWindowTextFormat);
			}

			if (rectTab.Contains(rectIcon))
				g.DrawIcon(tab.Content.DockHandler.Icon, rectIcon);
		}
开发者ID:GarnettLuo,项目名称:XiaoCai.WinformUI,代码行数:43,代码来源:VS2005DockPaneStrip.cs


示例14: DrawTab_Document

		private void DrawTab_Document(Graphics g, TabVS2005 tab, Rectangle rect)
		{
            if (tab.TabWidth == 0)
                return;

            Rectangle rectIcon = new Rectangle(
                rect.X + DocumentIconGapLeft,
                rect.Y + rect.Height - 1 - DocumentIconGapBottom - DocumentIconHeight + 1,
                DocumentIconWidth, DocumentIconHeight);
            Rectangle rectText = rectIcon;
            if (DockPane.DockPanel.ShowDocumentIcon)
            {
                rectText.X += rectIcon.Width + DocumentIconGapRight;
                rectText.Y = rect.Y;
                rectText.Width = rect.Width - rectIcon.Width - DocumentIconGapLeft -
                    DocumentIconGapRight - DocumentTextGapRight;
                rectText.Height = rect.Height;
            }
            else
            {
                rectText.Width = rect.Width - DocumentIconGapLeft - DocumentTextGapRight;
            }
            Font fnt = TextFont;
            if (DockPane.IsActiveDocumentPane)
                fnt = BoldFont;
            rectText.Y = rect.Y + Convert.ToInt32((rect.Height - fnt.Height) / 2) - 1;
            rectText.Height = fnt.Height + 1;
            Rectangle rectTab = DrawHelper.RtlTransform(this, rect);
            rectText = DrawHelper.RtlTransform(this, rectText);
            rectIcon = DrawHelper.RtlTransform(this, rectIcon);
            GraphicsPath path = GetTabOutline(tab, true, false);
            if (DockPane.ActiveContent == tab.Content)
            {
                g.FillPath(BrushDocumentActiveBackground, path);
                g.DrawPath(PenDocumentTabActiveBorder, path);
                if (DockPane.IsActiveDocumentPane)
                    TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, BoldFont, rectText, ColorDocumentActiveText, DocumentTextFormat);
                else
                    TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, ColorDocumentActiveText, DocumentTextFormat);
            }
            else
            {
                g.FillPath(BrushDocumentInactiveBackground, path);
                g.DrawPath(PenDocumentTabInactiveBorder, path);
                TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, ColorDocumentInactiveText, DocumentTextFormat);
            }

            if (rectTab.Contains(rectIcon) && DockPane.DockPanel.ShowDocumentIcon)
                g.DrawIcon(tab.Content.DockHandler.Icon, rectIcon);
        }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:50,代码来源:VS2005DockPaneStrip.cs


示例15: DrawTab

        private void DrawTab(Graphics g, TabVS2005 tab)
        {
            Rectangle rectTabOrigin = GetTabRectangle(tab);
            if (rectTabOrigin.IsEmpty)
                return;

            DockState dockState = tab.Content.DockHandler.DockState;
            IDockContent content = tab.Content;

            GraphicsPath path = GetTabOutline(tab, false, true);
            using (LinearGradientBrush brush = new LinearGradientBrush(rectTabOrigin,
                    PaletteHelper.InactiveBackColor1, PaletteHelper.InactiveBackColor2, LinearGradientMode.Vertical))
            {
                brush.Blend = PaletteHelper.ActiveBackColorGradientBlend;
                g.FillPath(brush, path);
            }
            //g.FillPath(BrushTabBackground, path);
            g.DrawPath(PenTabBorder, path);

            // Set no rotate for drawing icon and text
            Matrix matrixRotate = g.Transform;
            g.Transform = MatrixIdentity;

            // Draw the icon
            Rectangle rectImage = rectTabOrigin;
            rectImage.X += ImageGapLeft;
            rectImage.Y += ImageGapTop;
            int imageHeight = rectTabOrigin.Height - ImageGapTop - ImageGapBottom;
            int imageWidth = ImageWidth;
            if (imageHeight > ImageHeight)
                imageWidth = ImageWidth * (imageHeight / ImageHeight);
            rectImage.Height = imageHeight;
            rectImage.Width = imageWidth;
            rectImage = GetTransformedRectangle(dockState, rectImage);
            g.DrawIcon(((Form)content).Icon, RtlTransform(rectImage, dockState));

            // Draw the text
            Rectangle rectText = rectTabOrigin;
            rectText.X += ImageGapLeft + imageWidth + ImageGapRight + TextGapLeft;
            rectText.Width -= ImageGapLeft + imageWidth + ImageGapRight + TextGapLeft;
            rectText = RtlTransform(GetTransformedRectangle(dockState, rectText), dockState);
            if (dockState == DockState.DockLeftAutoHide || dockState == DockState.DockRightAutoHide)
                g.DrawString(content.DockHandler.TabText, TextFont, BrushTabText, rectText, StringFormatTabVertical);
            else
                g.DrawString(content.DockHandler.TabText, TextFont, BrushTabText, rectText, StringFormatTabHorizontal);

            // Set rotate back
            g.Transform = matrixRotate;
        }
开发者ID:BachelorEric,项目名称:ModelFirst,代码行数:49,代码来源:VS2005AutoHideStrip.cs


示例16: DrawTab

 private void DrawTab(Graphics g, TabVS2005 tab, Rectangle rect)
 {
     if (Appearance == DockPane.AppearanceStyle.ToolWindow)
         DrawTab_ToolWindow(g, tab, rect);
     else
         DrawTab_Document(g, tab, rect);
 }
开发者ID:n1nj4n,项目名称:renderdoc,代码行数:7,代码来源:VS2005DockPaneStrip.cs


示例17: DrawTab

        private void DrawTab(Graphics g, TabVS2005 tab)
        {
            Rectangle rectTabOrigin = this.GetTabRectangle(tab);
            if (rectTabOrigin.IsEmpty)
                return;

            DockState dockState = tab.Content.DockHandler.DockState;
            IDockContent content = tab.Content;

            GraphicsPath path = this.GetTabOutline(tab, false, true);

            Color startColor = DockPanel.Skin.AutoHideStripSkin.TabGradient.StartColor;
            Color endColor = DockPanel.Skin.AutoHideStripSkin.TabGradient.EndColor;
            LinearGradientMode gradientMode = DockPanel.Skin.AutoHideStripSkin.TabGradient.LinearGradientMode;
            g.FillPath(new LinearGradientBrush(rectTabOrigin, startColor, endColor, gradientMode), path);
            g.DrawPath(PenTabBorder, path);

            // Set no rotate for drawing icon and text
            Matrix matrixRotate = g.Transform;
            g.Transform = MatrixIdentity;

            // Draw the icon
            Rectangle rectImage = rectTabOrigin;
            rectImage.X += ImageGapLeft;
            rectImage.Y += ImageGapTop;
            int imageHeight = rectTabOrigin.Height - ImageGapTop - ImageGapBottom;
            int imageWidth = ImageWidth;
            if (imageHeight > ImageHeight)
                imageWidth = ImageWidth * (imageHeight / ImageHeight);
          

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Table类代码示例发布时间:2022-05-24
下一篇:
C# TabState类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap