DotNet 4.8.1 build of DotNetBar

This commit is contained in:
2025-02-07 10:35:23 -05:00
parent 33439b63a0
commit 6b0a5d60f4
2609 changed files with 989814 additions and 7 deletions

View File

@@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
namespace DevComponents.DotNetBar
{
public class MultiFormAppContext : ApplicationContext
{
private List<WeakReference> _OpenedForms = new List<WeakReference>();
public MultiFormAppContext(Form initialForm)
{
// Handle the ApplicationExit event to know when the application is exiting.
Application.ApplicationExit += new EventHandler(this.OnApplicationExit);
WeakReference reference=new WeakReference(initialForm);
_OpenedForms.Add(reference);
initialForm.FormClosed += FormClosed;
initialForm.Show();
}
public void RegisterOpenForm(Form form)
{
bool opened = false;
foreach (WeakReference item in _OpenedForms)
{
object target = item.Target;
if (target != null && target.Equals(form))
{
opened = true;
break;
}
}
if (!opened)
{
WeakReference reference = new WeakReference(form);
_OpenedForms.Add(reference);
form.FormClosed += FormClosed;
}
}
/// <summary>
/// Returns read-only list of opened forms.
/// </summary>
public List<Form> OpenedForms
{
get
{
List<Form> list=new List<Form>();
foreach (WeakReference item in _OpenedForms)
{
object target = item.Target;
if (target != null && target is Form)
{
list.Add((Form)target);
}
}
return list;
}
}
private void FormClosed(object sender, FormClosedEventArgs e)
{
Form form = (Form) sender;
form.FormClosed -= FormClosed;
foreach (WeakReference item in _OpenedForms)
{
object target = item.Target;
if (target != null && target.Equals(form))
{
_OpenedForms.Remove(item);
break;
}
}
if(_OpenedForms.Count==0)
ExitThread();
}
protected virtual void OnApplicationExit(object sender, EventArgs e)
{
}
private static MultiFormAppContext _CurrentMultiFormAppContext=null;
/// <summary>
/// Gets or sets current MultiFormAppContext context. If you are using MultiFormAppContext to start your app then you should also
/// set that instance of MultiFormAppContext to this property so internally TabFormControl can register any new deattached forms
/// and prevent application from closing if startup form is closed first.
/// </summary>
public static MultiFormAppContext Current
{
get { return _CurrentMultiFormAppContext; }
set { _CurrentMultiFormAppContext = value; }
}
}
}

View File

@@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
namespace DevComponents.DotNetBar.Controls
{
public class NewTabFormItem : TabFormItemBase
{
#region Internal Implementation
public override void Paint(ItemPaintArgs p)
{
Rendering.BaseRenderer renderer = p.Renderer;
if (renderer != null)
{
p.ButtonItemRendererEventArgs.Graphics = p.Graphics;
p.ButtonItemRendererEventArgs.ButtonItem = this;
p.ButtonItemRendererEventArgs.ItemPaintArgs = p;
renderer.DrawNewTabFormItem(p.ButtonItemRendererEventArgs);
}
if (!string.IsNullOrEmpty(NotificationMarkText))
DevComponents.DotNetBar.Rendering.NotificationMarkPainter.Paint(p.Graphics, this.Bounds, NotificationMarkPosition,
NotificationMarkText, new Size(NotificationMarkSize, NotificationMarkSize), NotificationMarkOffset, NotificationMarkColor);
this.DrawInsertMarker(p.Graphics);
}
public override void RecalcSize()
{
m_Rect.Width = Dpi.Width32 + TabFormItem.TabOverlap/2;
m_Rect.Height = Dpi.Height16;
m_NeedRecalcSize = false;
}
private string _CashedColorTableName = "Default";
internal override string GetColorTableName()
{
return this.CustomColorName != "" ? this.CustomColorName : _CashedColorTableName;
}
private Color[] _BackColors = null;
/// <summary>
/// Indicates the array of colors that when set are used to draw the background of the item.
/// </summary>
[DefaultValue(null), Category("Appearance"), Description("Indicates the array of colors that when set are used to draw the background of the item."), TypeConverter(typeof(ArrayConverter))]
public Color[] BackColors
{
get
{
return _BackColors;
}
set
{
if (_BackColors != value)
{
_BackColors = value;
//OnPropertyChanged(new PropertyChangedEventArgs("Colors"));
this.Refresh();
}
}
}
#endregion
}
}

View File

@@ -0,0 +1,186 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Text;
using DevComponents.DotNetBar.Controls;
namespace DevComponents.DotNetBar.Rendering
{
internal class OfficeNewTabFormItemPainter : Office2007ButtonItemPainter
{
protected override void PaintState(ButtonItem button, ItemPaintArgs pa, CompositeImage image, Rectangle r, bool isMouseDown)
{
if (r.IsEmpty || !IsItemEnabled(button, pa) || r.Width == 0 || r.Height == 0)
return;
NewTabFormItem tab = button as NewTabFormItem;
if (tab == null || IsOnMenu(button, pa))
{
base.PaintState(button, pa, image, r, isMouseDown);
return;
}
bool isOnMenu = pa.IsOnMenu;
TabFormItemColorTable tabColorTable = GetColorTable(tab);
if (tabColorTable == null)
return;
TabFormItemStateColorTable stateColors = GetStateColorTable(tabColorTable, tab);
if (stateColors == null)
return;
r.X += Overlap;
r.Width -= Overlap;
Graphics g = pa.Graphics;
Region oldClip = g.Clip;
try
{
Rectangle rClip = GetTabBounds(tab);
rClip.Inflate(2, 1);
g.SetClip(rClip, CombineMode.Intersect);
if (stateColors.BackColors != null && stateColors.BackColors.Length > 0 || tab.BackColors != null && tab.BackColors.Length > 0)
{
using (Brush brush = DisplayHelp.CreateBrush(r, (tab.BackColors != null && tab.BackColors.Length > 0) ? tab.BackColors : stateColors.BackColors, stateColors.BackColorsGradientAngle, stateColors.BackColorsPositions))
{
GraphicsPath path = GetTabPath(r);
g.FillPath(brush, path);
tab.TabPath = path;
}
}
if (stateColors.BorderColors.Length > 0)
{
Rectangle borderRect = r;
foreach (Color color in stateColors.BorderColors)
{
using (GraphicsPath path = GetTabPath(borderRect))
{
using (Pen pen = new Pen(color, Dpi.Width1))
{
pen.LineJoin = LineJoin.Round;
g.DrawPath(pen, path);
}
}
borderRect.Inflate(-Dpi.Width1, -Dpi.Width1);
}
}
g.Clip = oldClip;
}
finally
{
if (oldClip != null) oldClip.Dispose();
}
}
private int Overlap
{
get { return TabFormItem.TabOverlap / 2; }
}
private Rectangle GetTabBounds(NewTabFormItem tab)
{
Rectangle r = tab.DisplayRectangle;
r.X += Overlap;
r.Width -= Overlap;
using (GraphicsPath tabPath = GetTabPath(r))
r = Rectangle.Round(tabPath.GetBounds());
return r;
}
private GraphicsPath GetTabPath(Rectangle r)
{
GraphicsPath path = new GraphicsPath();
//float factor = r.Height / 13.5f;
path.AddLine(2, 0, 5, 14);
path.AddLine(31, 14, 28, 0);
//path.AddLine(29.5f, 14.5f, 6.5f, 14.5f);
//path.AddCurve(new PointF[]
//{
// new PointF(5.83333f,14.1667f ),
// new PointF(5.16667f,13.8333f),
// new PointF(4.66667f,13.1667f)
//});
//path.AddCurve(new PointF[]
//{
// new PointF(4.16667f,12.5f),
// new PointF(3.83333f,11.5f),
// new PointF(3.16667f,9.83333f)
//});
//path.AddCurve(new PointF[]
//{
// new PointF(2.5f,8.16667f ),
// new PointF(1.5f,5.83333f ),
// new PointF(1f,4.16667f)
//});
//path.AddCurve(new PointF[]
//{
// new PointF(0.5f,2.5f),
// new PointF(0.5f,1.5f ),
// new PointF(0.5f,0.5f)
//});
//path.AddLine(0.5f, 0.5f, 25.5f, 0.5f);
//path.AddCurve(new PointF[]
//{
// new PointF(26.8333f,2.5f ),
// new PointF(28.1667f,4.5f ),
// new PointF(29.1667f,6.83333f)
//});
//path.AddCurve(new PointF[]
//{
// new PointF(30.1667f,9.16667f ),
// new PointF(30.8333f,11.8333f ),
// new PointF(30.8333f,13.1667f)
//});
//path.AddCurve(new PointF[]
//{
// new PointF(30.8333f,14.5f ),
// new PointF(30.1667f,14.5f ),
// new PointF(30.1667f,14.5f )
//});
path.CloseAllFigures();
Matrix translateMatrix = new Matrix();
translateMatrix.Translate(r.X, r.Y);
if (Dpi.Factor.Width > 1)
translateMatrix.Scale(Dpi.Factor.Width, Dpi.Factor.Width);
path.Transform(translateMatrix);
return path;
}
private TabFormItemColorTable GetColorTable(NewTabFormItem tab)
{
return this.ColorTable.TabFormItemColorTables[tab.GetColorTableName()];
}
internal static TabFormItemStateColorTable GetStateColorTable(TabFormItemColorTable tabColorTable, NewTabFormItem tab)
{
if (tabColorTable == null)
return null;
TabFormItemStateColorTable stateColors = null;
if (!tab.RenderTabState)
stateColors = tabColorTable.Default;
else if (!tab.GetEnabled())
stateColors = tabColorTable.Disabled;
else if (tab.Checked)
stateColors = tabColorTable.Selected;
else if (tab.IsMouseOver)
stateColors = tabColorTable.MouseOver;
else
stateColors = tabColorTable.Default;
return stateColors;
}
}
}

View File

@@ -0,0 +1,426 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Text;
using DevComponents.DotNetBar.Controls;
namespace DevComponents.DotNetBar.Rendering
{
internal class OfficeTabFormItemPainter : Office2007ButtonItemPainter
{
protected override Rectangle GetTextRectangle(ButtonItem button, ItemPaintArgs pa, eTextFormat stringFormat, CompositeImage image)
{
Rectangle r = base.GetTextRectangle(button, pa, stringFormat, image);
if (image == null && string.IsNullOrEmpty(button.SymbolRealized))
{
r.Inflate(-(TabFormItem.TabOverlap / 2), 0);
//r.Inflate(-3, 0);
}
else
r.X += TabFormItem.TabOverlap / 2 - TabFormItem.Offset;
return r;
}
public override Rectangle GetImageRectangle(ButtonItem button, ItemPaintArgs pa, CompositeImage image)
{
Rectangle r = base.GetImageRectangle(button, pa, image);
//if (button.ImagePosition == eImagePosition.Left)
r.X += TabFormItem.TabOverlap / 2 - TabFormItem.Offset;
//else if (button.ImagePosition == eImagePosition.Right)
// r.X -= TabOverlap/2 - Offset;
return r;
}
public override eTextFormat GetStringFormat(ButtonItem button, ItemPaintArgs pa, CompositeImage image)
{
eTextFormat sf = base.GetStringFormat(button, pa, image);
sf &= ~(sf & eTextFormat.EndEllipsis);
return sf;
}
protected override void PaintState(ButtonItem button, ItemPaintArgs pa, CompositeImage image, Rectangle r, bool isMouseDown)
{
if (r.IsEmpty || !IsItemEnabled(button, pa) || r.Width == 0 || r.Height == 0)
return;
TabFormItem tab = button as TabFormItem;
if (tab == null || IsOnMenu(button, pa))
{
base.PaintState(button, pa, image, r, isMouseDown);
return;
}
bool isOnMenu = pa.IsOnMenu;
TabFormItemColorTable tabColorTable = GetColorTable(tab);
if (tabColorTable == null)
return;
TabFormItemStateColorTable stateColors = GetStateColorTable(tabColorTable, tab);
if (stateColors == null)
return;
Graphics g = pa.Graphics;
Region oldClip = g.Clip;
try
{
Rectangle rClip = GetTabBounds(tab);
rClip.Inflate(1, 0);
g.SetClip(rClip, CombineMode.Intersect);
eTabFormStripControlDock tabAlign = tab.TabAlignment;
tab.TabPath = GetTabPath(r, tabAlign, true);
if (stateColors.BackColors != null && stateColors.BackColors.Length > 0 || tab.BackColors != null && tab.BackColors.Length > 0)
{
using (Brush brush = DisplayHelp.CreateBrush(r, (tab.BackColors != null && tab.BackColors.Length > 0) ? tab.BackColors : stateColors.BackColors, stateColors.BackColorsGradientAngle, stateColors.BackColorsPositions))
{
using (GraphicsPath path = GetTabPath(r, tabAlign, true))
{
g.FillPath(Brushes.White, path);
g.FillPath(brush, path);
}
}
}
if (stateColors.BorderColors.Length > 0)
{
Rectangle borderRect = r;
foreach (Color color in stateColors.BorderColors)
{
using (GraphicsPath path = GetTabPath(borderRect, tabAlign, false))
{
using (Pen pen = new Pen(color, Dpi.Width1))
g.DrawPath(pen, path);
}
borderRect.Inflate(-Dpi.Width1, -Dpi.Width1);
}
}
if (tab.CloseButtonVisible)
{
int closeButtonSize = Dpi.Width(TabFormItem.CloseButtonSize);
Rectangle closeBounds = new Rectangle(r.Right - (TabFormItem.TabOverlap + TabFormItem.Radius - TabFormItem.Offset), r.Y + (r.Height - closeButtonSize) / 2 + Dpi.Height1, closeButtonSize, closeButtonSize);
TabCloseButtonStateColorTable closeButtonColorTable = GetCloseButtonColorTable(tabColorTable, tab);
if (closeButtonColorTable.BackColors.Length > 0)
{
using (
Brush brush = DisplayHelp.CreateBrush(closeBounds, closeButtonColorTable.BackColors,
closeButtonColorTable.BackColorsGradientAngle, closeButtonColorTable.BackColorsPositions)
)
{
g.FillEllipse(brush, closeBounds);
}
}
if (!closeButtonColorTable.BorderColor.IsEmpty)
{
using (Pen pen = new Pen(closeButtonColorTable.BorderColor, Dpi.Width1))
{
g.DrawEllipse(pen, closeBounds);
}
}
Color fc = stateColors.TextColor;
if (!closeButtonColorTable.ForeColor.IsEmpty)
fc = closeButtonColorTable.ForeColor;
using (Pen pen = new Pen(fc, Dpi.Width2))
{
Rectangle rc = closeBounds;
rc.Inflate(-Dpi.Width3, -Dpi.Width3);
g.DrawLine(pen, rc.X, rc.Y, rc.Right, rc.Bottom);
g.DrawLine(pen, rc.Right, rc.Y, rc.X, rc.Bottom);
}
tab.CloseButtonBounds = closeBounds;
}
else
tab.CloseButtonBounds = Rectangle.Empty;
if (tab.Checked)
{
g.ResetClip();
using (Pen pen = new Pen(stateColors.BorderColors[0], Dpi.Width1))
{
Rectangle tb = GetTabBounds(tab);
tb.Inflate(-Dpi.Width2, 0);
TabFormItemsSimpleContainer cont = tab.Parent as TabFormItemsSimpleContainer;
if (cont == null || cont.ClippingRectangle.IsEmpty || cont.ClippingRectangle.IntersectsWith(tb))
{
if (cont != null && !cont.ClippingRectangle.IsEmpty && cont.ClippingRectangle.IntersectsWith(tb) && tb.Right > cont.ClippingRectangle.Right)
tb.Width = Math.Max(1, cont.ClippingRectangle.Right - tb.X);
if (tabAlign == eTabFormStripControlDock.Bottom)
{
g.DrawLine(pen, 0, tb.Y, tb.X, tb.Y);
g.DrawLine(pen, tb.Right, tb.Y, pa.ContainerControl.Width, tb.Y);
}
else
{
g.DrawLine(pen, 0, tb.Bottom - 1, tb.X, tb.Bottom - 1);
g.DrawLine(pen, tb.Right, tb.Bottom - 1, pa.ContainerControl.Width, tb.Bottom - 1);
}
}
else
{
if (tabAlign == eTabFormStripControlDock.Bottom)
{
g.DrawLine(pen, 0, tb.Y, pa.ContainerControl.Width, tb.Y);
}
else
{
g.DrawLine(pen, 0, tb.Bottom - 1, pa.ContainerControl.Width, tb.Bottom - 1);
}
}
}
}
g.Clip = oldClip;
}
finally
{
if (oldClip != null) oldClip.Dispose();
}
}
private TabCloseButtonStateColorTable GetCloseButtonColorTable(TabFormItemColorTable tabColorTable, TabFormItem tab)
{
if (tab.CloseButtonState == eButtonState.MouseDownLeft)
return tabColorTable.CloseButton.Pressed;
else if (tab.CloseButtonState == eButtonState.MouseOver)
return tabColorTable.CloseButton.MouseOver;
return tabColorTable.CloseButton.Normal;
}
private Rectangle GetTabBounds(TabFormItem tab)
{
Rectangle r = tab.DisplayRectangle;
using (GraphicsPath tabPath = GetTabPath(r, tab.TabAlignment, false))
r = Rectangle.Round(tabPath.GetBounds());
return r;
}
private GraphicsPath GetTabPath(Rectangle r, eTabFormStripControlDock align, bool bCloseFigure)
{
return GetTopTabPath(r);
Rectangle rbox = r;
//if (align == eTabFormStripControlDock.Left)
//{
// // Left
// rbox = new Rectangle(r.X, r.Y, r.Height, r.Width);
//}
//else if (align == eTabFormStripControlDock.Right)
//{
// // Right
// rbox = new Rectangle(r.Right - r.Height, r.Y, r.Height, r.Width);
//}
GraphicsPath path = new GraphicsPath();
if (align != eTabFormStripControlDock.Bottom)
{
Point[] p = new Point[4];
int slope = Math.Min(rbox.Width > rbox.Height ? 16 : 10, rbox.Height / 2);
p[0].X = rbox.X - (slope + Dpi.Width6);
p[0].Y = rbox.Bottom - 1;
p[1].X = p[0].X + Dpi.Width6;
p[1].Y = p[0].Y - Dpi.Height4;
p[2].X = p[1].X + slope - Dpi.Width4;
p[2].Y = rbox.Y + Dpi.Height3;
p[3].X = rbox.X + Dpi.Width3;
p[3].Y = rbox.Y;
path.AddCurve(p, 0, 3, Math.Max(.3f, 1f * Math.Min(1, slope / (float)rbox.Height)));
//path.AddLine(p[3].X + 1, rbox.Y, rbox.Right-Dpi.Width4, rbox.Y);
p = new Point[4];
p[0].X = rbox.Right - Dpi.Width3;
p[0].Y = rbox.Y;
p[1].X = p[0].X + Dpi.Width7;
p[1].Y = p[0].Y + Dpi.Height3;
p[2].X = p[1].X + slope - Dpi.Width4;
p[2].Y = rbox.Bottom - Dpi.Height4 - 1;
p[3].X = p[2].X + Dpi.Width6;
p[3].Y = rbox.Bottom - 1;
path.AddCurve(p, 0, 3, Math.Max(.1f, 1f * Math.Min(1, slope / (float)rbox.Height)));
if (bCloseFigure)
{
path.AddLine(p[0].X, rbox.Bottom, rbox.Right, rbox.Bottom);
path.CloseAllFigures();
}
}
else
{
Point[] p = new Point[4];
int slope = Math.Min(18, rbox.Height / 2);
p[0].X = rbox.X - (slope + Dpi.Width6);
p[0].Y = rbox.Y;
p[1].X = p[0].X + Dpi.Width6;
p[1].Y = p[0].Y + Dpi.Height4;
p[2].X = p[1].X + slope - Dpi.Width4;
p[2].Y = rbox.Bottom - Dpi.Height3 - 1;
p[3].X = rbox.X + Dpi.Width3;
p[3].Y = rbox.Bottom - 1;
path.AddCurve(p, 0, 3, Math.Max(.1f, 1f * Math.Min(1, slope / (float)rbox.Height)));
//path.AddLine(p[3].X + 1, rbox.Y, rbox.Right-Dpi.Width4, rbox.Y);
p = new Point[4];
p[0].X = rbox.Right - Dpi.Width3;
p[0].Y = rbox.Bottom;
p[1].X = p[0].X + Dpi.Width6;
p[1].Y = p[0].Y - Dpi.Height3;
p[2].X = p[1].X + slope - Dpi.Width4;
p[2].Y = rbox.Y + Dpi.Height4;
p[3].X = p[2].X + Dpi.Width6;
p[3].Y = rbox.Y;
path.AddCurve(p, 0, 3, Math.Max(.1f, 1f * Math.Min(1, slope / (float)rbox.Height)));
if (bCloseFigure)
{
path.AddLine(p[0].X, rbox.Bottom, rbox.Right, rbox.Bottom);
path.CloseAllFigures();
}
}
//if (align == eTabStripAlignment.Left)
//{
// // Left
// Matrix m = new Matrix();
// //RectangleF rf=path.GetBounds();
// m.RotateAt(-90, new PointF(rbox.X, rbox.Bottom));
// m.Translate(rbox.Height, rbox.Width - rbox.Height, MatrixOrder.Append);
// path.Transform(m);
//}
//else if (align == eTabStripAlignment.Right)
//{
// // Right
// Matrix m = new Matrix();
// //RectangleF rf=path.GetBounds();
// m.RotateAt(90, new PointF(rbox.Right, rbox.Bottom));
// m.Translate(-rbox.Height, rbox.Width - (rbox.Height - 1), MatrixOrder.Append);
// path.Transform(m);
//}
return path;
}
private GraphicsPath GetTopTabPath(Rectangle tabRect)
{
Rectangle r = tabRect;
r.Width -= Dpi.Width1;
//r.Height -= Dpi.Height(StripeBot);
int k = Math.Min(20, r.Height);
float scale = (float)k / 20;
int delta = (int)(90 * scale) - 25;
int n = (int)((TabFormItem.TabOverlap / 2f) * scale);
// Create the path
GraphicsPath path = new GraphicsPath();
int dia = TabFormItem.Dia;
Rectangle ar = new Rectangle(r.X - TabFormItem.Radius, r.Bottom - dia, dia, dia);
path.AddArc(ar, 90, -delta);
int offset = TabFormItem.Offset;
ar = new Rectangle(r.X + TabFormItem.Radius + offset, r.Y, dia, dia);
path.AddArc(ar, 270 - delta, delta);
ar = new Rectangle(r.Right - (dia + offset + n), r.Y, dia, dia);
path.AddArc(ar, 270, delta);
ar = new Rectangle(r.Right - (dia - offset * 2), r.Bottom - dia, dia, dia);
path.AddArc(ar, 90 + delta, -delta);
return (path);
}
protected override Color GetTextColor(ButtonItem button, ItemPaintArgs pa)
{
if (!IsItemEnabled(button, pa) || !(button is TabFormItem))
return base.GetTextColor(button, pa);
TabFormItem tab = button as TabFormItem;
if (!tab.ForeColor.IsEmpty)
return tab.ForeColor;
Color textColor = Color.Empty;
TabFormItemStateColorTable ct = GetStateColorTable(GetColorTable(tab), tab);
if (ct != null)
{
//if (pa.GlassEnabled && !ct.GlassText.IsEmpty)
// return ct.GlassText;
textColor = ct.TextColor;
}
if (textColor.IsEmpty)
return base.GetTextColor(button, pa);
return textColor;
}
private TabFormItemColorTable GetColorTable(TabFormItem tab)
{
return this.ColorTable.TabFormItemColorTables[tab.GetColorTableName()];
}
internal static TabFormItemStateColorTable GetStateColorTable(TabFormItemColorTable tabColorTable, TabFormItem tab)
{
if (tab.CustomColorTable != null)
tabColorTable = tab.CustomColorTable;
if (tabColorTable == null)
return null;
TabFormItemStateColorTable stateColors = null;
if (!tab.RenderTabState)
stateColors = tabColorTable.Default;
else if (!tab.GetEnabled())
stateColors = tabColorTable.Disabled;
else if (tab.Checked)
stateColors = tabColorTable.Selected;
else if (tab.IsMouseOver)
stateColors = tabColorTable.MouseOver;
else
stateColors = tabColorTable.Default;
return stateColors;
}
//#if FRAMEWORK20
// public override void PaintButtonText(ButtonItem button, ItemPaintArgs pa, Color textColor, CompositeImage image)
// {
// eDotNetBarStyle effectiveStyle = button.EffectiveStyle;
// if (!((effectiveStyle == eDotNetBarStyle.Office2010 || StyleManager.IsMetro(effectiveStyle)) && pa.GlassEnabled))
// {
// base.PaintButtonText(button, pa, textColor, image);
// return;
// }
// Rectangle r = GetTextRectangle(button, pa, eTextFormat.HorizontalCenter | eTextFormat.VerticalCenter, image);
// //r.Offset(0, 3);
// //r.Height -= 2;
// ThemeTextFormat textFormat = ThemeTextFormat.Center | ThemeTextFormat.VCenter | ThemeTextFormat.HidePrefix | ThemeTextFormat.SingleLine;
// bool renderGlow = true;
// //if (effectiveStyle == eDotNetBarStyle.Office2010 && StyleManager.Style == eStyle.Office2010Black)
// // renderGlow = false;
// Office2007RibbonControlPainter.PaintTextOnGlass(pa.Graphics, button.Text, pa.Font, r, textFormat, textColor, true, renderGlow, 10);
// }
//#endif
}
}

View File

@@ -0,0 +1,204 @@
using System;
using System.Collections.Generic;
using System.Text;
using DevComponents.DotNetBar.Controls;
using System.Drawing;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
namespace DevComponents.DotNetBar.Rendering
{
internal class OfficeTabFormStripPainter : TabFormStripPainter, IOffice2007Painter
{
#region IOffice2007Painter
private Office2007ColorTable _ColorTable = null;
/// <summary>
/// Gets or sets color table used by renderer.
/// </summary>
public Office2007ColorTable ColorTable
{
get { return _ColorTable; }
set { _ColorTable = value; }
}
#endregion
public override void Paint(TabFormStripPainterArgs renderingInfo)
{
TabFormStripControl strip = renderingInfo.TabFormStrip;
Graphics g = renderingInfo.Graphics;
Rectangle bounds = strip.ClientRectangle;
bool isFormActive = true;
Form form = strip.FindForm();
if (form != null && (form != System.Windows.Forms.Form.ActiveForm && form.MdiParent == null ||
form.MdiParent != null && form.MdiParent.ActiveMdiChild != form))
isFormActive = false;
//if (ct.BackgroundStyle != null)
//{
// ElementStyleDisplayInfo di = new ElementStyleDisplayInfo(ct.BackgroundStyle, g, bounds);
// ElementStyleDisplay.PaintBackground(di);
//}
TabFormControl tabControl = strip.Parent as TabFormControl;
TabFormColorTable formColorTable = ColorTable.TabForm;
if (tabControl != null && tabControl.ColorTable != null)
formColorTable = tabControl.ColorTable;
TabFormStateColorTable stateColorTable = isFormActive ? formColorTable.Active : formColorTable.Inactive;
if (stateColorTable.CaptionBackColors.Length > 0)
{
Rectangle cb = strip.ClientRectangle;
cb.Inflate(1, 1);
using (
Brush brush = DisplayHelp.CreateBrush(cb, stateColorTable.CaptionBackColors,
stateColorTable.CaptionBackColorsGradientAngle, stateColorTable.CaptionBackColorsPositions))
g.FillRectangle(brush, cb);
}
if (strip.CaptionVisible)
{
if (strip.CaptionBounds.IsEmpty || strip.SystemCaptionItemBounds.IsEmpty)
SetCaptionItemBounds(strip, renderingInfo);
Color captionTextColor = stateColorTable.CaptionText;
eTextFormat textFormat = formColorTable.CaptionTextFormat;
Font font = SystemFonts.DefaultFont;
bool disposeFont = true;
if (strip.CaptionFont != null)
{
font.Dispose();
font = strip.CaptionFont;
disposeFont = false;
}
string text = strip.TitleText;
if (string.IsNullOrEmpty(text) && form != null) text = form.Text;
bool isTitleTextMarkup = strip.TitleTextMarkupBody != null;
Rectangle captionRect = strip.CaptionBounds;
const int CAPTION_TEXT_PADDING = 12;
captionRect.X += CAPTION_TEXT_PADDING;
captionRect.Width -= CAPTION_TEXT_PADDING;
if (StyleManager.Style == eStyle.OfficeMobile2014)
{
captionRect.Y -= 2;
captionRect.Height -= 2;
// Center text in center of window instead of center of available space
if (!strip.SystemCaptionItemBounds.IsEmpty && captionRect.Width > strip.SystemCaptionItemBounds.Width)
{
captionRect.X += strip.SystemCaptionItemBounds.Width / 2 + 18;
captionRect.Width -= strip.SystemCaptionItemBounds.Width / 2 + 18;
}
}
if (!isTitleTextMarkup)
TextDrawing.DrawString(g, text, font, captionTextColor, captionRect, textFormat);
else
{
TextMarkup.MarkupDrawContext d = new TextMarkup.MarkupDrawContext(g, font, captionTextColor, strip.RightToLeft == System.Windows.Forms.RightToLeft.Yes, captionRect, false);
d.AllowMultiLine = false;
d.IgnoreFormattingColors = !isFormActive;
TextMarkup.BodyElement body = strip.TitleTextMarkupBody;
if (strip.TitleTextMarkupLastArrangeBounds != captionRect)
{
body.Measure(captionRect.Size, d);
body.Arrange(captionRect, d);
strip.TitleTextMarkupLastArrangeBounds = captionRect;
Rectangle mr = body.Bounds;
if (mr.Width < captionRect.Width)
mr.Offset((captionRect.Width - mr.Width) / 2, 0);
if (mr.Height < captionRect.Height)
mr.Offset(0, (captionRect.Height - mr.Height) / 2);
body.Bounds = mr;
}
Region oldClip = g.Clip;
g.SetClip(captionRect, CombineMode.Intersect);
body.Render(d);
g.Clip = oldClip;
if (oldClip != null) oldClip.Dispose();
}
if (disposeFont) font.Dispose();
}
}
private void SetCaptionItemBounds(TabFormStripControl strip, TabFormStripPainterArgs renderingInfo)
{
if (!strip.CaptionVisible)
return;
bool rightToLeft = (strip.RightToLeft == System.Windows.Forms.RightToLeft.Yes);
System.Windows.Forms.Form form = strip.FindForm();
// Get right most X position of the Quick Access Toolbar
int right = 0, sysLeft = 0;
for (int i = strip.CaptionContainerItem.SubItems.Count - 1; i >= 0; i--)
{
BaseItem item = strip.CaptionContainerItem.SubItems[i];
if (!item.Visible || !item.Displayed)
continue;
if (item.ItemAlignment == eItemAlignment.Near && item.Visible && i > 0)
{
if (rightToLeft)
right = item.DisplayRectangle.X;
else
right = item.DisplayRectangle.Right;
break;
}
else if (item.ItemAlignment == eItemAlignment.Far && item.Visible)
{
if (rightToLeft)
sysLeft = item.DisplayRectangle.Right;
else
sysLeft = item.DisplayRectangle.X;
}
}
if (strip.CaptionContainerItem is CaptionItemContainer && ((CaptionItemContainer)strip.CaptionContainerItem).MoreItems != null)
{
if (rightToLeft)
right = ((CaptionItemContainer)strip.CaptionContainerItem).MoreItems.DisplayRectangle.X;
else
right = ((CaptionItemContainer)strip.CaptionContainerItem).MoreItems.DisplayRectangle.Right;
}
Rectangle r = new Rectangle(right, 2, strip.CaptionContainerItem.WidthInternal - right - (strip.CaptionContainerItem.WidthInternal - sysLeft), strip.GetTotalCaptionHeight());
strip.CaptionBounds = r;
if (sysLeft > 0)
{
if (rightToLeft)
strip.SystemCaptionItemBounds = new Rectangle(r.X, r.Y, sysLeft, r.Height);
else
strip.SystemCaptionItemBounds = new Rectangle(sysLeft, r.Y, strip.CaptionContainerItem.WidthInternal - sysLeft, r.Height);
}
//if (right == 0 || r.Height <= 0 || r.Width <= 0)
// return;
//BaseItem startButton = strip.GetApplicationButton();
//if (startButton != null)
//{
// int startIndex = strip.QuickToolbarItems.IndexOf(startButton);
// if (strip.QuickToolbarItems.Count - 1 > startIndex)
// {
// BaseItem firstItem = strip.QuickToolbarItems[startIndex + 1];
// if (rightToLeft)
// {
// r.Width -= r.Right - firstItem.DisplayRectangle.Right;
// }
// else
// {
// r.Width -= firstItem.DisplayRectangle.X - r.X;
// r.X = firstItem.DisplayRectangle.X;
// }
// }
//}
//r.Height = ((CaptionItemContainer)strip.CaptionContainerItem).MaxItemHeight + 6;
//r.X = 0;
//r.Width = right;
//strip.QuickToolbarBounds = r;
}
}
}

View File

@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using DevComponents.DotNetBar.Metro;
namespace DevComponents.DotNetBar.Rendering
{
public class TabFormColorTable
{
/// <summary>
/// Gets or sets the color table for form in active state.
/// </summary>
public TabFormStateColorTable Active = new TabFormStateColorTable();
/// <summary>
/// Gets or sets the color table for from in inactive state.
/// </summary>
public TabFormStateColorTable Inactive = new TabFormStateColorTable();
/// <summary>
/// Gets or sets the border thickness.
/// </summary>
public Thickness BorderThickness = new Thickness(1, 1, 1, 1);
/// <summary>
/// Gets or sets the background color of the form.
/// </summary>
public Color BackColor = Color.Empty;
/// <summary>
/// Gets or sets the text color of the form.
/// </summary>
public Color TextColor = Color.Empty;
/// <summary>
/// Gets or sets the text formatting for caption text.
/// </summary>
public eTextFormat CaptionTextFormat = eTextFormat.VerticalCenter | eTextFormat.Left | eTextFormat.EndEllipsis | eTextFormat.NoPrefix;
}
}

View File

@@ -0,0 +1,905 @@
using DevComponents.DotNetBar.Rendering;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar.Metro;
using DevComponents.DotNetBar.Primitives;
namespace DevComponents.DotNetBar.Controls
{
/// <summary>
/// Represents Tabbed Forms control for creating tabbed user interface as replacement for MDI child forms.
/// </summary>
[ToolboxBitmap(typeof(TabFormControl), "TabFormControl.ico"), ToolboxItem(true), Designer("DevComponents.DotNetBar.Design.TabFormControlDesigner, DevComponents.DotNetBar.Design, Version=14.1.0.37, Culture=neutral, PublicKeyToken=90f470f34c89ccaf"), System.Runtime.InteropServices.ComVisible(false)]
public class TabFormControl : System.Windows.Forms.ContainerControl
{
#region Events
/// <summary>
/// Occurs
/// </summary>
[Description("Occurs ")]
public event PaintTabFormItemEventHandler PaintTabFormItem;
/// <summary>
/// Raises RemovingToken event.
/// </summary>
/// <param name="e">Provides event arguments.</param>
protected virtual void OnPaintTabFormItem(PaintTabFormItemEventArgs e)
{
PaintTabFormItemEventHandler handler = PaintTabFormItem;
if (handler != null)
handler(this, e);
}
/// <summary>
/// Occurs when DotNetBar is looking for translated text for one of the internal text that are
/// displayed on menus, toolbars and customize forms. You need to set Handled=true if you want
/// your custom text to be used instead of the built-in system value.
/// </summary>
public event DotNetBarManager.LocalizeStringEventHandler LocalizeString;
/// <summary>
/// Occurs when Item on control is clicked.
/// </summary>
[Description("Occurs when Item on control is clicked.")]
public event EventHandler ItemClick;
/// <summary>
/// Occurs after selected tab has changed. You can use
/// <see cref="SelectedTab">TabFormControl.SelectedTab</see>
/// property to get reference to newly selected tab.
/// </summary>
public event EventHandler SelectedTabChanged;
/// <summary>
/// Occurs when text markup link from TitleText markup is clicked. Markup links can be created using "a" tag, for example:
/// <a name="MyLink">Markup link</a>
/// </summary>
[Description("Occurs when text markup link from TitleText markup is clicked.")]
public event MarkupLinkClickEventHandler TitleTextMarkupLinkClick;
/// <summary>
/// Occurs before TabFormItem is detached and gives you opportunity to cancel the action or provide your own new TabParentForm and TabFormControl.
/// </summary>
[Description("Occurs before TabFormItem is detached and gives you opportunity to cancel the action or provide your own new TabParentForm and TabFormControl.")]
public event TabFormItemDetachEventHandler BeforeTabFormItemDetach;
/// <summary>
/// Raises BeforeTabFormItemDetach event.
/// </summary>
/// <param name="e">Provides event arguments.</param>
protected virtual void OnBeforeTabFormItemDetach(TabFormItemDetachEventArgs e)
{
TabFormItemDetachEventHandler handler = BeforeTabFormItemDetach;
if (handler != null)
handler(this, e);
}
/// <summary>
/// Occurs after TabFormItem has been detached and is added to the new form and tab control.
/// </summary>
[Description("Occurs after TabFormItem has been detached and is added to the new form and tab control.")]
public event TabFormItemDetachEventHandler TabFormItemDetach;
/// <summary>
/// Raises TabFormItemDetach event.
/// </summary>
/// <param name="e">Provides event arguments.</param>
protected virtual void OnTabFormItemDetach(TabFormItemDetachEventArgs e)
{
TabFormItemDetachEventHandler handler = TabFormItemDetach;
if (handler != null)
handler(this, e);
}
#endregion
#region Private Variables and Constructor
private TabFormStripControl _TabStrip = null;
private bool m_AutoSize = false;
private ShadowPaintInfo m_ShadowPaintInfo = null;
private bool _UseCustomizeDialog = true;
//private bool m_EnableQatPlacement = true;
private int DefaultBottomDockPadding = 0;
private DevComponents.DotNetBar.Ribbon.SubItemsQatCollection m_QatSubItemsCollection = null;
private RibbonLocalization m_SystemText = new RibbonLocalization();
private bool m_MenuTabsEnabled = true;
private ContextMenuBar m_GlobalContextMenuBar = null;
public TabFormControl()
{
// This forces the initialization out of paint loop which speeds up how fast components show up
BaseRenderer renderer = DevComponents.DotNetBar.Rendering.GlobalManager.Renderer;
this.SetStyle(ControlStyles.AllPaintingInWmPaint
| ControlStyles.ResizeRedraw
| DisplayHelp.DoubleBufferFlag
| ControlStyles.UserPaint
| ControlStyles.Opaque
, true);
_TabStrip = new TabFormStripControl();
_TabStrip.Dock = DockStyle.Top;
_TabStrip.Height = 40;
_TabStrip.ItemAdded += new System.EventHandler(TabStripItemAdded);
_TabStrip.LocalizeString += new DotNetBarManager.LocalizeStringEventHandler(TabStripLocalizeString);
_TabStrip.ItemClick += new System.EventHandler(TabStripItemClick);
_TabStrip.ButtonCheckedChanged += new EventHandler(TabStripButtonCheckedChanged);
_TabStrip.TitleTextMarkupLinkClick += new MarkupLinkClickEventHandler(TabStripTitleTextMarkupLinkClick);
_TabStrip.BeforeTabFormItemDetach += TabStripBeforeTabFormItemDetach;
_TabStrip.TabFormItemDetach += TabStripTabFormItemDetach;
this.Controls.Add(_TabStrip);
this.TabStop = false;
this.DockPadding.Bottom = DefaultBottomDockPadding;
StyleManager.Register(this);
}
protected override void Dispose(bool disposing)
{
StyleManager.Unregister(this);
base.Dispose(disposing);
}
#endregion
#region Internal Implementation
/// <summary>
/// Called by StyleManager to notify control that style on manager has changed and that control should refresh its appearance if
/// its style is controlled by StyleManager.
/// </summary>
/// <param name="newStyle">New active style.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
public void StyleManagerStyleChanged(eDotNetBarStyle newStyle)
{
this.DockPadding.Left = 0;
}
internal bool IsDesignMode
{
get { return this.DesignMode; }
}
internal bool InternalPaintTabFormItem(TabFormItem tab, ItemPaintArgs itemPaintArgs)
{
PaintTabFormItemEventArgs p = new PaintTabFormItemEventArgs(tab, itemPaintArgs.Graphics);
OnPaintTabFormItem(p);
return p.PaintDefault;
}
protected virtual void OnSelectedTabChanged(EventArgs e)
{
if (SelectedTabChanged != null)
SelectedTabChanged(this, e);
}
void TabStripButtonCheckedChanged(object sender, EventArgs e)
{
if (sender is TabFormItem && ((TabFormItem)sender).Checked)
{
OnSelectedTabChanged(new EventArgs());
}
}
private void TabStripItemClick(object sender, System.EventArgs e)
{
if (ItemClick != null)
ItemClick(sender, e);
}
private void TabStripLocalizeString(object sender, LocalizeEventArgs e)
{
if (LocalizeString != null)
LocalizeString(this, e);
}
/// <summary>
/// Gets or sets whether anti-alias smoothing is used while painting. Default value is false.
/// </summary>
[DefaultValue(true), Browsable(true), Category("Appearance"), Description("Gets or sets whether anti-aliasing is used while painting.")]
public bool AntiAlias
{
get { return _TabStrip.AntiAlias; }
set
{
_TabStrip.AntiAlias = value;
this.Invalidate();
}
}
internal DevComponents.DotNetBar.Rendering.Office2007ColorTable GetOffice2007ColorTable()
{
DevComponents.DotNetBar.Rendering.Office2007Renderer r = DevComponents.DotNetBar.Rendering.GlobalManager.Renderer as DevComponents.DotNetBar.Rendering.Office2007Renderer;
if (r != null)
return r.ColorTable;
return new DevComponents.DotNetBar.Rendering.Office2007ColorTable();
}
/// <summary>
/// Performs the setup of the TabFormPanel with the current style of the TabFormControl Control.
/// </summary>
/// <param name="panel">Panel to apply style changes to.</param>
public void SetTabPanelStyle(TabFormPanel panel)
{
if (this.DesignMode)
{
TypeDescriptor.GetProperties(panel.DockPadding)["Left"].SetValue(panel.DockPadding, 3);
TypeDescriptor.GetProperties(panel.DockPadding)["Right"].SetValue(panel.DockPadding, 3);
TypeDescriptor.GetProperties(panel.DockPadding)["Bottom"].SetValue(panel.DockPadding, 3);
}
else
{
panel.DockPadding.Left = 3;
panel.DockPadding.Right = 3;
panel.DockPadding.Bottom = 3;
}
panel.Style.Class = ElementStyleClassKeys.TabFormPanelKey;
}
/// <summary>
/// Creates new Tab at specified position, creates new associated panel and adds them to the control.
/// </summary>
/// <param name="text">Specifies the text displayed on the tab.</param>
/// <param name="name">Specifies the name of the tab</param>
/// <param name="insertPosition">Specifies the position of the new tab inside of Items collection.</param>
/// <returns>New instance of the TabFormItem that was created.</returns>
public TabFormItem CreateTab(string text, string name, int insertPosition)
{
TabFormItem item = new TabFormItem();
item.Text = text;
item.Name = name;
TabFormPanel panel = new TabFormPanel();
panel.Dock = DockStyle.Fill;
SetTabPanelStyle(panel);
this.Controls.Add(panel);
panel.SendToBack();
item.Panel = panel;
if (insertPosition < 0)
{
insertPosition = this.Items.Count;
for (int i = 0; i < this.Items.Count; i++)
{
if (this.Items[i].ItemAlignment == eItemAlignment.Far)
{
insertPosition = i;
break;
}
}
if (insertPosition >= this.Items.Count)
this.Items.Add(item);
else
this.Items.Insert(insertPosition, item);
}
else if (insertPosition > this.Items.Count - 1)
this.Items.Add(item);
else
this.Items.Insert(insertPosition, item);
return item;
}
/// <summary>
/// Creates new Tab and associated panel and adds them to the control.
/// </summary>
/// <param name="text">Specifies the text displayed on the tab.</param>
/// <param name="name">Specifies the name of the tab</param>
/// <returns>New instance of the TabFormItem that was created.</returns>
public TabFormItem CreateTab(string text, string name)
{
return CreateTab(text, name, -1);
}
/// <summary>
/// Recalculates layout of the control and applies any changes made to the size or position of the items contained.
/// </summary>
public void RecalcLayout()
{
_TabStrip.RecalcLayout();
}
protected override void OnHandleCreated(System.EventArgs e)
{
base.OnHandleCreated(e);
foreach (Control c in this.Controls)
{
IntPtr h = c.Handle;
if (c is TabFormPanel)
{
foreach (Control r in c.Controls)
h = r.Handle;
}
}
this.RecalcLayout();
}
protected override void OnControlAdded(ControlEventArgs e)
{
base.OnControlAdded(e);
if (this.DesignMode)
return;
TabFormPanel panel = e.Control as TabFormPanel;
if (panel == null)
return;
if (panel.TabFormItem != null)
{
if (this.Items.Contains(panel.TabFormItem) && this.SelectedTab == panel.TabFormItem)
{
panel.Visible = true;
panel.BringToFront();
}
else
panel.Visible = false;
}
else
panel.Visible = false;
}
private void TabStripItemAdded(object sender, System.EventArgs e)
{
if (this.DesignMode)
return;
if (sender is TabFormItem)
{
TabFormItem tab = sender as TabFormItem;
if (tab.Panel != null)
{
if (this.Controls.Contains(tab.Panel) && tab.Checked)
{
tab.Panel.Visible = true;
tab.Panel.BringToFront();
}
else
tab.Panel.Visible = false;
}
}
}
protected override void OnControlRemoved(ControlEventArgs e)
{
base.OnControlRemoved(e);
TabFormPanel panel = e.Control as TabFormPanel;
if (panel == null)
return;
if (panel.TabFormItem != null)
{
if (this.Items.Contains(panel.TabFormItem))
this.Items.Remove(panel.TabFormItem);
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public void SetDesignMode()
{
_TabStrip.SetDesignMode(true);
}
private ElementStyle GetBackgroundStyle()
{
return _TabStrip.InternalGetBackgroundStyle();
}
protected override void OnPaint(PaintEventArgs e)
{
ElementStyle style = GetBackgroundStyle();
if (style.BackColor.A < 255 && !style.BackColor.IsEmpty ||
this.BackColor == Color.Transparent || this.BackgroundImage != null)
{
base.OnPaintBackground(e);
}
else
{
using (SolidBrush brush = new SolidBrush(this.BackColor))
e.Graphics.FillRectangle(brush, this.ClientRectangle);
}
ElementStyleDisplayInfo info = new ElementStyleDisplayInfo(style, e.Graphics, this.ClientRectangle);
ElementStyleDisplay.PaintBackground(info);
}
protected override void WndProc(ref Message m)
{
if (m.Msg == (int)WinApi.WindowsMessages.WM_NCHITTEST && !this.DesignMode)
{
// Get position being tested...
int x = WinApi.LOWORD(m.LParam);
int y = WinApi.HIWORD(m.LParam);
Point p = PointToClient(new Point(x, y));
if (this.CaptionVisible && _TabStrip != null && !_TabStrip.IsMaximized)
{
TabParentForm form = this.FindForm() as TabParentForm;
if (form == null || form.Sizable)
{
int formBorderSize = 4;
Rectangle r = new Rectangle(0, 0, this.Width, formBorderSize);
if (r.Contains(p)) // Top side form resizing
{
m.Result = new IntPtr((int)WinApi.WindowHitTestRegions.TransparentOrCovered);
return;
}
r = new Rectangle(0, 0, formBorderSize, this.Height); // Left side form resizing
if (r.Contains(p))
{
m.Result = new IntPtr((int)WinApi.WindowHitTestRegions.TransparentOrCovered);
return;
}
r = new Rectangle(this.Width - formBorderSize, 0, formBorderSize, this.Height); // Right side form resizing
if (r.Contains(p))
{
m.Result = new IntPtr((int)WinApi.WindowHitTestRegions.TransparentOrCovered);
return;
}
}
}
else if (_TabStrip != null)
{
Point pts = _TabStrip.PointToClient(new Point(x, y));
if (_TabStrip.HitTest(pts.X, pts.Y) == null)
{
m.Result = new IntPtr((int)WinApi.WindowHitTestRegions.TransparentOrCovered);
return;
}
}
//if (BarFunctions.IsWindows7 && _TabStrip != null && _TabStrip.IsMaximized)
//{
// Rectangle r = _TabStrip.CaptionBounds;
// if (r.Contains(p))
// {
// m.Result = new IntPtr((int)WinApi.WindowHitTestRegions.TransparentOrCovered);
// return;
// }
//}
//// System Icon
//if ((p.X < 28 && this.RightToLeft == RightToLeft.No || p.X > this.Width - 28 && this.RightToLeft == RightToLeft.Yes) && p.Y < 28)
//{
// m.Result = new IntPtr((int)WinApi.WindowHitTestRegions.TransparentOrCovered);
// return;
//}
}
base.WndProc(ref m);
}
/// <summary>
/// Returns current number of tabs visible and hidden on the tab strip.
/// </summary>
[Browsable(false)]
public int TabsCount
{
get { return _TabStrip.TabsCount; }
}
private void TabStripTabFormItemDetach(object sender, TabFormItemDetachEventArgs e)
{
OnTabFormItemDetach(e);
}
private void TabStripBeforeTabFormItemDetach(object sender, TabFormItemDetachEventArgs e)
{
OnBeforeTabFormItemDetach(e);
}
#endregion
#region Properties
/// <summary>
/// Indicates whether Form.Icon is shown in top-left corner.
/// </summary>
[DefaultValue(true), Category("Appearance"), Description("Indicates whether Form.Icon is shown in top-left corner.")]
public bool ShowIcon
{
get
{
return _TabStrip.ShowIcon;
}
set
{
_TabStrip.ShowIcon = value;
}
}
/// <summary>
/// Gets or sets the rich text displayed on title bar instead of the Form.Text property. This property supports text-markup.
/// You can use <font color="SysCaptionTextExtra"> markup to instruct the markup renderer to use Office 2007 system caption extra text color which
/// changes depending on the currently selected color table. Note that when using this property you should manage also the Form.Text property since
/// that is the text that will be displayed in Windows task-bar and elsewhere where system Form.Text property is used.
/// You can also use the hyperlinks as part of the text markup and handle the TitleTextMarkupLinkClick event to be notified when they are clicked.
/// </summary>
[Browsable(true), DefaultValue(""), Editor("DevComponents.DotNetBar.Design.TextMarkupUIEditor, DevComponents.DotNetBar.Design, Version=14.1.0.37, Culture=neutral, PublicKeyToken=90f470f34c89ccaf", typeof(System.Drawing.Design.UITypeEditor)), EditorBrowsable(EditorBrowsableState.Always), Category("Appearance"), Description("Indicates text displayed on Title bar instead of the Form.Text property.")]
public string TitleText
{
get { return _TabStrip.TitleText; }
set { _TabStrip.TitleText = value; }
}
/// <summary>
/// Occurs when text markup link is clicked.
/// </summary>
private void TabStripTitleTextMarkupLinkClick(object sender, MarkupLinkClickEventArgs e)
{
if (TitleTextMarkupLinkClick != null)
TitleTextMarkupLinkClick(this, new MarkupLinkClickEventArgs(e.Name, e.HRef));
}
/// <summary>
/// Gets or sets the Context menu bar associated with the this control which is used as part of Global Items feature. The context menu
/// bar assigned here will be used to search for the items with the same Name or GlobalName property so global properties can be propagated when changed.
/// You should assign this property to enable the Global Items feature to reach your ContextMenuBar.
/// </summary>
[DefaultValue(null), Description("Indicates Context menu bar associated with the TabFormControl control which is used as part of Global Items feature."), Category("Data")]
public ContextMenuBar GlobalContextMenuBar
{
get { return m_GlobalContextMenuBar; }
set
{
if (m_GlobalContextMenuBar != null)
m_GlobalContextMenuBar.GlobalParentComponent = null;
m_GlobalContextMenuBar = value;
if (m_GlobalContextMenuBar != null)
m_GlobalContextMenuBar.GlobalParentComponent = this;
}
}
/// <summary>
/// Gets or sets whether custom caption and quick access toolbar provided by the control is visible. Default value is false.
/// This property should be set to true when control is used on MetroAppForm.
/// </summary>
[Browsable(true), DefaultValue(false), Category("Caption"), Description("Indicates whether custom caption and quick access toolbar provided by the control is visible.")]
public bool CaptionVisible
{
get { return _TabStrip.CaptionVisible; }
set
{
_TabStrip.CaptionVisible = value;
}
}
/// <summary>
/// Gets or sets the font for the form caption text when CaptionVisible=true. Default value is NULL which means that system font is used.
/// </summary>
[Browsable(true), DefaultValue(null), Category("Caption"), Description("Indicates font for the form caption text when CaptionVisible=true.")]
public Font CaptionFont
{
get { return _TabStrip.CaptionFont; }
set
{
_TabStrip.CaptionFont = value;
}
}
/// <summary>
/// Gets or sets the explicit height of the caption provided by control. Caption height when set is composed of the TabGroupHeight and
/// the value specified here. Default value is 0 which means that system default caption size is used.
/// </summary>
[Browsable(true), DefaultValue(0), Category("Caption"), Description("Indicates explicit height of the caption provided by control")]
public int CaptionHeight
{
get { return _TabStrip.CaptionHeight; }
set
{
_TabStrip.CaptionHeight = value;
this.RecalcLayout();
}
}
/// <summary>
/// Specifies the background style of the control.
/// </summary>
[Browsable(true), DevCoBrowsable(true), Category("Style"), Description("Gets or sets bar background style."), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public ElementStyle BackgroundStyle
{
get { return _TabStrip.BackgroundStyle; }
}
/// <summary>
/// Gets or sets the currently selected TabFormItem. TabFormItems are selected using the Checked property. Only a single
/// TabFormItem can be selected (Checked) at any given time.
/// </summary>
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public TabFormItem SelectedTab
{
get { return _TabStrip.SelectedTab; }
set
{
if (value != null)
{
if(!value.Checked)
value.Checked = true;
else if (value.Panel != null && !value.Panel.Visible)
value.Panel.Visible = true;
}
}
}
/// <summary>
/// Indicates whether new tab item which allows creation of new tab when clicked is visible. When visible you need to handle CreateNewTab event and create your new tab in event handler.
/// </summary>
[DefaultValue(false), Category("Appearance"), Description("Indicates whether new tab item which allows creation of new tab when clicked is visible. When visible you need to handle CreateNewTab event and create your new tab in event handler.")]
public bool NewTabItemVisible
{
get { return _TabStrip.NewTabItemVisible; }
set { _TabStrip.NewTabItemVisible = value; }
}
/// <summary>
/// Occurs when new tab item is clicked by end user and allows you to create and add new tab to the control.
/// </summary>
[Description("Occurs when new tab item is clicked by end user and allows you to create and add new tab to the control.")]
public event EventHandler CreateNewTab;
/// <summary>
/// Raises CreateNewTab event.
/// </summary>
/// <param name="e">Provides event arguments.</param>
protected internal virtual void OnCreateNewTab(EventArgs e)
{
EventHandler handler = CreateNewTab;
if (handler != null)
handler(this, e);
}
internal void RaiseCreateNewTab(EventArgs e)
{
OnCreateNewTab(e);
}
/// <summary>
/// Returns reference to internal tab-strip control.
/// </summary>
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public TabFormStripControl TabStrip
{
get { return _TabStrip; }
}
/// <summary>
/// Returns collection of items on a bar.
/// </summary>
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Browsable(false)]
public SubItemsCollection Items
{
get { return _TabStrip.Items; }
}
///// <summary>
///// Returns collection of quick toolbar access and caption items.
///// </summary>
//[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Browsable(false)]
//public SubItemsCollection QuickToolbarItems
//{
// get { return GetQatSubItemsCollection(); }
//}
//private SubItemsCollection GetQatSubItemsCollection()
//{
// return _TabStrip.QuickToolbarItems;
//}
/// <summary>
/// Gets collection of items displayed in control captions, if it is visible (CaptionVisible=true).
/// </summary>
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Browsable(false)]
public SubItemsCollection CaptionItems
{
get { return _TabStrip.TabStripContainer.CaptionItems; }
}
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public eDotNetBarStyle EffectiveStyle
{
get
{
return _TabStrip.EffectiveStyle;
}
}
private TabFormColorTable _ColorTable;
/// <summary>
/// Gets or sets the custom color table for the control. When set this color table overrides all system color settings for control.
/// </summary>
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public TabFormColorTable ColorTable
{
get { return _ColorTable; }
set { _ColorTable = value; }
}
//private static BaseItem GetAppButton(TabFormControl tab)
//{
// BaseItem appButton = null;
// for (int i = 0; i < tab.QuickToolbarItems.Count; i++)
// {
// if (tab.QuickToolbarItems[i] is MetroAppButton)
// {
// appButton = tab.QuickToolbarItems[i];
// break;
// }
// }
// return appButton;
//}
//protected override void OnBackColorChanged(EventArgs e)
//{
// base.OnBackColorChanged(e);
//}
#if TRIAL
private bool _ShownOnce = false;
#endif
protected override void OnVisibleChanged(EventArgs e)
{
#if TRIAL
if(!this.DesignMode && !_ShownOnce)
{
RemindForm frm=new RemindForm();
frm.ShowDialog();
frm.Dispose();
_ShownOnce = true;
}
#endif
base.OnVisibleChanged(e);
}
private bool _MouseWheelTabScrollEnabled = true;
/// <summary>
/// Gets or sets whether mouse wheel scrolls through the tabs. Default value is true.
/// </summary>
[DefaultValue(true), Category("Behavior"), Description("Indicates whether mouse wheel scrolls through the tabs.")]
public bool MouseWheelTabScrollEnabled
{
get { return _MouseWheelTabScrollEnabled; }
set
{
_MouseWheelTabScrollEnabled = value;
}
}
/// <summary>
/// ImageList for images used on Items. Images specified here will always be used on menu-items and are by default used on all Bars.
/// </summary>
[Browsable(true), Category("Data"), DefaultValue(null), Description("ImageList for images used on Items. Images specified here will always be used on menu-items and are by default used on all Bars.")]
public ImageList Images
{
get { return _TabStrip.Images; }
set { _TabStrip.Images = value; }
}
/// <summary>
/// ImageList for medium-sized images used on Items.
/// </summary>
[Browsable(true), Category("Data"), DefaultValue(null), Description("ImageList for medium-sized images used on Items.")]
public ImageList ImagesMedium
{
get { return _TabStrip.ImagesMedium; }
set { _TabStrip.ImagesMedium = value; }
}
/// <summary>
/// ImageList for large-sized images used on Items.
/// </summary>
[Browsable(true), Category("Data"), DefaultValue(null), Description("ImageList for large-sized images used on Items.")]
public ImageList ImagesLarge
{
get { return _TabStrip.ImagesLarge; }
set { _TabStrip.ImagesLarge = value; }
}
protected override void OnTabStopChanged(System.EventArgs e)
{
base.OnTabStopChanged(e);
_TabStrip.TabStop = this.TabStop;
}
/// <summary>
/// Gets or sets a value indicating whether the user can give the focus to this control using the TAB key. Default value is false.
/// </summary>
[Browsable(true), DefaultValue(false), Category("Behavior"), Description("Indicates whether the user can give the focus to this control using the TAB key.")]
public new bool TabStop
{
get { return base.TabStop; }
set { base.TabStop = value; }
}
#endregion
#region Metro Customization
///// <summary>
///// Gets the reference to the localization object which holds all system text used by the component.
///// </summary>
//[Browsable(true), DevCoBrowsable(true), NotifyParentPropertyAttribute(true), Category("Localization"), Description("Gets system text used by the component.."), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
//public RibbonLocalization SystemText
//{
// get { return m_SystemText; }
//}
protected override Size DefaultSize
{
get
{
return new Size(200, 100);
}
}
private eTabFormStripControlDock _TabStripDock = eTabFormStripControlDock.Top;
/// <summary>
/// Gets or sets the side tab-strip is docked to.
/// </summary>
[DefaultValue(eTabFormStripControlDock.Top), Category("Appearance"), Description("Indicates side tab-strip is docked to.")]
public eTabFormStripControlDock TabStripDock
{
get { return _TabStripDock; }
set
{
_TabStripDock = value;
if (_TabStripDock == eTabFormStripControlDock.Top)
_TabStrip.Dock = DockStyle.Top;
else if (_TabStripDock == eTabFormStripControlDock.Bottom)
_TabStrip.Dock = DockStyle.Bottom;
}
}
/// <summary>
/// Gets or sets the font tab items are displayed with.
/// </summary>
[AmbientValue((string) null), Localizable(true) , Category("Appearance"), Description("Indicates the font tab items are displayed with.")]
public Font TabStripFont
{
get { return _TabStrip.Font; }
set
{
_TabStrip.Font = value;
}
}
/// <summary>
/// Gets or sets whether this TabFormControl was auto-created as result of end-user tearing off the tab.
/// </summary>
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsAutoCreated { get; set; }
protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
{
if (Dpi.RecordScalePerControl)
Dpi.SetScaling(factor);
base.ScaleControl(factor, specified);
}
#endregion
}
/// <summary>
/// Specifies dock side for tab form strip control.
/// </summary>
public enum eTabFormStripControlDock
{
Top,
Bottom
}
/// <summary>
/// Defines delegate for the PaintTabFormItem event.
/// </summary>
public delegate void PaintTabFormItemEventHandler(object sender, PaintTabFormItemEventArgs e);
/// <summary>
/// Defines delegate for the PaintTabFormItem event.
/// </summary>
public class PaintTabFormItemEventArgs : EventArgs
{
/// <summary>
/// Gets reference to the tab being painted.
/// </summary>
public readonly TabFormItem Tab;
/// <summary>
/// Gets reference to the graphic canvas for painting.
/// </summary>
public readonly Graphics Graphics;
/// <summary>
/// Gets or sets whether default painting for the item is performed, default value is true. Set to false to disable internal painting.
/// </summary>
public bool PaintDefault = true;
public PaintTabFormItemEventArgs(TabFormItem tab, Graphics g)
{
this.Tab = tab;
this.Graphics = g;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing.Drawing2D;
using System.Text;
namespace DevComponents.DotNetBar.Controls
{
[ToolboxItem(false), DesignTimeVisible(false), Designer("DevComponents.DotNetBar.Design.TabFormItemDesigner, DevComponents.DotNetBar.Design, Version=14.1.0.37, Culture=neutral, PublicKeyToken=90f470f34c89ccaf")]
public class TabFormItemBase : ButtonItem
{
protected override void Dispose(bool disposing)
{
if (_TabPath != null)
{
_TabPath.Dispose();
_TabPath = null;
}
base.Dispose(disposing);
}
private bool _RenderTabState = true;
/// <summary>
/// Gets or sets whether tab renders its state. Used internally by DotNetBar. Do not set.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
internal bool RenderTabState
{
get { return _RenderTabState; }
set
{
_RenderTabState = value;
if (this.ContainerControl is System.Windows.Forms.Control)
((System.Windows.Forms.Control)this.ContainerControl).Invalidate();
else
this.Refresh();
}
}
private GraphicsPath _TabPath = null;
/// <summary>
/// Gets the actual tab path.
/// </summary>
[Browsable(false)]
public GraphicsPath TabPath
{
get { return _TabPath; }
internal set
{
if(_TabPath!=null)
_TabPath.Dispose();
_TabPath = value;
}
}
}
}

View File

@@ -0,0 +1,135 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
namespace DevComponents.DotNetBar.Rendering
{
public class TabFormItemColorTable
{
/// <summary>
/// Gets or sets the name of the color table.
/// </summary>
public string Name = "";
/// <summary>
/// Gets or sets the default tab colors.
/// </summary>
public TabFormItemStateColorTable Default = new TabFormItemStateColorTable();
/// <summary>
/// Gets or sets the disabled tab colors.
/// </summary>
public TabFormItemStateColorTable Disabled = new TabFormItemStateColorTable();
/// <summary>
/// Gets or sets the selected tab colors.
/// </summary>
public TabFormItemStateColorTable Selected = new TabFormItemStateColorTable();
/// <summary>
/// Gets or sets the colors when mouse is over the tab but tab is not selected.
/// </summary>
public TabFormItemStateColorTable MouseOver = new TabFormItemStateColorTable();
/// <summary>
/// Gets or sets colors for the tab close button.
/// </summary>
public TabCloseButtonColorTable CloseButton = new TabCloseButtonColorTable();
}
/// <summary>
/// Defines the color table for RibbonTabItem states.
/// </summary>
public class TabFormItemStateColorTable
{
/// <summary>
/// Indicates item text color.
/// </summary>
public Color TextColor = Color.Black;
/// <summary>
/// Gets or sets the background colors for the item.
/// </summary>
public Color[] BackColors = new Color[0];
/// <summary>
/// Gets or sets the back colors gradient angle if there is more than one color in BackColors array.
/// </summary>
public int BackColorsGradientAngle = 90;
/// <summary>
/// Gets or sets the gradient colors positions if there is more than one color in BackColors array.
/// </summary>
public float[] BackColorsPositions = new float[0];
/// <summary>
/// Gets or sets the item border colors.
/// </summary>
public Color[] BorderColors = new Color[0];
/// <summary>
/// Creates a copy of the state color table.
/// </summary>
public TabFormItemStateColorTable Clone()
{
TabFormItemStateColorTable t=new TabFormItemStateColorTable();
t.BorderColors = BorderColors;
t.BackColors = BackColors;
t.TextColor = TextColor;
t.BackColorsGradientAngle = BackColorsGradientAngle;
t.BackColorsPositions = BackColorsPositions;
return t;
}
}
/// <summary>
/// Defines color table for TabFormItem close button displayed on tabs.
/// </summary>
public class TabCloseButtonColorTable
{
/// <summary>
/// Colors for the button in default state.
/// </summary>
public TabCloseButtonStateColorTable Normal = new TabCloseButtonStateColorTable();
/// <summary>
/// Colors for button in mouse over state.
/// </summary>
public TabCloseButtonStateColorTable MouseOver = new TabCloseButtonStateColorTable(new Color[] { ColorScheme.GetColor(0xDB4336) }, ColorScheme.GetColor(0xFDFBFA), ColorScheme.GetColor(0xDB4336));
/// <summary>
/// Colors for button when pressed with mouse state.
/// </summary>
public TabCloseButtonStateColorTable Pressed = new TabCloseButtonStateColorTable(new Color[] { ColorScheme.GetColor(0xA8352A) }, ColorScheme.GetColor(0xFDFBFA), ColorScheme.GetColor(0xA8352A));
}
/// <summary>
/// Defines state color table for TabFormItem close button displayed on tabs.
/// </summary>
public class TabCloseButtonStateColorTable
{
/// <summary>
/// Gets or sets the background colors for the item.
/// </summary>
public Color[] BackColors = new Color[0];
/// <summary>
/// Gets or sets the back colors gradient angle if there is more than one color in BackColors array.
/// </summary>
public int BackColorsGradientAngle = 90;
/// <summary>
/// Gets or sets the gradient colors positions if there is more than one color in BackColors array.
/// </summary>
public float[] BackColorsPositions = new float[0];
/// <summary>
/// Indicates item sign color.
/// </summary>
public Color ForeColor = Color.Empty;
/// <summary>
/// Indicates item border color.
/// </summary>
public Color BorderColor = Color.Empty;
public TabCloseButtonStateColorTable()
{
}
public TabCloseButtonStateColorTable(Color[] backColors, Color foreColor, Color borderColor)
{
BackColors = backColors;
ForeColor = foreColor;
BorderColor = borderColor;
}
}
}

View File

@@ -0,0 +1,88 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using DevComponents.DotNetBar.Controls;
using DevComponents.DotNetBar.Metro;
using DevComponents.DotNetBar.Metro.Rendering;
namespace DevComponents.DotNetBar.Rendering
{
internal abstract class TabFormPainter
{
public abstract void Paint(TabFormPainterArgs args);
}
internal class OfficeTabFormPainter : TabFormPainter, IOffice2007Painter
{
#region IOffice2007Painter
private Office2007ColorTable _ColorTable = null;
/// <summary>
/// Gets or sets color table used by renderer.
/// </summary>
public Office2007ColorTable ColorTable
{
get { return _ColorTable; }
set { _ColorTable = value; }
}
#endregion
public override void Paint(TabFormPainterArgs args)
{
TabParentForm form = args.TabParentForm;
Graphics g = args.Graphics;
TabFormColorTable colorTable = GetFormColorTable();
if (form.FormTabsControl != null && form.FormTabsControl.ColorTable != null)
colorTable = form.FormTabsControl.ColorTable;
Thickness borderThickness = form.BorderThickness;
BorderColors colors = form.BorderColor;
if (borderThickness.IsZero && colors.IsEmpty)
{
// Get it from table
borderThickness = colorTable.BorderThickness;
colors = form.IsActive ? colorTable.Active.BorderColors : colorTable.Inactive.BorderColors;
}
using (SolidBrush brush = new SolidBrush(colorTable.BackColor.IsEmpty ? form.BackColor : colorTable.BackColor))
g.FillRectangle(brush, new Rectangle(0, 0, form.Width, form.Height));
if (!borderThickness.IsZero && !colors.IsEmpty)
{
RectangleF br = new RectangleF(0, 0, form.Width, form.Height);
DrawingHelpers.DrawBorder(g, br, borderThickness, colors);
}
}
private TabFormColorTable GetFormColorTable()
{
return _ColorTable.TabForm;
}
}
public class TabFormPainterArgs : EventArgs
{
/// <summary>
/// Gets or sets Graphics object group is rendered on.
/// </summary>
public Graphics Graphics = null;
/// <summary>
/// Gets or sets the reference to TabParentForm being rendered.
/// </summary>
public TabParentForm TabParentForm = null;
/// <summary>
/// Indicates whether to cancel system rendering of the item.
/// </summary>
public bool Cancel = false;
public TabFormPainterArgs(TabParentForm form, Graphics graphics)
{
Graphics = graphics;
TabParentForm = form;
}
}
}

View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace DevComponents.DotNetBar.Controls
{
public class TabFormPanel : PanelControl
{
#region Internal Implementation
private TabFormItem _TabFormItem;
/// <summary>
/// Gets the TabFormItem this panel is associated with
/// </summary>
public TabFormItem TabFormItem
{
get { return _TabFormItem; }
internal set { _TabFormItem = value; }
}
#endregion
}
}

View File

@@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using DevComponents.DotNetBar.Metro;
namespace DevComponents.DotNetBar.Rendering
{
/// <summary>
/// Defines state color table for TabParentForm.
/// </summary>
public class TabFormStateColorTable
{
/// <summary>
/// Gets or sets the colors for the top part of the background.
/// </summary>
public Color[] CaptionBackColors = new Color[0];
/// <summary>
/// Gets or sets the back colors gradient angle if there is more than one color in BackColors array.
/// </summary>
public int CaptionBackColorsGradientAngle = 90;
/// <summary>
/// Gets or sets the gradient colors positions if there is more than one color in BackColors array.
/// </summary>
public float[] CaptionBackColorsPositions = new float[0];
/// <summary>
/// Gets or sets the color of caption text.
/// </summary>
public Color CaptionText = Color.Empty;
/// <summary>
/// Gets or sets the border colors.
/// </summary>
public BorderColors BorderColors = new BorderColors(ColorScheme.GetColor("696969"));
public TabFormStateColorTable()
{
}
public TabFormStateColorTable(Color[] captionBackColors, Color captionText, BorderColors borderColors)
{
CaptionBackColors = captionBackColors;
CaptionText = captionText;
BorderColors = borderColors;
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using DevComponents.DotNetBar.Controls;
namespace DevComponents.DotNetBar.Rendering
{
internal abstract class TabFormStripPainter
{
public abstract void Paint(TabFormStripPainterArgs renderingInfo);
}
public class TabFormStripPainterArgs : EventArgs
{
/// <summary>
/// Gets or sets Graphics object group is rendered on.
/// </summary>
public Graphics Graphics = null;
/// <summary>
/// Gets or sets the reference to SwitchButtonItem being rendered.
/// </summary>
public TabFormStripControl TabFormStrip = null;
/// <summary>
/// Gets or sets the ItemPaintArgs reference.
/// </summary>
internal ItemPaintArgs ItemPaintArgs;
/// <summary>
/// Indicates whether to cancel system rendering of the item.
/// </summary>
public bool Cancel = false;
public TabFormStripPainterArgs(TabFormStripControl tabFormStrip, Graphics graphics, ItemPaintArgs itemPaintArgs)
{
Graphics = graphics;
TabFormStrip = tabFormStrip;
ItemPaintArgs = itemPaintArgs;
}
}
}

File diff suppressed because it is too large Load Diff