|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Text; |
|
|
using System.Drawing; |
|
|
using System.Drawing.Drawing2D; |
|
|
using System.Drawing.Design; |
|
|
using System.Windows.Forms.Design; |
|
|
using System.ComponentModel; |
|
|
|
|
|
namespace WeifenLuo.WinFormsUI.Docking |
|
|
{ |
|
|
#region DockPanelSkin classes |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[TypeConverter(typeof(DockPanelSkinConverter))] |
|
|
public class DockPanelSkin |
|
|
{ |
|
|
private AutoHideStripSkin m_autoHideStripSkin = new AutoHideStripSkin(); |
|
|
private DockPaneStripSkin m_dockPaneStripSkin = new DockPaneStripSkin(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public AutoHideStripSkin AutoHideStripSkin |
|
|
{ |
|
|
get { return m_autoHideStripSkin; } |
|
|
set { m_autoHideStripSkin = value; } |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public DockPaneStripSkin DockPaneStripSkin |
|
|
{ |
|
|
get { return m_dockPaneStripSkin; } |
|
|
set { m_dockPaneStripSkin = value; } |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[TypeConverter(typeof(AutoHideStripConverter))] |
|
|
public class AutoHideStripSkin |
|
|
{ |
|
|
private DockPanelGradient m_dockStripGradient = new DockPanelGradient(); |
|
|
private TabGradient m_TabGradient = new TabGradient(); |
|
|
private DockStripBackground m_DockStripBackground = new DockStripBackground(); |
|
|
|
|
|
private Font m_textFont = SystemFonts.MenuFont; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public DockPanelGradient DockStripGradient |
|
|
{ |
|
|
get { return m_dockStripGradient; } |
|
|
set { m_dockStripGradient = value; } |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public TabGradient TabGradient |
|
|
{ |
|
|
get { return m_TabGradient; } |
|
|
set { m_TabGradient = value; } |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public DockStripBackground DockStripBackground |
|
|
{ |
|
|
get { return m_DockStripBackground; } |
|
|
set { m_DockStripBackground = value; } |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DefaultValue(typeof(SystemFonts), "MenuFont")] |
|
|
public Font TextFont |
|
|
{ |
|
|
get { return m_textFont; } |
|
|
set { m_textFont = value; } |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[TypeConverter(typeof(DockPaneStripConverter))] |
|
|
public class DockPaneStripSkin |
|
|
{ |
|
|
private DockPaneStripGradient m_DocumentGradient = new DockPaneStripGradient(); |
|
|
private DockPaneStripToolWindowGradient m_ToolWindowGradient = new DockPaneStripToolWindowGradient(); |
|
|
private Font m_textFont = SystemFonts.MenuFont; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public DockPaneStripGradient DocumentGradient |
|
|
{ |
|
|
get { return m_DocumentGradient; } |
|
|
set { m_DocumentGradient = value; } |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public DockPaneStripToolWindowGradient ToolWindowGradient |
|
|
{ |
|
|
get { return m_ToolWindowGradient; } |
|
|
set { m_ToolWindowGradient = value; } |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DefaultValue(typeof(SystemFonts), "MenuFont")] |
|
|
public Font TextFont |
|
|
{ |
|
|
get { return m_textFont; } |
|
|
set { m_textFont = value; } |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[TypeConverter(typeof(DockPaneStripGradientConverter))] |
|
|
public class DockPaneStripToolWindowGradient : DockPaneStripGradient |
|
|
{ |
|
|
private TabGradient m_activeCaptionGradient = new TabGradient(); |
|
|
private TabGradient m_inactiveCaptionGradient = new TabGradient(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public TabGradient ActiveCaptionGradient |
|
|
{ |
|
|
get { return m_activeCaptionGradient; } |
|
|
set { m_activeCaptionGradient = value; } |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public TabGradient InactiveCaptionGradient |
|
|
{ |
|
|
get { return m_inactiveCaptionGradient; } |
|
|
set { m_inactiveCaptionGradient = value; } |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[TypeConverter(typeof(DockPaneStripGradientConverter))] |
|
|
public class DockPaneStripGradient |
|
|
{ |
|
|
private DockPanelGradient m_dockStripGradient = new DockPanelGradient(); |
|
|
private TabGradient m_activeTabGradient = new TabGradient(); |
|
|
private TabGradient m_inactiveTabGradient = new TabGradient(); |
|
|
private TabGradient m_hoverTabGradient = new TabGradient(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public DockPanelGradient DockStripGradient |
|
|
{ |
|
|
get { return m_dockStripGradient; } |
|
|
set { m_dockStripGradient = value; } |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public TabGradient ActiveTabGradient |
|
|
{ |
|
|
get { return m_activeTabGradient; } |
|
|
set { m_activeTabGradient = value; } |
|
|
} |
|
|
|
|
|
public TabGradient HoverTabGradient |
|
|
{ |
|
|
get { return m_hoverTabGradient; } |
|
|
set { m_hoverTabGradient = value; } |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public TabGradient InactiveTabGradient |
|
|
{ |
|
|
get { return m_inactiveTabGradient; } |
|
|
set { m_inactiveTabGradient = value; } |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[TypeConverter(typeof(DockPaneTabGradientConverter))] |
|
|
public class TabGradient : DockPanelGradient |
|
|
{ |
|
|
private Color m_textColor = SystemColors.ControlText; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DefaultValue(typeof(SystemColors), "ControlText")] |
|
|
public Color TextColor |
|
|
{ |
|
|
get { return m_textColor; } |
|
|
set { m_textColor = value; } |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[TypeConverter(typeof(DockPaneTabGradientConverter))] |
|
|
public class DockStripBackground |
|
|
{ |
|
|
private Color m_startColor = SystemColors.Control; |
|
|
private Color m_endColor = SystemColors.Control; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DefaultValue(typeof(SystemColors), "Control")] |
|
|
public Color StartColor |
|
|
{ |
|
|
get { return m_startColor; } |
|
|
set { m_startColor = value; } |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DefaultValue(typeof(SystemColors), "Control")] |
|
|
public Color EndColor |
|
|
{ |
|
|
get { return m_endColor; } |
|
|
set { m_endColor = value; } |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[TypeConverter(typeof(DockPanelGradientConverter))] |
|
|
public class DockPanelGradient |
|
|
{ |
|
|
private Color m_startColor = SystemColors.Control; |
|
|
private Color m_endColor = SystemColors.Control; |
|
|
private LinearGradientMode m_linearGradientMode = LinearGradientMode.Horizontal; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DefaultValue(typeof(SystemColors), "Control")] |
|
|
public Color StartColor |
|
|
{ |
|
|
get { return m_startColor; } |
|
|
set { m_startColor = value; } |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DefaultValue(typeof(SystemColors), "Control")] |
|
|
public Color EndColor |
|
|
{ |
|
|
get { return m_endColor; } |
|
|
set { m_endColor = value; } |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DefaultValue(LinearGradientMode.Horizontal)] |
|
|
public LinearGradientMode LinearGradientMode |
|
|
{ |
|
|
get { return m_linearGradientMode; } |
|
|
set { m_linearGradientMode = value; } |
|
|
} |
|
|
} |
|
|
|
|
|
#endregion |
|
|
|
|
|
#region Converters |
|
|
public class DockPanelSkinConverter : ExpandableObjectConverter |
|
|
{ |
|
|
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) |
|
|
{ |
|
|
if (destinationType == typeof(DockPanelSkin)) |
|
|
return true; |
|
|
|
|
|
return base.CanConvertTo(context, destinationType); |
|
|
} |
|
|
|
|
|
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) |
|
|
{ |
|
|
if (destinationType == typeof(String) && value is DockPanelSkin) |
|
|
{ |
|
|
return "DockPanelSkin"; |
|
|
} |
|
|
return base.ConvertTo(context, culture, value, destinationType); |
|
|
} |
|
|
} |
|
|
|
|
|
public class DockPanelGradientConverter : ExpandableObjectConverter |
|
|
{ |
|
|
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) |
|
|
{ |
|
|
if (destinationType == typeof(DockPanelGradient)) |
|
|
return true; |
|
|
|
|
|
return base.CanConvertTo(context, destinationType); |
|
|
} |
|
|
|
|
|
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) |
|
|
{ |
|
|
if (destinationType == typeof(String) && value is DockPanelGradient) |
|
|
{ |
|
|
return "DockPanelGradient"; |
|
|
} |
|
|
return base.ConvertTo(context, culture, value, destinationType); |
|
|
} |
|
|
} |
|
|
|
|
|
public class AutoHideStripConverter : ExpandableObjectConverter |
|
|
{ |
|
|
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) |
|
|
{ |
|
|
if (destinationType == typeof(AutoHideStripSkin)) |
|
|
return true; |
|
|
|
|
|
return base.CanConvertTo(context, destinationType); |
|
|
} |
|
|
|
|
|
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) |
|
|
{ |
|
|
if (destinationType == typeof(String) && value is AutoHideStripSkin) |
|
|
{ |
|
|
return "AutoHideStripSkin"; |
|
|
} |
|
|
return base.ConvertTo(context, culture, value, destinationType); |
|
|
} |
|
|
} |
|
|
|
|
|
public class DockPaneStripConverter : ExpandableObjectConverter |
|
|
{ |
|
|
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) |
|
|
{ |
|
|
if (destinationType == typeof(DockPaneStripSkin)) |
|
|
return true; |
|
|
|
|
|
return base.CanConvertTo(context, destinationType); |
|
|
} |
|
|
|
|
|
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) |
|
|
{ |
|
|
if (destinationType == typeof(String) && value is DockPaneStripSkin) |
|
|
{ |
|
|
return "DockPaneStripSkin"; |
|
|
} |
|
|
return base.ConvertTo(context, culture, value, destinationType); |
|
|
} |
|
|
} |
|
|
|
|
|
public class DockPaneStripGradientConverter : ExpandableObjectConverter |
|
|
{ |
|
|
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) |
|
|
{ |
|
|
if (destinationType == typeof(DockPaneStripGradient)) |
|
|
return true; |
|
|
|
|
|
return base.CanConvertTo(context, destinationType); |
|
|
} |
|
|
|
|
|
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) |
|
|
{ |
|
|
if (destinationType == typeof(String) && value is DockPaneStripGradient) |
|
|
{ |
|
|
return "DockPaneStripGradient"; |
|
|
} |
|
|
return base.ConvertTo(context, culture, value, destinationType); |
|
|
} |
|
|
} |
|
|
|
|
|
public class DockPaneTabGradientConverter : ExpandableObjectConverter |
|
|
{ |
|
|
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) |
|
|
{ |
|
|
if (destinationType == typeof(TabGradient)) |
|
|
return true; |
|
|
|
|
|
return base.CanConvertTo(context, destinationType); |
|
|
} |
|
|
|
|
|
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) |
|
|
{ |
|
|
TabGradient val = value as TabGradient; |
|
|
if (destinationType == typeof(String) && val != null) |
|
|
{ |
|
|
return "DockPaneTabGradient"; |
|
|
} |
|
|
return base.ConvertTo(context, culture, value, destinationType); |
|
|
} |
|
|
} |
|
|
#endregion |
|
|
} |
|
|
|