DotNet 4.8.1 build of DotNetBar
This commit is contained in:
@@ -0,0 +1,947 @@
|
||||
using DevComponents.DotNetBar.Controls;
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents bases class that defines a renderer.
|
||||
/// </summary>
|
||||
public abstract class BaseRenderer
|
||||
{
|
||||
#region Events
|
||||
/// <summary>
|
||||
/// Occurs when KeyTip is rendered.
|
||||
/// </summary>
|
||||
public event KeyTipsRendererEventHandler RenderKeyTips;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when ribbon tab group is rendered.
|
||||
/// </summary>
|
||||
public event RibbonTabGroupRendererEventHandler RenderRibbonTabGroup;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when ItemContainer is rendered.
|
||||
/// </summary>
|
||||
public event ItemContainerRendererEventHandler RenderItemContainer;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when separator is drawn for an item inside of ItemContainer.
|
||||
/// </summary>
|
||||
public event ItemContainerSeparatorRendererEventHandler RenderItemContainerSeparator;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when ButtonItem is rendered.
|
||||
/// </summary>
|
||||
public event ButtonItemRendererEventHandler RenderButtonItem;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when RibbonTabItem is rendered.
|
||||
/// </summary>
|
||||
public event RibbonTabItemRendererEventHandler RenderRibbonTabItem;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when docked or floating toolbar is rendered.
|
||||
/// </summary>
|
||||
public event ToolbarRendererEventHandler RenderToolbarBackground;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when popup toolbar is rendered.
|
||||
/// </summary>
|
||||
public event ToolbarRendererEventHandler RenderPopupToolbarBackground;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when dialog launcher button on ribbon bar is rendered.
|
||||
/// </summary>
|
||||
public event RibbonBarRendererEventHandler RenderRibbonDialogLauncher;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when Ribbon Control background is rendered.
|
||||
/// </summary>
|
||||
public event RibbonControlRendererEventHandler RenderRibbonControlBackground;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when form caption text on ribbon control is rendered.
|
||||
/// </summary>
|
||||
public event RibbonControlRendererEventHandler RenderRibbonFormCaptionText;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when Quick Access Toolbar background is rendered.
|
||||
/// </summary>
|
||||
public event RibbonControlRendererEventHandler RenderQuickAccessToolbarBackground;
|
||||
|
||||
///// <summary>
|
||||
///// Occurs when ribbon bar background is rendered.
|
||||
///// </summary>
|
||||
//public event RibbonBarRendererEventHandler RenderRibbonBarBackground;
|
||||
|
||||
///// <summary>
|
||||
///// Occurs when ribbon bar title is rendered.
|
||||
///// </summary>
|
||||
//public event RibbonBarRendererEventHandler RenderRibbonBarTitle;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when ColorItem is rendered.
|
||||
/// </summary>
|
||||
public event ColorItemRendererEventHandler RenderColorItem;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when SystemCaptionItem is rendered.
|
||||
/// </summary>
|
||||
public event SystemCaptionItemRendererEventHandler RenderSystemCaptionItem;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when MdiSystemItem is rendered.
|
||||
/// </summary>
|
||||
public event MdiSystemItemRendererEventHandler RenderMdiSystemItem;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when form caption is background is being rendered.
|
||||
/// </summary>
|
||||
public event FormCaptionRendererEventHandler RenderFormCaptionBackground;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when quick access toolbar overflow item is being rendered.
|
||||
/// </summary>
|
||||
public event QatOverflowItemRendererEventHandler RenderQatOverflowItem;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when quick access toolbar customize item is being rendered.
|
||||
/// </summary>
|
||||
public event QatCustomizeItemRendererEventHandler RenderQatCustomizeItem;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when CheckBoxItem is being rendered.
|
||||
/// </summary>
|
||||
public event CheckBoxItemRendererEventHandler RenderCheckBoxItem;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when ProgressBarItem is being rendered.
|
||||
/// </summary>
|
||||
public event ProgressBarItemRendererEventHandler RenderProgressBarItem;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when Navigation pane button background is being rendered.
|
||||
/// </summary>
|
||||
public event NavPaneRendererEventHandler RenderNavPaneButtonBackground;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when Slider item is being rendered.
|
||||
/// </summary>
|
||||
public event SliderItemRendererEventHandler RenderSliderItem;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when Range Slider item is being rendered.
|
||||
/// </summary>
|
||||
public event RangeSliderItemRendererEventHandler RenderRangeSliderItem;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when SideBar control is being rendered.
|
||||
/// </summary>
|
||||
public event SideBarRendererEventHandler RenderSideBar;
|
||||
/// <summary>
|
||||
/// Occurs when SideBarPanelItem control is being rendered.
|
||||
/// </summary>
|
||||
public event SideBarPanelItemRendererEventHandler RenderSideBarPanelItem;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when CrumbBarItemView is rendered.
|
||||
/// </summary>
|
||||
public event ButtonItemRendererEventHandler RenderCrumbBarItemView;
|
||||
/// <summary>
|
||||
/// Occurs when CrumbBarOverflowButton is rendered.
|
||||
/// </summary>
|
||||
public event ButtonItemRendererEventHandler RenderCrumbBarOverflowItem;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when Slider item is being rendered.
|
||||
/// </summary>
|
||||
public event SwitchButtonRendererEventHandler RenderSwitchButton;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when StepItem is being rendered.
|
||||
/// </summary>
|
||||
public event StepItemRendererEventHandler RenderStepItem;
|
||||
/// <summary>
|
||||
/// Occurs when ListBoxItem is being rendered.
|
||||
/// </summary>
|
||||
public event ListBoxItemRendererEventHandler RenderListBoxItem;
|
||||
/// <summary>
|
||||
/// Occurs when SideNavItem is being rendered.
|
||||
/// </summary>
|
||||
public event SideNavItemRendererEventHandler RenderSideNavItem;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when TabStrip is being rendered.
|
||||
/// </summary>
|
||||
public event TabFormStripRendererEventHandler RenderTabFormStrip;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when TabFormItem is rendered.
|
||||
/// </summary>
|
||||
public event ButtonItemRendererEventHandler RenderTabFormItem;
|
||||
/// <summary>
|
||||
/// Occurs when NewTabFormItem is rendered.
|
||||
/// </summary>
|
||||
public event ButtonItemRendererEventHandler RenderNewTabFormItem;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when TabParentForm is being rendered.
|
||||
/// </summary>
|
||||
public event TabFormRendererEventHandler RenderTabParentForm;
|
||||
#endregion
|
||||
|
||||
#region Internal Implementation
|
||||
/// <summary>
|
||||
/// Raises RenderKeyTips event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderKeyTips(KeyTipsRendererEventArgs e)
|
||||
{
|
||||
if (RenderKeyTips != null)
|
||||
RenderKeyTips(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Draws KeyTip for an object. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderKeyTips method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawKeyTips(KeyTipsRendererEventArgs e)
|
||||
{
|
||||
OnRenderKeyTips(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raises RenderRibbonTabGroup event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderRibbonTabGroup(RibbonTabGroupRendererEventArgs e)
|
||||
{
|
||||
if (RenderRibbonTabGroup != null)
|
||||
RenderRibbonTabGroup(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Draws ribbon tab group. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderRibbonTabGroup method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawRibbonTabGroup(RibbonTabGroupRendererEventArgs e)
|
||||
{
|
||||
OnRenderRibbonTabGroup(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raises RenderItemContainer event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderItemContainer(ItemContainerRendererEventArgs e)
|
||||
{
|
||||
if (RenderItemContainer != null)
|
||||
RenderItemContainer(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the separator for an item inside of item container. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderItemContainerSeparator method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawItemContainerSeparator(ItemContainerSeparatorRendererEventArgs e)
|
||||
{
|
||||
OnRenderItemContainerSeparator(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raises RenderItemContainer event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderItemContainerSeparator(ItemContainerSeparatorRendererEventArgs e)
|
||||
{
|
||||
if (RenderItemContainerSeparator != null)
|
||||
RenderItemContainerSeparator(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Draws item container. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderItemContainer method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawItemContainer(ItemContainerRendererEventArgs e)
|
||||
{
|
||||
OnRenderItemContainer(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raises RenderButtonItem event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderButtonItem(ButtonItemRendererEventArgs e)
|
||||
{
|
||||
if (RenderButtonItem != null)
|
||||
RenderButtonItem(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Draws ButtonItem. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderButtonItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawButtonItem(ButtonItemRendererEventArgs e)
|
||||
{
|
||||
OnRenderButtonItem(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raises RenderRibbonTabItem event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderRibbonTabItem(RibbonTabItemRendererEventArgs e)
|
||||
{
|
||||
if (RenderRibbonTabItem != null)
|
||||
RenderRibbonTabItem(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Draws RibbonTabItem. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderRibbonTabItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawRibbonTabItem(RibbonTabItemRendererEventArgs e)
|
||||
{
|
||||
OnRenderRibbonTabItem(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raises RenderToolbarBackground event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderToolbarBackground(ToolbarRendererEventArgs e)
|
||||
{
|
||||
if (RenderToolbarBackground != null)
|
||||
RenderToolbarBackground(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Draws docked or floating toolbar background. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderToolbarBackground method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawToolbarBackground(ToolbarRendererEventArgs e)
|
||||
{
|
||||
OnRenderToolbarBackground(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raises RenderPopupToolbarBackground event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderPopupToolbarBackground(ToolbarRendererEventArgs e)
|
||||
{
|
||||
if (RenderPopupToolbarBackground != null)
|
||||
RenderPopupToolbarBackground(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Draws popup toolbar background. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderPopupToolbarBackground method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawPopupToolbarBackground(ToolbarRendererEventArgs e)
|
||||
{
|
||||
OnRenderPopupToolbarBackground(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raises RenderRibbonDialogLauncher event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderRibbonDialogLauncher(RibbonBarRendererEventArgs e)
|
||||
{
|
||||
if (RenderRibbonDialogLauncher != null)
|
||||
RenderRibbonDialogLauncher(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Draws ribbon bar dialog launcher button. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderRibbonDialogLauncher method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawRibbonDialogLauncher(RibbonBarRendererEventArgs e)
|
||||
{
|
||||
OnRenderRibbonDialogLauncher(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raises RenderColorItem event event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderColorItem(ColorItemRendererEventArgs e)
|
||||
{
|
||||
if (RenderColorItem != null)
|
||||
RenderColorItem(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Draws ColorItem. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderColorItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawColorItem(ColorItemRendererEventArgs e)
|
||||
{
|
||||
OnRenderColorItem(e);
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Raises RenderRibbonBarBackground event.
|
||||
///// </summary>
|
||||
///// <param name="e">Provides context information.</param>
|
||||
//protected virtual void OnRenderRibbonBarBackground(RibbonBarRendererEventArgs e)
|
||||
//{
|
||||
// if (RenderRibbonBarBackground != null)
|
||||
// RenderRibbonBarBackground(this, e);
|
||||
//}
|
||||
///// <summary>
|
||||
///// Draws ribbon bar background. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
///// do not want default rendering to occur do not call the base implementation. You can call OnRenderRibbonBarBackground method so events can occur.
|
||||
///// </summary>
|
||||
///// <param name="e">Provides context information.</param>
|
||||
//public virtual void DrawRibbonBarBackground(RibbonBarRendererEventArgs e)
|
||||
//{
|
||||
// OnRenderRibbonBarBackground(e);
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Raises RenderRibbonBarTitle event.
|
||||
///// </summary>
|
||||
///// <param name="e">Provides context information.</param>
|
||||
//protected virtual void OnRenderRibbonBarTitle(RibbonBarRendererEventArgs e)
|
||||
//{
|
||||
// if (RenderRibbonBarTitle != null)
|
||||
// RenderRibbonBarTitle(this, e);
|
||||
//}
|
||||
///// <summary>
|
||||
///// Draws ribbon bar title. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
///// do not want default rendering to occur do not call the base implementation. You can call OnRenderRibbonBarTitle method so events can occur.
|
||||
///// </summary>
|
||||
///// <param name="e">Provides context information.</param>
|
||||
//public virtual void DrawRibbonBarTitle(RibbonBarRendererEventArgs e)
|
||||
//{
|
||||
// OnRenderRibbonBarTitle(e);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Raises RenderRibbonControlBackground event event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderRibbonControlBackground(RibbonControlRendererEventArgs e)
|
||||
{
|
||||
if (RenderRibbonControlBackground != null)
|
||||
RenderRibbonControlBackground(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Draws the background of the Ribbon Control. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderRibbonControlBackground method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawRibbonControlBackground(RibbonControlRendererEventArgs e)
|
||||
{
|
||||
OnRenderRibbonControlBackground(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raises RenderSystemCaptionItem event event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderSystemCaptionItem(SystemCaptionItemRendererEventArgs e)
|
||||
{
|
||||
if (RenderSystemCaptionItem != null)
|
||||
RenderSystemCaptionItem(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Draws the SystemCaptionItem. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderSystemCaptionItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawSystemCaptionItem(SystemCaptionItemRendererEventArgs e)
|
||||
{
|
||||
OnRenderSystemCaptionItem(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raises RenderRibbonFormCaptionText event event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderRibbonFormCaptionText(RibbonControlRendererEventArgs e)
|
||||
{
|
||||
if (RenderRibbonFormCaptionText != null)
|
||||
RenderRibbonFormCaptionText(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Draws the form caption text for the Ribbon Control. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderRibbonFormCaptionText method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawRibbonFormCaptionText(RibbonControlRendererEventArgs e)
|
||||
{
|
||||
OnRenderRibbonFormCaptionText(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raises RenderQuickAccessToolbarBackground event event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderQuickAccessToolbarBackground(RibbonControlRendererEventArgs e)
|
||||
{
|
||||
if (RenderQuickAccessToolbarBackground != null)
|
||||
RenderQuickAccessToolbarBackground(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Draws the background of Quick Access Toolbar on Ribbon Control. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderQuickAccessToolbarBackground method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawQuickAccessToolbarBackground(RibbonControlRendererEventArgs e)
|
||||
{
|
||||
OnRenderQuickAccessToolbarBackground(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raises RenderMdiSystemItem event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderMdiSystemItem(MdiSystemItemRendererEventArgs e)
|
||||
{
|
||||
if (RenderMdiSystemItem != null)
|
||||
RenderMdiSystemItem(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Draws the MdiSystemItem. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderMdiSystemItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawMdiSystemItem(MdiSystemItemRendererEventArgs e)
|
||||
{
|
||||
OnRenderMdiSystemItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Form Caption
|
||||
/// <summary>
|
||||
/// Raises RenderFormCaptionBackground event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderFormCaptionBackground(FormCaptionRendererEventArgs e)
|
||||
{
|
||||
if (RenderFormCaptionBackground != null)
|
||||
RenderFormCaptionBackground(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Draws the form caption background. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderFormCaptionBackground method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawFormCaptionBackground(FormCaptionRendererEventArgs e)
|
||||
{
|
||||
OnRenderFormCaptionBackground(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region QAT Overflow/Customize Item
|
||||
/// <summary>
|
||||
/// Raises RenderQatOverflowItem event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderQatOverflowItem(QatOverflowItemRendererEventArgs e)
|
||||
{
|
||||
if (RenderQatOverflowItem != null)
|
||||
RenderQatOverflowItem(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Draws the Quick Access Toolbar Overflow item. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderQatOverflowItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawQatOverflowItem(QatOverflowItemRendererEventArgs e)
|
||||
{
|
||||
OnRenderQatOverflowItem(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raises RenderQatCustomizeItem event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderQatCustomizeItem(QatCustomizeItemRendererEventArgs e)
|
||||
{
|
||||
if (RenderQatCustomizeItem != null)
|
||||
RenderQatCustomizeItem(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Draws the Quick Access Toolbar Customize Item. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderQatCustomizeItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawQatCustomizeItem(QatCustomizeItemRendererEventArgs e)
|
||||
{
|
||||
OnRenderQatCustomizeItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region CheckBoxItem
|
||||
/// <summary>
|
||||
/// Raises RenderCheckBoxItem event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderCheckBoxItem(CheckBoxItemRenderEventArgs e)
|
||||
{
|
||||
if (RenderCheckBoxItem != null)
|
||||
RenderCheckBoxItem(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Draws the CheckBoxItem. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderCheckBoxItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawCheckBoxItem(CheckBoxItemRenderEventArgs e)
|
||||
{
|
||||
OnRenderCheckBoxItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ProgressBarItem
|
||||
/// <summary>
|
||||
/// Raises RenderCheckBoxItem event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderProgressBarItem(ProgressBarItemRenderEventArgs e)
|
||||
{
|
||||
if (RenderProgressBarItem != null)
|
||||
RenderProgressBarItem(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Draws the ProgressBarItem. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderProgressBarItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawProgressBarItem(ProgressBarItemRenderEventArgs e)
|
||||
{
|
||||
OnRenderProgressBarItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Navigation Pane
|
||||
/// <summary>
|
||||
/// Raises RenderNavPaneButtonBackground event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderNavPaneButtonBackground(NavPaneRenderEventArgs e)
|
||||
{
|
||||
if (RenderNavPaneButtonBackground != null)
|
||||
RenderNavPaneButtonBackground(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the Navigation Pane button background. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderNavPaneButtonBackground method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawNavPaneButtonBackground(NavPaneRenderEventArgs e)
|
||||
{
|
||||
OnRenderNavPaneButtonBackground(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region SliderItem
|
||||
/// <summary>
|
||||
/// Raises RenderSliderItem event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderSliderItem(SliderItemRendererEventArgs e)
|
||||
{
|
||||
if (RenderSliderItem!= null)
|
||||
RenderSliderItem(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the Slider item. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderSliderItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawSliderItem(SliderItemRendererEventArgs e)
|
||||
{
|
||||
OnRenderSliderItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region SideBar Control
|
||||
/// <summary>
|
||||
/// Raises RenderSideBar event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderSideBar(SideBarRendererEventArgs e)
|
||||
{
|
||||
if (RenderSideBar != null)
|
||||
RenderSideBar(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the SideBar control. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderSideBar method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawSideBar(SideBarRendererEventArgs e)
|
||||
{
|
||||
OnRenderSideBar(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raises RenderSideBarPanelItem event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderSideBarPanelItem(SideBarPanelItemRendererEventArgs e)
|
||||
{
|
||||
if (RenderSideBarPanelItem != null)
|
||||
RenderSideBarPanelItem(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the SideBar control. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderSideBarPanelItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawSideBarPanelItem(SideBarPanelItemRendererEventArgs e)
|
||||
{
|
||||
OnRenderSideBarPanelItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region CrumbBar
|
||||
/// <summary>
|
||||
/// Raises RenderCrumbBarItemView event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderCrumbBarItemView(ButtonItemRendererEventArgs e)
|
||||
{
|
||||
if (RenderCrumbBarItemView != null)
|
||||
RenderCrumbBarItemView(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Draws CrumbBarItemView. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderCrumbBarItemView method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawCrumbBarItemView(ButtonItemRendererEventArgs e)
|
||||
{
|
||||
OnRenderCrumbBarItemView(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raises RenderCrumbBarOverflowItem event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderCrumbBarOverflowItem(ButtonItemRendererEventArgs e)
|
||||
{
|
||||
if (RenderCrumbBarOverflowItem != null)
|
||||
RenderCrumbBarOverflowItem(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Draws CrumbBarOverflowButton. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderCrumbBarOverflowItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawCrumbBarOverflowItem(ButtonItemRendererEventArgs e)
|
||||
{
|
||||
OnRenderCrumbBarOverflowItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region SwitchButton
|
||||
/// <summary>
|
||||
/// Raises RenderSwitchButton event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderSwitchButton(SwitchButtonRenderEventArgs e)
|
||||
{
|
||||
if (RenderSwitchButton != null)
|
||||
RenderSwitchButton(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the Switch Button. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderSwitchButton method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawSwitchButton(SwitchButtonRenderEventArgs e)
|
||||
{
|
||||
OnRenderSwitchButton(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region RangeSliderItem
|
||||
/// <summary>
|
||||
/// Raises RenderRangeSliderItem event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderRangeSliderItem(RangeSliderItemRendererEventArgs e)
|
||||
{
|
||||
if (RenderRangeSliderItem != null)
|
||||
RenderRangeSliderItem(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the Range Slider item. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderRangeSliderItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawRangeSliderItem(RangeSliderItemRendererEventArgs e)
|
||||
{
|
||||
OnRenderRangeSliderItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region StepItem
|
||||
/// <summary>
|
||||
/// Raises RenderStepItem event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderStepItem(StepItemRendererEventArgs e)
|
||||
{
|
||||
if (RenderStepItem != null)
|
||||
RenderStepItem(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the Step item. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderStepItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawStepItem(StepItemRendererEventArgs e)
|
||||
{
|
||||
OnRenderStepItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ListBoxItem
|
||||
/// <summary>
|
||||
/// Raises RenderListBoxItem event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderListBoxItem(ListBoxItemRendererEventArgs e)
|
||||
{
|
||||
if (RenderListBoxItem != null)
|
||||
RenderListBoxItem(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the ListBoxItem. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderListBoxItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawListBoxItem(ListBoxItemRendererEventArgs e)
|
||||
{
|
||||
OnRenderListBoxItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region SideNavItem
|
||||
/// <summary>
|
||||
/// Raises RenderListBoxItem event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderSideNavItem(SideNavItemRendererEventArgs e)
|
||||
{
|
||||
if (RenderSideNavItem != null)
|
||||
RenderSideNavItem(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the ListBoxItem. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderListBoxItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawSideNavItem(SideNavItemRendererEventArgs e)
|
||||
{
|
||||
OnRenderSideNavItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region TabStrip
|
||||
/// <summary>
|
||||
/// Raises RenderTabFormStrip event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderTabFormStrip(TabFormStripPainterArgs e)
|
||||
{
|
||||
if (RenderTabFormStrip != null)
|
||||
RenderTabFormStrip(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the TabStrip. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderTabFormStrip method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawTabFormStrip(TabFormStripPainterArgs e)
|
||||
{
|
||||
OnRenderTabFormStrip(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region TabFormItem
|
||||
/// <summary>
|
||||
/// Raises RenderTabFormItem event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderTabFormItem(ButtonItemRendererEventArgs e)
|
||||
{
|
||||
if (RenderTabFormItem != null)
|
||||
RenderTabFormItem(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the TabStrip. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderTabFormStrip method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawTabFormItem(ButtonItemRendererEventArgs e)
|
||||
{
|
||||
OnRenderTabFormItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region NewTabFormItem
|
||||
/// <summary>
|
||||
/// Raises RenderNewTabFormItem event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderNewTabFormItem(ButtonItemRendererEventArgs e)
|
||||
{
|
||||
if (RenderNewTabFormItem != null)
|
||||
RenderNewTabFormItem(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the NewTabFormItem. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderTabFormStrip method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawNewTabFormItem(ButtonItemRendererEventArgs e)
|
||||
{
|
||||
OnRenderNewTabFormItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region TabParentForm
|
||||
/// <summary>
|
||||
/// Raises RenderTabParentForm event.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void OnRenderTabParentForm(TabFormPainterArgs e)
|
||||
{
|
||||
if (RenderTabParentForm != null)
|
||||
RenderTabParentForm(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the TabParentForm. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderTabParentForm method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public virtual void DrawTabParentForm(TabFormPainterArgs e)
|
||||
{
|
||||
OnRenderTabParentForm(e);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
public class ButtonItemStaticColorTables
|
||||
{
|
||||
public static Office2007ButtonItemColorTable CreateBlueOrbColorTable()
|
||||
{
|
||||
return CreateBlueOrbColorTable(new ColorFactory());
|
||||
}
|
||||
|
||||
public static Office2007ButtonItemColorTable CreateBlueOrbColorTable(ColorFactory factory)
|
||||
{
|
||||
DevComponents.DotNetBar.Rendering.Office2007ButtonItemColorTable table = new DevComponents.DotNetBar.Rendering.Office2007ButtonItemColorTable();
|
||||
table.Name = Enum.GetName(typeof(eButtonColor), eButtonColor.BlueOrb);
|
||||
|
||||
// Define standard colors when mouse is not over the button
|
||||
table.Default = new DevComponents.DotNetBar.Rendering.Office2007ButtonItemStateColorTable();
|
||||
table.Default.OuterBorder.Start = factory.GetColor(0x5273AF);
|
||||
table.Default.OuterBorder.End = factory.GetColor(0x08387F);
|
||||
table.Default.InnerBorder.Start = factory.GetColor(0xD6DFEF);
|
||||
table.Default.InnerBorder.End = factory.GetColor(192, 0x5699D4);
|
||||
table.Default.TopBackground.Start = factory.GetColor(0xB5BEDE);
|
||||
table.Default.TopBackground.End = factory.GetColor(0x3568B1);
|
||||
table.Default.BottomBackground.Start = factory.GetColor(0x001B5F);
|
||||
table.Default.BottomBackground.End = factory.GetColor(0x4BD6FF);
|
||||
table.Default.BottomBackgroundHighlight.Start = factory.GetColor(0x56DAFF);
|
||||
table.Default.BottomBackgroundHighlight.End = Color.Transparent;
|
||||
table.Default.Text = factory.GetColor(0xFFFFFF);
|
||||
|
||||
// Define colors when mouse is over the button
|
||||
table.MouseOver = new DevComponents.DotNetBar.Rendering.Office2007ButtonItemStateColorTable();
|
||||
table.MouseOver.OuterBorder.Start = factory.GetColor(0x5185C8);
|
||||
table.MouseOver.OuterBorder.End = factory.GetColor(0x0754D2);
|
||||
table.MouseOver.InnerBorder.Start = factory.GetColor(0xDBE7F7);
|
||||
table.MouseOver.InnerBorder.End = factory.GetColor(128, 0x6677AB);
|
||||
table.MouseOver.TopBackground.Start = factory.GetColor(0xB5CAEB);
|
||||
table.MouseOver.TopBackground.End = factory.GetColor(0x448BD6);
|
||||
table.MouseOver.BottomBackground.Start = factory.GetColor(0x003B91);
|
||||
table.MouseOver.BottomBackground.End = factory.GetColor(0x68C5FB);
|
||||
table.MouseOver.BottomBackgroundHighlight.Start = factory.GetColor(0xBDFFFF);
|
||||
table.MouseOver.BottomBackgroundHighlight.End = Color.Transparent;
|
||||
table.MouseOver.Text = factory.GetColor(0xFFFFFF);
|
||||
|
||||
// Define colors when mouse is pressed
|
||||
table.Pressed = new DevComponents.DotNetBar.Rendering.Office2007ButtonItemStateColorTable();
|
||||
table.Pressed.OuterBorder.Start = factory.GetColor(0x303949);
|
||||
table.Pressed.OuterBorder.End = factory.GetColor(0x022963);
|
||||
table.Pressed.InnerBorder.Start = factory.GetColor(0x9CA8BD);
|
||||
table.Pressed.InnerBorder.End = Color.Transparent;
|
||||
table.Pressed.TopBackground.Start = factory.GetColor(0x747C95);
|
||||
table.Pressed.TopBackground.End = factory.GetColor(0x324D7B);
|
||||
table.Pressed.BottomBackground.Start = factory.GetColor(0x003A70);
|
||||
table.Pressed.BottomBackground.End = factory.GetColor(0x00599B);
|
||||
table.Pressed.BottomBackgroundHighlight.Start = factory.GetColor(0x61DAFF);
|
||||
table.Pressed.BottomBackgroundHighlight.End = Color.Transparent;
|
||||
table.Pressed.Text = factory.GetColor(0xFFFFFF);
|
||||
|
||||
// Define disabled button colors
|
||||
table.Disabled = new DevComponents.DotNetBar.Rendering.Office2007ButtonItemStateColorTable();
|
||||
table.Disabled.OuterBorder.Start = factory.GetColor(0x8498A9);
|
||||
table.Disabled.OuterBorder.End = factory.GetColor(0x343947);
|
||||
table.Disabled.InnerBorder.Start = Color.Transparent;
|
||||
table.Disabled.InnerBorder.End = factory.GetColor(0xD7E4F3);
|
||||
table.Disabled.TopBackground.Start = factory.GetColor(0xF4F7FA);
|
||||
table.Disabled.TopBackground.End = factory.GetColor(0xC5D9E8);
|
||||
table.Disabled.BottomBackground.Start = factory.GetColor(0xAEC2D8);
|
||||
table.Disabled.BottomBackground.End = factory.GetColor(0xBED2E8);
|
||||
table.Disabled.Text = factory.GetColor(0xDCEAF2);
|
||||
|
||||
// Define colors button is expanded
|
||||
table.Expanded = new DevComponents.DotNetBar.Rendering.Office2007ButtonItemStateColorTable();
|
||||
table.Expanded.OuterBorder.Start = factory.GetColor(0x5273AF);
|
||||
table.Expanded.OuterBorder.End = factory.GetColor(0x08387F);
|
||||
table.Expanded.InnerBorder.Start = factory.GetColor(0xD6DFEF);
|
||||
table.Expanded.InnerBorder.End = factory.GetColor(192, 0x5699D4);
|
||||
table.Expanded.TopBackground.Start = factory.GetColor(0xB5BEDE);
|
||||
table.Expanded.TopBackground.End = factory.GetColor(0x3568B1);
|
||||
table.Expanded.BottomBackground.Start = factory.GetColor(0x001656);
|
||||
table.Expanded.BottomBackground.End = factory.GetColor(0x4BD6FF);
|
||||
table.Expanded.BottomBackgroundHighlight.Start = factory.GetColor(0x56DAFF);
|
||||
table.Expanded.BottomBackgroundHighlight.End = Color.Transparent;
|
||||
table.Expanded.Text = factory.GetColor(0xFFFFFF);
|
||||
|
||||
// Define colors when mouse is pressed
|
||||
table.Checked = new DevComponents.DotNetBar.Rendering.Office2007ButtonItemStateColorTable();
|
||||
table.Checked.OuterBorder.Start = factory.GetColor(0x303949);
|
||||
table.Checked.OuterBorder.End = factory.GetColor(0x022963);
|
||||
table.Checked.InnerBorder.Start = factory.GetColor(0x9CA8BD);
|
||||
table.Checked.InnerBorder.End = Color.Transparent;
|
||||
table.Checked.TopBackground.Start = factory.GetColor(0xB5BEDE);
|
||||
table.Checked.TopBackground.End = factory.GetColor(0x3568B1);
|
||||
table.Checked.BottomBackground.Start = factory.GetColor(0x000636);
|
||||
table.Checked.BottomBackground.End = factory.GetColor(0x00599B);
|
||||
table.Checked.BottomBackgroundHighlight.Start = factory.GetColor(0x61DAFF);
|
||||
table.Checked.BottomBackgroundHighlight.End = Color.Transparent;
|
||||
table.Checked.Text = factory.GetColor(0xFFFFFF);
|
||||
|
||||
return table;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the class used to create Color objects.
|
||||
/// </summary>
|
||||
public class ColorFactory
|
||||
{
|
||||
#region Private Variables
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
/// <summary>
|
||||
/// Creates new instance of the object.
|
||||
/// </summary>
|
||||
public ColorFactory() { }
|
||||
#endregion
|
||||
|
||||
#region Internal Implementation
|
||||
public virtual Color GetColor(int color)
|
||||
{
|
||||
return ColorScheme.GetColor(color);
|
||||
}
|
||||
|
||||
public virtual Color GetColor(int alpha, int color)
|
||||
{
|
||||
return ColorScheme.GetColor(alpha, color);
|
||||
}
|
||||
|
||||
public virtual Color GetColor(int alpha, Color color)
|
||||
{
|
||||
return Color.FromArgb(alpha, color);
|
||||
}
|
||||
|
||||
public virtual Color GetColor(Color color)
|
||||
{
|
||||
return color;
|
||||
}
|
||||
|
||||
public virtual Color GetColor(string argb)
|
||||
{
|
||||
return ColorScheme.GetColor(argb);
|
||||
}
|
||||
|
||||
public static readonly ColorFactory Empty = new ColorFactory();
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents the class used to create Color objects blended based on base color.
|
||||
/// </summary>
|
||||
public class ColorBlendFactory : ColorFactory
|
||||
{
|
||||
#region Private Variables
|
||||
private Color m_BlendColor = Color.Empty;
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
/// <summary>
|
||||
/// Creates new instance of the object.
|
||||
/// </summary>
|
||||
public ColorBlendFactory(Color blendColor)
|
||||
{
|
||||
m_BlendColor = blendColor;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Internal Implementation
|
||||
/// <summary>
|
||||
/// Converts integer color representation to Color type.
|
||||
/// </summary>
|
||||
/// <param name="rgb">Color representation as 32-bit RGB value.</param>
|
||||
/// <returns>Reference to Color object.</returns>
|
||||
public override Color GetColor(int rgb)
|
||||
{
|
||||
if (rgb == -1) return Color.Empty;
|
||||
return Color.FromArgb(SoftLight((rgb & 0xFF0000) >> 16, m_BlendColor.R), SoftLight((rgb & 0xFF00) >> 8, m_BlendColor.G), SoftLight(rgb & 0xFF, m_BlendColor.B));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts integer color representation to Color type.
|
||||
/// </summary>
|
||||
/// <param name="rgb">Color representation as 32-bit RGB value.</param>
|
||||
/// <returns>Reference to Color object.</returns>
|
||||
public override Color GetColor(int alpha, int rgb)
|
||||
{
|
||||
if (rgb == -1) return Color.Empty;
|
||||
return Color.FromArgb(alpha, SoftLight((rgb & 0xFF0000) >> 16, m_BlendColor.R), SoftLight((rgb & 0xFF00) >> 8, m_BlendColor.G), SoftLight(rgb & 0xFF, m_BlendColor.B));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts integer color representation to Color type.
|
||||
/// </summary>
|
||||
/// <param name="c">Color value.</param>
|
||||
/// <returns>Reference to Color object.</returns>
|
||||
public override Color GetColor(Color c)
|
||||
{
|
||||
if (c.IsEmpty) return Color.Empty;
|
||||
return Color.FromArgb(c.A, SoftLight(c.R, m_BlendColor.R), SoftLight(c.G, m_BlendColor.G), SoftLight(c.B, m_BlendColor.B));
|
||||
}
|
||||
/// <summary>
|
||||
/// Converts color representation to alpha Color type.
|
||||
/// </summary>
|
||||
/// <param name="c">Color value.</param>
|
||||
/// <returns>Reference to Color object.</returns>
|
||||
public override Color GetColor(int alpha, Color c)
|
||||
{
|
||||
if (c.IsEmpty) return Color.Empty;
|
||||
return Color.FromArgb(alpha, SoftLight(c.R, m_BlendColor.R), SoftLight(c.G, m_BlendColor.G), SoftLight(c.B, m_BlendColor.B));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts integer color representation to Color type.
|
||||
/// </summary>
|
||||
/// <param name="c">Color value.</param>
|
||||
/// <returns>Reference to Color object.</returns>
|
||||
public override Color GetColor(string argb)
|
||||
{
|
||||
return GetColor(ColorScheme.GetColor(argb));
|
||||
}
|
||||
|
||||
internal static int SoftLight(int a, int b)
|
||||
{
|
||||
int c = 0;
|
||||
c = a * b / 255;
|
||||
return c + a * (255 - ((255 - a) * (255 - b) / 255) - c) / 255;
|
||||
}
|
||||
|
||||
internal static Color SoftLight(Color c, Color light)
|
||||
{
|
||||
return Color.FromArgb(SoftLight(c.R, light.R), SoftLight(c.G, light.G), SoftLight(c.B, light.B));
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
internal abstract class ColorItemPainter
|
||||
{
|
||||
public abstract void PaintColorItem(ColorItemRendererEventArgs e);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents color table for CrumbBarItemView.
|
||||
/// </summary>
|
||||
public class CrumbBarItemViewColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the default state color table.
|
||||
/// </summary>
|
||||
public CrumbBarItemViewStateColorTable Default = null;
|
||||
/// <summary>
|
||||
/// Gets or sets active mouse over color table.
|
||||
/// </summary>
|
||||
public CrumbBarItemViewStateColorTable MouseOver = null;
|
||||
/// <summary>
|
||||
/// Gets or sets inactive part mouse over color table.
|
||||
/// </summary>
|
||||
public CrumbBarItemViewStateColorTable MouseOverInactive = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the pressed color table.
|
||||
/// </summary>
|
||||
public CrumbBarItemViewStateColorTable Pressed = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines state color table for CrumbBarItemView
|
||||
/// </summary>
|
||||
public class CrumbBarItemViewStateColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets foreground/text color.
|
||||
/// </summary>
|
||||
public Color Foreground = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the background color blend collection.
|
||||
/// </summary>
|
||||
public BackgroundColorBlendCollection Background = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the border color.
|
||||
/// </summary>
|
||||
public Color Border = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the border color.
|
||||
/// </summary>
|
||||
public Color BorderLight = Color.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the names for the ElementStyle.Class style classes.
|
||||
/// </summary>
|
||||
public class ElementStyleClassKeys
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the key for the GalleryContainer background style class.
|
||||
/// </summary>
|
||||
public static readonly string RibbonGalleryContainerKey = "RibbonGalleryContainer";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the key for the Ribbon File menu outer container background style class.
|
||||
/// </summary>
|
||||
public static readonly string RibbonFileMenuContainerKey = "RibbonFileMenuContainer";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the key for the Ribbon File menu two column container background style class.
|
||||
/// </summary>
|
||||
public static readonly string RibbonFileMenuTwoColumnContainerKey = "RibbonFileMenuTwoColumnContainer";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the key for the Ribbon File menu first column container background style class.
|
||||
/// </summary>
|
||||
public static readonly string RibbonFileMenuColumnOneContainerKey = "RibbonFileMenuColumnOneContainer";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the key for the Ribbon File menu second column container background style class.
|
||||
/// </summary>
|
||||
public static readonly string RibbonFileMenuColumnTwoContainerKey = "RibbonFileMenuColumnTwoContainer";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the key for the Ribbon File menu bottom container background style class.
|
||||
/// </summary>
|
||||
public static readonly string RibbonFileMenuBottomContainerKey = "RibbonFileMenuBottomContainer";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the key for the text box border style class.
|
||||
/// </summary>
|
||||
public static readonly string TextBoxBorderKey = "TextBoxBorder";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the key for the RichTextBox control border style class.
|
||||
/// </summary>
|
||||
public static readonly string RichTextBoxBorderKey = "RichTextBoxBorder";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the key for the ItemPanel style class.
|
||||
/// </summary>
|
||||
public static readonly string ItemPanelKey = "ItemPanel";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the key for the ListBoxAdv style class.
|
||||
/// </summary>
|
||||
public static readonly string ListBoxAdvKey = "ListBoxAdv";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the key for the date time input background style class.
|
||||
/// </summary>
|
||||
public static readonly string DateTimeInputBackgroundKey = "DateTimeInputBackground";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the style key for the Ribbon client panel.
|
||||
/// </summary>
|
||||
public static readonly string RibbonClientPanelKey = "RibbonClientPanel";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the style key for the ListView control border style.
|
||||
/// </summary>
|
||||
public static readonly string ListViewBorderKey = "ListViewBorder";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the style key for the Office2007 Status Bar alternative background.
|
||||
/// </summary>
|
||||
public static readonly string Office2007StatusBarBackground2Key = "Office2007StatusBarBackground2";
|
||||
|
||||
#if !NOTREE
|
||||
/// <summary>
|
||||
/// Gets the style key for the AdvTree control border and background.
|
||||
/// </summary>
|
||||
public static readonly string TreeBorderKey = "TreeBorderKey";
|
||||
/// <summary>
|
||||
/// Gets the style key for the AdvTree control columns header.
|
||||
/// </summary>
|
||||
public static readonly string TreeColumnsHeaderKey = "TreeColumnsHeaderKey";
|
||||
/// <summary>
|
||||
/// Gets the style key for the AdvTree control columns header for the child nodes.
|
||||
/// </summary>
|
||||
public static readonly string TreeNodesColumnsHeaderKey = "TreeNodesColumnsHeaderKey";
|
||||
/// <summary>
|
||||
/// Gets the style key for the AdvTree control column.
|
||||
/// </summary>
|
||||
public static readonly string TreeColumnKey = "TreeColumnKey";
|
||||
#endif
|
||||
/// <summary>
|
||||
/// Gets the style key for the CrumbBar background style.
|
||||
/// </summary>
|
||||
public static readonly string CrumbBarBackgroundKey = "CrumbBarBackgroundKey";
|
||||
/// <summary>
|
||||
/// Gets the key for the DataGridView border style class.
|
||||
/// </summary>
|
||||
public static readonly string DataGridViewBorderKey = "DataGridViewBorder";
|
||||
/// <summary>
|
||||
/// Gets the key for the DataGridViewNumeric border style class.
|
||||
/// </summary>
|
||||
public static readonly string DataGridViewNumericBorderKey = "DataGridViewNumericBorder";
|
||||
/// <summary>
|
||||
/// Gets the key for the DataGridViewDateTime border style class.
|
||||
/// </summary>
|
||||
public static readonly string DataGridViewDateTimeBorderKey = "DataGridViewDateTimeBorder";
|
||||
/// <summary>
|
||||
/// Gets the key for the DataGridViewIpAddress border style class.
|
||||
/// </summary>
|
||||
public static readonly string DataGridViewIpAddressBorderKey = "DataGridViewIpAddressBorder";
|
||||
/// <summary>
|
||||
/// Gets the key for SlidePanel slide-out button style.
|
||||
/// </summary>
|
||||
public static string SlideOutButtonKey = "SlideOutButtonKey";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the key for the MetroTilePanel style class.
|
||||
/// </summary>
|
||||
public static readonly string MetroTilePanelKey = "MetroTilePanel";
|
||||
/// <summary>
|
||||
/// Gets the key for Metro tile group container title class.
|
||||
/// </summary>
|
||||
public static string MetroTileGroupTitleKey = "MetroTileGroupTitle";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the style key for the MonthCalendarAdv control.
|
||||
/// </summary>
|
||||
public static string MonthCalendarAdvKey = "MonthCalendarAdv";
|
||||
/// <summary>
|
||||
/// Gets the style key for the ProgressSteps control.
|
||||
/// </summary>
|
||||
public static string ProgressStepsKey = "ProgressSteps";
|
||||
/// <summary>
|
||||
/// Gets the style key for the SideNavStrip control.
|
||||
/// </summary>
|
||||
public static string SideNavStripKey = "SideNavStrip";
|
||||
/// <summary>
|
||||
/// Gets the style key for the TabFormPanel control.
|
||||
/// </summary>
|
||||
public static string TabFormPanelKey = "TabFormPanel";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the style key for the ToolboxGroup title.
|
||||
/// </summary>
|
||||
public static string ToolboxGroupTitleKey = "ToolboxGroupTitle";
|
||||
/// <summary>
|
||||
/// Gets the style key for the ToolboxGroup title mouse over.
|
||||
/// </summary>
|
||||
public static string ToolboxGroupTitleMouseOverKey = "ToolboxGroupTitleMouseOver";
|
||||
/// <summary>
|
||||
/// Gets the style key for the ToolboxGroup title group expanded state.
|
||||
/// </summary>
|
||||
public static string ToolboxGroupExpandedTitleKey = "ToolboxGroupExpandedTitle";
|
||||
/// <summary>
|
||||
/// Gets the style key for the ToolboxControl.
|
||||
/// </summary>
|
||||
public static string ToolboxControlKey = "ToolboxControl";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a static class that maintains the global rendering properties for all controls when eRenderMode is set to global.
|
||||
/// </summary>
|
||||
public class GlobalManager
|
||||
{
|
||||
private static BaseRenderer m_Renderer = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the global renderer used by all controls that have RenderMode set to eRenderMode.Global.
|
||||
/// </summary>
|
||||
public static BaseRenderer Renderer
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_Renderer == null)
|
||||
m_Renderer = new Office2007Renderer();
|
||||
|
||||
return m_Renderer;
|
||||
}
|
||||
set { m_Renderer = value; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents complex gradient color table.
|
||||
/// </summary>
|
||||
public class GradientColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates new instance of the object.
|
||||
/// </summary>
|
||||
public GradientColorTable() { }
|
||||
|
||||
/// <summary>
|
||||
/// Creates new instance of the object and initializes it with default values.
|
||||
/// </summary>
|
||||
/// <param name="color1">Start color</param>
|
||||
/// <param name="color2">End color</param>
|
||||
public GradientColorTable(Color color)
|
||||
{
|
||||
BackgroundColorBlendCollection.InitializeCollection(Colors, color);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates new instance of the object and initializes it with default values.
|
||||
/// </summary>
|
||||
/// <param name="color1">Start color</param>
|
||||
/// <param name="color2">End color</param>
|
||||
public GradientColorTable(int color1, int color2)
|
||||
: this(color1, color2, 90)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates new instance of the object and initializes it with default values.
|
||||
/// </summary>
|
||||
/// <param name="color1">Start color</param>
|
||||
/// <param name="color2">End color</param>
|
||||
public GradientColorTable(Color color1, Color color2)
|
||||
: this(color1, color2, 90)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates new instance of the object and initializes it with default values.
|
||||
/// </summary>
|
||||
/// <param name="color1">Start color</param>
|
||||
/// <param name="color2">End color</param>
|
||||
/// <param name="linearGradientAngle">Linear gradient angle</param>
|
||||
public GradientColorTable(int color1, int color2, int linearGradientAngle)
|
||||
{
|
||||
BackgroundColorBlendCollection.InitializeCollection(Colors, color1, color2);
|
||||
this.LinearGradientAngle = linearGradientAngle;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates new instance of the object and initializes it with default values.
|
||||
/// </summary>
|
||||
/// <param name="color1">Start color</param>
|
||||
/// <param name="color2">End color</param>
|
||||
/// <param name="linearGradientAngle">Linear gradient angle</param>
|
||||
public GradientColorTable(Color color1, Color color2, int linearGradientAngle)
|
||||
{
|
||||
BackgroundColorBlendCollection.InitializeCollection(Colors, color1, color2);
|
||||
this.LinearGradientAngle = linearGradientAngle;
|
||||
}
|
||||
|
||||
public bool IsEmpty
|
||||
{
|
||||
get
|
||||
{
|
||||
return Colors.Count == 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color collection blend that describes the gradient.
|
||||
/// </summary>
|
||||
public BackgroundColorBlendCollection Colors = new BackgroundColorBlendCollection();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the gradient type.
|
||||
/// </summary>
|
||||
public eGradientType GradientType = eGradientType.Linear;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the linear gradient angle.
|
||||
/// </summary>
|
||||
public int LinearGradientAngle = 90;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a copy of table.
|
||||
/// </summary>
|
||||
/// <returns>A copy.</returns>
|
||||
public GradientColorTable Clone()
|
||||
{
|
||||
GradientColorTable table = new GradientColorTable();
|
||||
foreach (BackgroundColorBlend item in this.Colors)
|
||||
{
|
||||
table.Colors.Add(new BackgroundColorBlend(item.Color, item.Position));
|
||||
}
|
||||
table.LinearGradientAngle = this.LinearGradientAngle;
|
||||
return table;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
internal interface IOffice2007Painter
|
||||
{
|
||||
Office2007ColorTable ColorTable { get;set;}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the color table of linear gradient.
|
||||
/// </summary>
|
||||
public class LinearGradientColorTable
|
||||
{
|
||||
public static readonly LinearGradientColorTable Empty = new LinearGradientColorTable();
|
||||
|
||||
#region Private variables
|
||||
|
||||
private Color _Start = Color.Empty;
|
||||
private Color _End = Color.Empty;
|
||||
private int _GradientAngle = 90;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Creates new instance of the object.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable() { }
|
||||
/// <summary>
|
||||
/// Creates new instance of the object.
|
||||
/// </summary>
|
||||
/// <param name="start">Start color.</param>
|
||||
public LinearGradientColorTable(Color start)
|
||||
{
|
||||
this.Start = start;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates new instance of the object.
|
||||
/// </summary>
|
||||
/// <param name="start">Start color.</param>
|
||||
/// <param name="end">End color.</param>
|
||||
public LinearGradientColorTable(Color start, Color end)
|
||||
{
|
||||
this.Start = start;
|
||||
this.End = end;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates new instance of the object.
|
||||
/// </summary>
|
||||
/// <param name="start">Start color in hexadecimal representation like FFFFFF.</param>
|
||||
/// <param name="end">End color in hexadecimal representation like FFFFFF.</param>
|
||||
public LinearGradientColorTable(string start, string end)
|
||||
{
|
||||
this.Start = ColorScheme.GetColor(start);
|
||||
this.End = ColorScheme.GetColor(end);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates new instance of the object.
|
||||
/// </summary>
|
||||
/// <param name="start">Start color in 32-bit RGB representation.</param>
|
||||
public LinearGradientColorTable(int start)
|
||||
{
|
||||
this.Start = ColorScheme.GetColor(start);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates new instance of the object.
|
||||
/// </summary>
|
||||
/// <param name="start">Start color in 32-bit RGB representation.</param>
|
||||
/// <param name="end">End color in 32-bit RGB representation.</param>
|
||||
public LinearGradientColorTable(int start, int end)
|
||||
{
|
||||
this.Start = ColorScheme.GetColor(start);
|
||||
this.End = ColorScheme.GetColor(end);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates new instance of the object.
|
||||
/// </summary>
|
||||
/// <param name="start">Start color in 32-bit RGB representation.</param>
|
||||
/// <param name="end">End color in 32-bit RGB representation.</param>
|
||||
/// <param name="gradientAngle">Gradient angle.</param>
|
||||
public LinearGradientColorTable(int start, int end, int gradientAngle)
|
||||
{
|
||||
this.Start = ColorScheme.GetColor(start);
|
||||
this.End = ColorScheme.GetColor(end);
|
||||
this.GradientAngle = gradientAngle;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates new instance of the object.
|
||||
/// </summary>
|
||||
/// <param name="start">Start color.</param>
|
||||
/// <param name="end">End color.</param>
|
||||
/// <param name="gradientAngle">Gradient angle.</param>
|
||||
public LinearGradientColorTable(Color start, Color end, int gradientAngle)
|
||||
{
|
||||
this.Start = start;
|
||||
this.End = end;
|
||||
this.GradientAngle = gradientAngle;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public properties
|
||||
|
||||
#region Start
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the start color.
|
||||
/// </summary>
|
||||
public Color Start
|
||||
{
|
||||
get { return (_Start); }
|
||||
set { _Start = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region End
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the end color.
|
||||
/// </summary>
|
||||
public Color End
|
||||
{
|
||||
get { return (_End); }
|
||||
set { _End = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region GradientAngle
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the gradient angle. Default value is 90.
|
||||
/// </summary>
|
||||
public int GradientAngle
|
||||
{
|
||||
get { return (_GradientAngle); }
|
||||
set { _GradientAngle = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IsEmpty
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether both colors assigned are empty.
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public virtual bool IsEmpty
|
||||
{
|
||||
get { return (Start.IsEmpty && End.IsEmpty && GradientAngle == 90); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
internal abstract class NavigationPanePainter
|
||||
{
|
||||
public abstract void PaintButtonBackground(NavPaneRenderEventArgs e);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Collections;
|
||||
using DevComponents.DotNetBar.Metro.Helpers;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
internal class NotificationMarkPainter
|
||||
{
|
||||
#region Implementation
|
||||
private static readonly Size MarkSize = new Size(16, 16);
|
||||
private static readonly Point MarkOffset = new Point(3, 3);
|
||||
private static readonly Color DefaultBackColor1 = ColorScheme.GetColor(0xE80000);
|
||||
private static readonly Color DefaultBackColor2 = ColorScheme.GetColor(0xC50103);
|
||||
private static readonly Color DefaultTextColor = Color.White;
|
||||
|
||||
public static Rectangle Paint(Graphics g, Rectangle targetBounds, eNotificationMarkPosition pos, string text)
|
||||
{
|
||||
return Paint(g, targetBounds, pos, text, MarkSize, MarkOffset);
|
||||
}
|
||||
public static Rectangle Paint(Graphics g, Rectangle targetBounds, eNotificationMarkPosition pos, string text, int markSize)
|
||||
{
|
||||
return Paint(g, targetBounds, pos, text, (markSize > 0 ? new Size(markSize, markSize) : MarkSize), MarkOffset);
|
||||
}
|
||||
public static Rectangle Paint(Graphics g, Rectangle targetBounds, eNotificationMarkPosition pos, string text, int markSize, Color markColor)
|
||||
{
|
||||
if (markColor.IsEmpty)
|
||||
return Paint(g, targetBounds, pos, text, (markSize > 0 ? new Size(markSize, markSize) : MarkSize), MarkOffset, DefaultBackColor1, DefaultBackColor2, DefaultTextColor);
|
||||
else
|
||||
{
|
||||
Color textColor, backColor1, backColor2;
|
||||
CreateColors(markColor, out backColor1, out backColor2, out textColor);
|
||||
return Paint(g, targetBounds, pos, text, (markSize > 0 ? new Size(markSize, markSize) : MarkSize), MarkOffset, backColor1, backColor2, textColor);
|
||||
}
|
||||
}
|
||||
private static void CreateColors(Color markColor, out Color backColor1, out Color backColor2, out Color textColor)
|
||||
{
|
||||
HSVColor baseHsv = ColorHelpers.ColorToHSV(markColor);
|
||||
ColorFunctions.HLSColor hslColor = ColorFunctions.RGBToHSL(markColor);
|
||||
textColor = hslColor.Lightness < .65 ? Color.White : Color.Black;
|
||||
backColor1 = ColorHelpers.HSVToColor(baseHsv.Hue, baseHsv.Saturation, baseHsv.Value + .1f);
|
||||
backColor2 = ColorHelpers.HSVToColor(baseHsv.Hue, baseHsv.Saturation, baseHsv.Value + .2f);
|
||||
}
|
||||
public static Rectangle Paint(Graphics g, Rectangle targetBounds, eNotificationMarkPosition pos, string text, Size markSize, Point offset)
|
||||
{
|
||||
return Paint(g, targetBounds, pos, text, markSize, offset, DefaultBackColor1, DefaultBackColor2, DefaultTextColor);
|
||||
}
|
||||
public static Rectangle Paint(Graphics g, Rectangle targetBounds, eNotificationMarkPosition pos, string text, Size markSize, Point offset, Color markColor)
|
||||
{
|
||||
if (markColor.IsEmpty)
|
||||
return Paint(g, targetBounds, pos, text, markSize, offset, DefaultBackColor1, DefaultBackColor2, DefaultTextColor);
|
||||
else
|
||||
{
|
||||
Color textColor, backColor1, backColor2;
|
||||
CreateColors(markColor, out backColor1, out backColor2, out textColor);
|
||||
return Paint(g, targetBounds, pos, text, markSize, offset, backColor1, backColor2, textColor);
|
||||
}
|
||||
}
|
||||
public static Rectangle Paint(Graphics g, Rectangle targetBounds, eNotificationMarkPosition pos, string text, Size markSize, Point offset, Color markColor, Rectangle containerClipRect)
|
||||
{
|
||||
if (markColor.IsEmpty)
|
||||
return Paint(g, targetBounds, pos, text, markSize, offset, DefaultBackColor1, DefaultBackColor2, DefaultTextColor, containerClipRect);
|
||||
else
|
||||
{
|
||||
Color textColor, backColor1, backColor2;
|
||||
CreateColors(markColor, out backColor1, out backColor2, out textColor);
|
||||
return Paint(g, targetBounds, pos, text, markSize, offset, backColor1, backColor2, textColor, containerClipRect);
|
||||
}
|
||||
}
|
||||
public static Rectangle Paint(Graphics g, Rectangle targetBounds, eNotificationMarkPosition pos, string text, Size markSize, Point offset, Color backColor1, Color backColor2, Color textColor)
|
||||
{
|
||||
return Paint(g, targetBounds, pos, text, markSize, offset, backColor1, backColor2, textColor, Rectangle.Empty);
|
||||
}
|
||||
public static Rectangle Paint(Graphics g, Rectangle targetBounds, eNotificationMarkPosition pos, string text, Size markSize, Point offset, Color backColor1, Color backColor2, Color textColor, Rectangle containerClipRect)
|
||||
{
|
||||
if (markSize.IsEmpty) markSize = MarkSize; // Default it if empty
|
||||
Color borderColor = Color.White;
|
||||
int borderSize = Dpi.Width2;
|
||||
|
||||
markSize = Dpi.Size(markSize);
|
||||
offset = Dpi.Size(offset);
|
||||
//Color backColor1 = DefaultBackColor1;
|
||||
//Color backColor2 = DefaultBackColor2;
|
||||
//Color textColor = DefaultTextColor;
|
||||
Font textFont = new Font("Microsoft Sans Serif", text.Length > 1 ? 6.75f : 8.25f, FontStyle.Bold);
|
||||
|
||||
Rectangle r;
|
||||
if (pos == eNotificationMarkPosition.TopRight)
|
||||
r = new Rectangle(targetBounds.Right - markSize.Width - 1 + offset.X, targetBounds.Y - offset.Y, markSize.Width, markSize.Height);
|
||||
else if (pos == eNotificationMarkPosition.TopLeft)
|
||||
r = new Rectangle(targetBounds.X - offset.X, targetBounds.Y - offset.Y, markSize.Width, markSize.Height);
|
||||
else if (pos == eNotificationMarkPosition.BottomLeft)
|
||||
r = new Rectangle(targetBounds.X - offset.X, targetBounds.Bottom - markSize.Height - 1 + offset.Y, markSize.Width, markSize.Height);
|
||||
else // eNotificationMarkPosition.BottomRight
|
||||
r = new Rectangle(targetBounds.Right - markSize.Width - 1 + offset.X, targetBounds.Bottom - markSize.Height + offset.Y, markSize.Width, markSize.Height);
|
||||
|
||||
SmoothingMode sm = g.SmoothingMode;
|
||||
System.Drawing.Text.TextRenderingHint th = g.TextRenderingHint;
|
||||
g.SmoothingMode = SmoothingMode.HighQuality;
|
||||
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
|
||||
Region oldClip = g.Clip;
|
||||
if (containerClipRect.IsEmpty)
|
||||
g.ResetClip();
|
||||
else
|
||||
g.SetClip(containerClipRect);
|
||||
|
||||
// Drop shadow
|
||||
Rectangle shadow = r;
|
||||
shadow.Inflate(1, 1);
|
||||
shadow.Offset(0, 3);
|
||||
using (GraphicsPath shadowPath = new GraphicsPath())
|
||||
{
|
||||
shadowPath.AddEllipse(shadow);
|
||||
using (PathGradientBrush brush = new PathGradientBrush(shadowPath))
|
||||
{
|
||||
brush.CenterColor = Color.FromArgb(148, Color.Black);
|
||||
brush.SurroundColors = new Color[] { Color.FromArgb(4,Color.Black)};
|
||||
g.FillPath(brush, shadowPath);
|
||||
}
|
||||
}
|
||||
|
||||
using (LinearGradientBrush brush = new LinearGradientBrush(r, backColor1, backColor2, 90))
|
||||
g.FillEllipse(brush, r);
|
||||
|
||||
// Highlight
|
||||
Rectangle hr = new Rectangle(r.X - (int)(r.Width * .15), r.Y - (int)(r.Height * .15), (int)(r.Width * 1.3), (int)(r.Height * 1.32) / 2);
|
||||
using (LinearGradientBrush brush = new LinearGradientBrush(hr, Color.FromArgb(128, Color.White), Color.FromArgb(8, Color.White), 90))
|
||||
{
|
||||
GraphicsPath clipPath = new GraphicsPath();
|
||||
clipPath.AddEllipse(r);
|
||||
if (containerClipRect.IsEmpty)
|
||||
g.SetClip(clipPath);
|
||||
else
|
||||
g.SetClip(clipPath, CombineMode.Intersect);
|
||||
g.FillEllipse(brush, hr);
|
||||
if(containerClipRect.IsEmpty)
|
||||
g.ResetClip();
|
||||
else
|
||||
g.SetClip(containerClipRect);
|
||||
clipPath.Dispose();
|
||||
}
|
||||
|
||||
// Border
|
||||
using (Pen pen = new Pen(borderColor, borderSize))
|
||||
g.DrawEllipse(pen, r);
|
||||
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
// Text
|
||||
Rectangle textBounds = r;
|
||||
if (text.Length == 1)
|
||||
textBounds.Y++;
|
||||
using (StringFormat sf = (StringFormat)StringFormat.GenericDefault.Clone())
|
||||
{
|
||||
|
||||
sf.LineAlignment = StringAlignment.Center;
|
||||
sf.Alignment = StringAlignment.Center;
|
||||
using (SolidBrush brush = new SolidBrush(textColor))
|
||||
g.DrawString(text, textFont, brush, textBounds, sf);
|
||||
}
|
||||
}
|
||||
|
||||
// Cleanup
|
||||
g.Clip = oldClip; oldClip.Dispose();
|
||||
textFont.Dispose();
|
||||
g.SmoothingMode = sm;
|
||||
g.TextRenderingHint = th;
|
||||
|
||||
return r;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using DevComponents.DotNetBar.Rendering;
|
||||
|
||||
namespace DevComponents.DotNetBar
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents color table for Bar objects in various states.
|
||||
/// </summary>
|
||||
public class Office2007BarColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for top part of toolbar background.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable ToolbarTopBackground = new LinearGradientColorTable(ColorScheme.GetColor("D7E6F9"), ColorScheme.GetColor("C7DCF8"));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for bottom part of toolbar background.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable ToolbarBottomBackground = new LinearGradientColorTable(ColorScheme.GetColor("B3D0F5"), ColorScheme.GetColor("D7E5F7"));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color of the bottom border.
|
||||
/// </summary>
|
||||
public Color ToolbarBottomBorder = ColorScheme.GetColor("BAD4F7");
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the popup toolbar background color.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable PopupToolbarBackground = new LinearGradientColorTable(ColorScheme.GetColor("FAFAFA"), Color.Empty);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color of popup toolbar border.
|
||||
/// </summary>
|
||||
public Color PopupToolbarBorder = ColorScheme.GetColor("868686");
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the status bar top border color.
|
||||
/// </summary>
|
||||
public Color StatusBarTopBorder = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the status bar top border light color.
|
||||
/// </summary>
|
||||
public Color StatusBarTopBorderLight = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the alternative background colors for the status bar.
|
||||
/// </summary>
|
||||
public BackgroundColorBlendCollection StatusBarAltBackground = new BackgroundColorBlendCollection();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents color table for ButtonItem object.
|
||||
/// </summary>
|
||||
public class Office2007ButtonItemColorTable
|
||||
{
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the color table.
|
||||
/// </summary>
|
||||
public string Name = "";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color table applied for button in default state.
|
||||
/// </summary>
|
||||
public Office2007ButtonItemStateColorTable Default = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color table applied when mouse is over the button.
|
||||
/// </summary>
|
||||
public Office2007ButtonItemStateColorTable MouseOver = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color table applied when mouse is over the buttons inactive split part. Applies to split button appearance only.
|
||||
/// </summary>
|
||||
public Office2007ButtonItemStateColorTable MouseOverSplitInactive = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color table applied when mouse is pressed over the button.
|
||||
/// </summary>
|
||||
public Office2007ButtonItemStateColorTable Pressed = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color table applied when mouse is pressed over the button.
|
||||
/// </summary>
|
||||
public Office2007ButtonItemStateColorTable Checked = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color table applied when button is expanded.
|
||||
/// </summary>
|
||||
public Office2007ButtonItemStateColorTable Expanded = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color table applied when cursor is over button on a menu.
|
||||
/// </summary>
|
||||
public Office2007ButtonItemStateColorTable Disabled = null;
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents typed collection of Office2007ButtonItemColorTable type.
|
||||
/// </summary>
|
||||
public class Office2007ButtonItemColorTableCollection : CollectionBase
|
||||
{
|
||||
#region Internal Implementation
|
||||
private Hashtable m_Keys = new Hashtable();
|
||||
/// <summary>Creates new instance of the class.</summary>
|
||||
public Office2007ButtonItemColorTableCollection() { }
|
||||
|
||||
/// <summary>
|
||||
/// Adds new object to the collection.
|
||||
/// </summary>
|
||||
/// <param name="Office2007ButtonItemColorTable">Object to add.</param>
|
||||
/// <returns>Index of newly added object.</returns>
|
||||
public int Add(Office2007ButtonItemColorTable colorTable)
|
||||
{
|
||||
return List.Add(colorTable);
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns reference to the object in collection based on it's index.
|
||||
/// </summary>
|
||||
public Office2007ButtonItemColorTable this[int index]
|
||||
{
|
||||
get {return (Office2007ButtonItemColorTable)(List[index]);}
|
||||
set {List[index] = value;}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns reference to the object in collection based on it's index.
|
||||
/// </summary>
|
||||
public Office2007ButtonItemColorTable this[string name]
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Keys[name] as Office2007ButtonItemColorTable;
|
||||
//foreach (Office2007ButtonItemColorTable ct in this.List)
|
||||
//{
|
||||
// if (ct.Name == name)
|
||||
// return ct;
|
||||
//}
|
||||
//return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inserts new object into the collection.
|
||||
/// </summary>
|
||||
/// <param name="index">Position of the object.</param>
|
||||
/// <param name="value">Object to insert.</param>
|
||||
public void Insert(int index, Office2007ButtonItemColorTable value)
|
||||
{
|
||||
List.Insert(index, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns index of the object inside of the collection.
|
||||
/// </summary>
|
||||
/// <param name="value">Reference to the object.</param>
|
||||
/// <returns>Index of the object.</returns>
|
||||
public int IndexOf(Office2007ButtonItemColorTable value)
|
||||
{
|
||||
return List.IndexOf(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether collection contains specified object.
|
||||
/// </summary>
|
||||
/// <param name="value">Object to look for.</param>
|
||||
/// <returns>true if object is part of the collection, otherwise false.</returns>
|
||||
public bool Contains(Office2007ButtonItemColorTable value)
|
||||
{
|
||||
return List.Contains(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether collection contains object with specified name.
|
||||
/// </summary>
|
||||
/// <param name="name">Name of the object to look for</param>
|
||||
/// <returns>true if object with given name is part of the collection otherwise false</returns>
|
||||
public bool Contains(string name)
|
||||
{
|
||||
return m_Keys.ContainsKey(name);
|
||||
//foreach (Office2007ButtonItemColorTable ct in this.List)
|
||||
//{
|
||||
// if (ct.Name == name)
|
||||
// return true;
|
||||
//}
|
||||
//return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes specified object from the collection.
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
public void Remove(Office2007ButtonItemColorTable value)
|
||||
{
|
||||
List.Remove(value);
|
||||
}
|
||||
|
||||
protected override void OnRemoveComplete(int index, object value)
|
||||
{
|
||||
base.OnRemoveComplete(index, value);
|
||||
Office2007ButtonItemColorTable me = value as Office2007ButtonItemColorTable;
|
||||
m_Keys.Remove(me.Name);
|
||||
}
|
||||
protected override void OnInsertComplete(int index, object value)
|
||||
{
|
||||
base.OnInsertComplete(index, value);
|
||||
Office2007ButtonItemColorTable me = value as Office2007ButtonItemColorTable;
|
||||
m_Keys.Add(me.Name, me);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copies collection into the specified array.
|
||||
/// </summary>
|
||||
/// <param name="array">Array to copy collection to.</param>
|
||||
/// <param name="index">Starting index.</param>
|
||||
public void CopyTo(Office2007ButtonItemColorTable[] array, int index)
|
||||
{
|
||||
List.CopyTo(array, index);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copies contained items to the Office2007ButtonItemColorTable array.
|
||||
/// </summary>
|
||||
/// <param name="array">Array to copy to.</param>
|
||||
internal void CopyTo(Office2007ButtonItemColorTable[] array)
|
||||
{
|
||||
List.CopyTo(array,0);
|
||||
}
|
||||
|
||||
protected override void OnClear()
|
||||
{
|
||||
m_Keys.Clear();
|
||||
base.OnClear();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a color table for ButtonItem in certain state like but not limited to mouse over, checked or pressed.
|
||||
/// </summary>
|
||||
public class Office2007ButtonItemStateColorTable
|
||||
{
|
||||
#region Internal Implementation
|
||||
/// <summary>
|
||||
/// Gets or sets the outer border colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable OuterBorder = new LinearGradientColorTable();
|
||||
/// <summary>
|
||||
/// Gets or sets the outer border width. Default is 1.
|
||||
/// </summary>
|
||||
public int OuterBorderWidth = 1;
|
||||
/// <summary>
|
||||
/// Gets or sets the inner border colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable InnerBorder = new LinearGradientColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets top part background colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable TopBackground = new LinearGradientColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets highlight colors for the top background part.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable TopBackgroundHighlight = new LinearGradientColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets bottom part background colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable BottomBackground = new LinearGradientColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets highlight colors for the bottom background part.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable BottomBackgroundHighlight = new LinearGradientColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the split border colors that divides button text and image from expand part of the button.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable SplitBorder = new LinearGradientColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the split border light colors that divides button text and image from expand part of the button.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable SplitBorderLight = new LinearGradientColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the text color.
|
||||
/// </summary>
|
||||
public Color Text = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background color of the expand sign.
|
||||
/// </summary>
|
||||
public Color ExpandBackground = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the outline light color of the expand sign.
|
||||
/// </summary>
|
||||
public Color ExpandLight = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the single gradient background for the button. When specified it is used instead of TopBackground and BottomBackground for rendering.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable Background = null;
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using DevComponents.DotNetBar.Schedule;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the color table for Office 2007 Style CalendarView Control.
|
||||
/// </summary>
|
||||
public class Office2007CalendarViewColorTable
|
||||
{
|
||||
public ColorDef[] TimeRulerColors = null;
|
||||
public ColorDef[] MonthViewColors = null;
|
||||
public ColorDef[] WeekDayViewColors = null;
|
||||
public ColorDef[] AppointmentColors = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represent the color table for the CheckBoxItem.
|
||||
/// </summary>
|
||||
public class Office2007CheckBoxColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the item in default state.
|
||||
/// </summary>
|
||||
public Office2007CheckBoxStateColorTable Default = new Office2007CheckBoxStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the item when mouse is over the item.
|
||||
/// </summary>
|
||||
public Office2007CheckBoxStateColorTable MouseOver = new Office2007CheckBoxStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the item when mouse is pressed over the item.
|
||||
/// </summary>
|
||||
public Office2007CheckBoxStateColorTable Pressed = new Office2007CheckBoxStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the item when item is disabled.
|
||||
/// </summary>
|
||||
public Office2007CheckBoxStateColorTable Disabled = new Office2007CheckBoxStateColorTable();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the colors for the single CheckBoxItem state.
|
||||
/// </summary>
|
||||
public class Office2007CheckBoxStateColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the background colors of the check box.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable CheckBackground = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color of the check border.
|
||||
/// </summary>
|
||||
public Color CheckBorder = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the inner color of check box border.
|
||||
/// </summary>
|
||||
public Color CheckInnerBorder = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the inner background color of check box.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable CheckInnerBackground = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color of the check sign that is drawn when item is checked.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable CheckSign = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the text color.
|
||||
/// </summary>
|
||||
public Color Text = Color.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines color table for ColorItem.
|
||||
/// </summary>
|
||||
public class Office2007ColorItemColorTable
|
||||
{
|
||||
#region ColorItem Colors
|
||||
/// <summary>
|
||||
/// Gets or sets the border that is drawn around each individual color item or color item group.
|
||||
/// </summary>
|
||||
public Color Border = ColorScheme.GetColor("ECE9D8");
|
||||
/// <summary>
|
||||
/// Gets or sets the inner mouse over color.
|
||||
/// </summary>
|
||||
public Color MouseOverInnerBorder = ColorScheme.GetColor("FFE294");
|
||||
/// <summary>
|
||||
/// Gets or sets the outer mouse over color.
|
||||
/// </summary>
|
||||
public Color MouseOverOuterBorder = ColorScheme.GetColor("F29436");
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the painter for ColorItem in Office 2007 style
|
||||
/// </summary>
|
||||
internal class Office2007ColorItemPainter : ColorItemPainter, IOffice2007Painter
|
||||
{
|
||||
#region IOffice2007Painter
|
||||
private Office2007ColorTable m_ColorTable = null; //new Office2007ColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets color table used by renderer.
|
||||
/// </summary>
|
||||
public Office2007ColorTable ColorTable
|
||||
{
|
||||
get { return m_ColorTable; }
|
||||
set { m_ColorTable = value; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Internal Implementation
|
||||
public override void PaintColorItem(ColorItemRendererEventArgs e)
|
||||
{
|
||||
Graphics g = e.Graphics;
|
||||
ColorItem item = e.ColorItem;
|
||||
Rectangle r = item.Bounds;
|
||||
Color borderColor = m_ColorTable.ColorItem.Border;
|
||||
Color outerHotColor = m_ColorTable.ColorItem.MouseOverOuterBorder;
|
||||
Color innerHotColor = m_ColorTable.ColorItem.MouseOverInnerBorder;
|
||||
|
||||
System.Drawing.Drawing2D.SmoothingMode sm = g.SmoothingMode;
|
||||
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default;
|
||||
|
||||
Region clip = g.Clip;
|
||||
g.SetClip(r);
|
||||
Color selectedColor = Color.Empty;
|
||||
ColorPickerDropDown cpd = null;
|
||||
BaseItem parent = item.Parent;
|
||||
while (parent != null)
|
||||
{
|
||||
if (parent is ColorPickerDropDown)
|
||||
{
|
||||
cpd = parent as ColorPickerDropDown;
|
||||
break;
|
||||
}
|
||||
parent = parent.Parent;
|
||||
}
|
||||
if (cpd != null)
|
||||
selectedColor = cpd.SelectedColor;
|
||||
try
|
||||
{
|
||||
if (!item.Color.IsEmpty)
|
||||
{
|
||||
Rectangle fill = r;
|
||||
fill.Inflate(1, 1);
|
||||
DisplayHelp.FillRectangle(g, fill, item.Color, Color.Empty);
|
||||
}
|
||||
|
||||
if (item.IsMouseOver || selectedColor == item.Color)
|
||||
{
|
||||
Rectangle inner = r;
|
||||
inner.Inflate(-1, -1);
|
||||
DisplayHelp.DrawRectangle(g, innerHotColor, inner);
|
||||
DisplayHelp.DrawRectangle(g, outerHotColor, r);
|
||||
}
|
||||
else
|
||||
{
|
||||
eColorItemBorder border = item.Border;
|
||||
if (border == eColorItemBorder.All)
|
||||
DisplayHelp.DrawRectangle(g, borderColor, r);
|
||||
else if (border != eColorItemBorder.None)
|
||||
{
|
||||
using (Pen pen = new Pen(borderColor))
|
||||
{
|
||||
if ((border & eColorItemBorder.Left) == eColorItemBorder.Left)
|
||||
g.DrawLine(pen, r.X, r.Y, r.X, r.Bottom - 1);
|
||||
if ((border & eColorItemBorder.Right) == eColorItemBorder.Right)
|
||||
g.DrawLine(pen, r.Right - 1, r.Y, r.Right - 1, r.Bottom - 1);
|
||||
if ((border & eColorItemBorder.Top) == eColorItemBorder.Top)
|
||||
g.DrawLine(pen, r.X, r.Y, r.Right - 1, r.Y);
|
||||
if ((border & eColorItemBorder.Bottom) == eColorItemBorder.Bottom)
|
||||
g.DrawLine(pen, r.X, r.Bottom - 1, r.Right - 1, r.Bottom - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (clip != null)
|
||||
g.Clip = clip;
|
||||
else
|
||||
g.ResetClip();
|
||||
}
|
||||
g.SmoothingMode = sm;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the color table for the combo box.
|
||||
/// </summary>
|
||||
public class Office2007ComboBoxColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the color for combo box in default state.
|
||||
/// </summary>
|
||||
public Office2007ComboBoxStateColorTable Default = new Office2007ComboBoxStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color for standalone combo box in default state. Standalone combo box is a control not used by ComboBoxItem.
|
||||
/// </summary>
|
||||
public Office2007ComboBoxStateColorTable DefaultStandalone = new Office2007ComboBoxStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors when mouse is over the control.
|
||||
/// </summary>
|
||||
public Office2007ComboBoxStateColorTable MouseOver = new Office2007ComboBoxStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors when control is dropped down.
|
||||
/// </summary>
|
||||
public Office2007ComboBoxStateColorTable DroppedDown = new Office2007ComboBoxStateColorTable();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the combo box colors for a particular state.
|
||||
/// </summary>
|
||||
public class Office2007ComboBoxStateColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the border color.
|
||||
/// </summary>
|
||||
public Color Border = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the background color.
|
||||
/// </summary>
|
||||
public Color Background = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the outer expand button border.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable ExpandBorderOuter = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the inner expand button border.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable ExpandBorderInner = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the background color of the expand button.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable ExpandBackground = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the foreground color of the expand button.
|
||||
/// </summary>
|
||||
public Color ExpandText = Color.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines color table for the Office 2007 style DataGridView control.
|
||||
/// </summary>
|
||||
public class Office2007DataGridViewColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets grid background color.
|
||||
/// </summary>
|
||||
public Color BackgroundColor = SystemColors.AppWorkspace;
|
||||
/// <summary>
|
||||
/// Gets or sets default cell color.
|
||||
/// </summary>
|
||||
public Color DefaultCellBackground = SystemColors.Window;
|
||||
/// <summary>
|
||||
/// Gets or sets default cell text color.
|
||||
/// </summary>
|
||||
public Color DefaultCellText = SystemColors.WindowText;
|
||||
/// <summary>
|
||||
/// Gets or sets the background color for the column headers in normal state.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable ColumnHeaderNormalBackground = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the normal column text color.
|
||||
/// </summary>
|
||||
public Color ColumnHeaderNormalText = SystemColors.WindowText;
|
||||
/// <summary>
|
||||
/// Gets or sets the column header border color.
|
||||
/// </summary>
|
||||
public Color ColumnHeaderNormalBorder = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the background color for the column headers in mouse over state.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable ColumnHeaderMouseOverBackground = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the column header border color when mouse is over the column.
|
||||
/// </summary>
|
||||
public Color ColumnHeaderMouseOverBorder = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the selected column header text color.
|
||||
/// </summary>
|
||||
public Color ColumnHeaderSelectedText = SystemColors.WindowText;
|
||||
/// <summary>
|
||||
/// Gets or sets the background color for the column headers in selected state.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable ColumnHeaderSelectedBackground = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the border color for the column headers in selected state.
|
||||
/// </summary>
|
||||
public Color ColumnHeaderSelectedBorder = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background color for the column headers in selected mouse over state.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable ColumnHeaderSelectedMouseOverBackground = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the border color for the column headers in selected mouse over state.
|
||||
/// </summary>
|
||||
public Color ColumnHeaderSelectedMouseOverBorder = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background color for the column headers in pressed state.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable ColumnHeaderPressedBackground = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the border color for the column headers in pressed state.
|
||||
/// </summary>
|
||||
public Color ColumnHeaderPressedBorder = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the column header foreground color.
|
||||
/// </summary>
|
||||
public Color ColumnHeaderForeground = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background color for row marker background.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable RowNormalBackground = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the border color for row marker.
|
||||
/// </summary>
|
||||
public Color RowNormalBorder = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the background color for row marker background.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable RowMouseOverBackground = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the border color for row marker.
|
||||
/// </summary>
|
||||
public Color RowMouseOverBorder = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the background color for row marker background.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable RowSelectedMouseOverBackground = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the border color for row marker.
|
||||
/// </summary>
|
||||
public Color RowSelectedMouseOverBorder = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the background color for row marker background.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable RowSelectedBackground = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the border color for row marker.
|
||||
/// </summary>
|
||||
public Color RowSelectedBorder = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the background color for row marker background.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable RowPressedBackground = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the border color for row marker.
|
||||
/// </summary>
|
||||
public Color RowPressedBorder = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color of the grid lines.
|
||||
/// </summary>
|
||||
public Color GridColor = SystemColors.ControlDark;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background color of selector cell usually located in top-left corner.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable SelectorBackground = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the border color of selector cell usually located in top-left corner.
|
||||
/// </summary>
|
||||
public Color SelectorBorder = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the light border color of selector cell usually located in top-left corner.
|
||||
/// </summary>
|
||||
public Color SelectorBorderLight = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the dark border color of selector cell usually located in top-left corner.
|
||||
/// </summary>
|
||||
public Color SelectorBorderDark = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the sign color of selector cell usually located in top-left corner.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable SelectorSign = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background color of selector cell usually located in top-left corner.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable SelectorMouseOverBackground = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the border color of selector cell usually located in top-left corner.
|
||||
/// </summary>
|
||||
public Color SelectorMouseOverBorder = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the light border color of selector cell usually located in top-left corner.
|
||||
/// </summary>
|
||||
public Color SelectorMouseOverBorderLight = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the dark border color of selector cell usually located in top-left corner.
|
||||
/// </summary>
|
||||
public Color SelectorMouseOverBorderDark = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the sign color of selector cell usually located in top-left corner.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable SelectorMouseOverSign = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines color table for the Dialog Launcher button.
|
||||
/// </summary>
|
||||
public class Office2007DialogLauncherColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the default state.
|
||||
/// </summary>
|
||||
public Office2007DialogLauncherStateColorTable Default = new Office2007DialogLauncherStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the mouse over state.
|
||||
/// </summary>
|
||||
public Office2007DialogLauncherStateColorTable MouseOver = new Office2007DialogLauncherStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the pressed state.
|
||||
/// </summary>
|
||||
public Office2007DialogLauncherStateColorTable Pressed = new Office2007DialogLauncherStateColorTable();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the color table for dialog launcher state.
|
||||
/// </summary>
|
||||
public class Office2007DialogLauncherStateColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the color of dialog launcher symbol.
|
||||
/// </summary>
|
||||
public Color DialogLauncher = ColorScheme.GetColor("668EAF");
|
||||
/// <summary>
|
||||
/// Gets or sets the shade color of dialog launcher symbol.
|
||||
/// </summary>
|
||||
public Color DialogLauncherShade = Color.White;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background color for the top part of the element.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable TopBackground = new LinearGradientColorTable();
|
||||
/// <summary>
|
||||
/// Gets or sets the background color for the bottom part of the element.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable BottomBackground = new LinearGradientColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the outer border colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable OuterBorder = new LinearGradientColorTable();
|
||||
/// <summary>
|
||||
/// Gets or sets the inner border colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable InnerBorder = new LinearGradientColorTable();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the color table for all states of Office 2007 style form caption.
|
||||
/// </summary>
|
||||
public class Office2007FormColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the color table for caption in active state.
|
||||
/// </summary>
|
||||
public Office2007FormStateColorTable Active = new Office2007FormStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color table for caption in inactive state.
|
||||
/// </summary>
|
||||
public Office2007FormStateColorTable Inactive = new Office2007FormStateColorTable();
|
||||
|
||||
/// <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 MDI Client Background image.
|
||||
/// </summary>
|
||||
public Image MdiClientBackgroundImage = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines color table for the Office 2007 style Form caption color state.
|
||||
/// </summary>
|
||||
public class Office2007FormStateColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the top part of the background.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable CaptionTopBackground = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the bottom part of the background.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable CaptionBottomBackground = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the array of colors used to draw the border that separates the form caption and the form content. Applies only to the Office2007Form rendering.
|
||||
/// </summary>
|
||||
public Color[] CaptionBottomBorder = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color of caption text.
|
||||
/// </summary>
|
||||
public Color CaptionText = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color of caption extra text that is appended to the caption.
|
||||
/// </summary>
|
||||
public Color CaptionTextExtra = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the array of colors that represents the border colors. Outer border is at index 0.
|
||||
/// </summary>
|
||||
public Color[] BorderColors = null; // OuterBorder = Color.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the color table used by the Gallery container.
|
||||
/// </summary>
|
||||
public class Office2007GalleryColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the background color of the Gallery Group label when gallery is displayed on popup.
|
||||
/// </summary>
|
||||
public Color GroupLabelBackground = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the text color of the Gallery Group label when gallery is displayed on popup.
|
||||
/// </summary>
|
||||
public Color GroupLabelText = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the border color of the Gallery Group label when gallery is displayed on popup.
|
||||
/// </summary>
|
||||
public Color GroupLabelBorder = Color.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents color table for ItemContainer object with BeginGroup set to true.
|
||||
/// </summary>
|
||||
public class Office2007ItemGroupColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the outer border colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable OuterBorder = new LinearGradientColorTable(ColorScheme.GetColor("99B6E0"), ColorScheme.GetColor("7394BD"));
|
||||
/// <summary>
|
||||
/// Gets or sets the inner border colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable InnerBorder = new LinearGradientColorTable(ColorScheme.GetColor("D5E3F1"), ColorScheme.GetColor("E3EDFB"));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the top background colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable TopBackground = new LinearGradientColorTable(ColorScheme.GetColor("C8DBEE"), ColorScheme.GetColor("C9DDF6"));
|
||||
/// <summary>
|
||||
/// Gets or sets the bottom background colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable BottomBackground = new LinearGradientColorTable(ColorScheme.GetColor("BCD0E9"), ColorScheme.GetColor("D0E1F7"));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the dark color of item devider for items inside of the ItemContainer.
|
||||
/// </summary>
|
||||
public Color ItemGroupDividerDark = Color.FromArgb(196, ColorScheme.GetColor("B8C8DC"));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the light color of item devider for items inside of the ItemContainer.
|
||||
/// </summary>
|
||||
public Color ItemGroupDividerLight = Color.FromArgb(128, ColorScheme.GetColor("FFFFFF"));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the color table for key tips.
|
||||
/// </summary>
|
||||
public class Office2007KeyTipsColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets KeyTip Text color.
|
||||
/// </summary>
|
||||
public Color KeyTipText = ColorScheme.GetColor(0x4C4C4C);
|
||||
/// <summary>
|
||||
/// Gets or sets KeyTip border color.
|
||||
/// </summary>
|
||||
public Color KeyTipBorder = ColorScheme.GetColor(0x767676);
|
||||
/// <summary>
|
||||
/// Gets or sets KeyTip Background color.
|
||||
/// </summary>
|
||||
public Color KeyTipBackground = ColorScheme.GetColor(0xFDFDFE);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents color table for ListViewEx control.
|
||||
/// </summary>
|
||||
public class Office2007ListViewColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the background color of the columns.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable ColumnBackground = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color of the column separator.
|
||||
/// </summary>
|
||||
public Color ColumnSeparator = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color of the column text.
|
||||
/// </summary>
|
||||
public Color ColumnForeColor = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color of the control border.
|
||||
/// </summary>
|
||||
public Color Border = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background colors for the selected item.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable SelectionBackground = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color of the selected item border that is draw on top and bottom of the selection.
|
||||
/// </summary>
|
||||
public Color SelectionBorder = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the text color for selected item.
|
||||
/// </summary>
|
||||
public Color SelectionForeColor = Color.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the color table for the menus.
|
||||
/// </summary>
|
||||
public class Office2007MenuColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the menu background colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable Background = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the menu side background colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable Side = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the menu side background colors for the items that were not recently used.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable SideUnused = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the menu border background colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable Border = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the menu side border.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable SideBorder = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the light menu side border.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable SideBorderLight = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background color blend for the special file menu background.
|
||||
/// </summary>
|
||||
public BackgroundColorBlendCollection FileBackgroundBlend = new BackgroundColorBlendCollection();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the two column container border color.
|
||||
/// </summary>
|
||||
public Color FileContainerBorder = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the two column container light border color.
|
||||
/// </summary>
|
||||
public Color FileContainerBorderLight = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background color of first file column.
|
||||
/// </summary>
|
||||
public Color FileColumnOneBackground = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the border color of first file column.
|
||||
/// </summary>
|
||||
public Color FileColumnOneBorder = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background color of first file column.
|
||||
/// </summary>
|
||||
public Color FileColumnTwoBackground = Color.Empty;
|
||||
|
||||
///// <summary>
|
||||
///// Gets or sets the border color of first file column.
|
||||
///// </summary>
|
||||
//public Color FileColumnTwoBorder = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background color blend for the bottom container on file menu.
|
||||
/// </summary>
|
||||
public BackgroundColorBlendCollection FileBottomContainerBackgroundBlend = new BackgroundColorBlendCollection();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the color table for the NavigationPane control.
|
||||
/// </summary>
|
||||
public class Office2007NavigationPaneColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the background color collection blend for the button background.
|
||||
/// </summary>
|
||||
public GradientColorTable ButtonBackground = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
internal class Office2007NavigationPanePainter : NavigationPanePainter, IOffice2007Painter
|
||||
{
|
||||
#region IOffice2007Painter
|
||||
private Office2007ColorTable m_ColorTable = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets color table used by renderer.
|
||||
/// </summary>
|
||||
public Office2007ColorTable ColorTable
|
||||
{
|
||||
get { return m_ColorTable; }
|
||||
set { m_ColorTable = value; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
public override void PaintButtonBackground(NavPaneRenderEventArgs e)
|
||||
{
|
||||
Graphics g = e.Graphics;
|
||||
Rectangle r = e.Bounds;
|
||||
Office2007NavigationPaneColorTable ct = m_ColorTable.NavigationPane;
|
||||
|
||||
using (Brush brush = DisplayHelp.CreateBrush(r, ct.ButtonBackground))
|
||||
{
|
||||
g.FillRectangle(brush, r);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines color table for the Office 2007 style ProgressBarItem.
|
||||
/// </summary>
|
||||
public class Office2007ProgressBarColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the background color collection blend for the item background.
|
||||
/// </summary>
|
||||
public GradientColorTable BackgroundColors = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the outer border color.
|
||||
/// </summary>
|
||||
public Color OuterBorder = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the inner border color.
|
||||
/// </summary>
|
||||
public Color InnerBorder = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color collection blend for the current progress part of the item.
|
||||
/// </summary>
|
||||
public GradientColorTable Chunk = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color collection blend for overlay for the current progress of the item.
|
||||
/// </summary>
|
||||
public GradientColorTable ChunkOverlay = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color collection blend of shadow for the current progress of the item.
|
||||
/// </summary>
|
||||
public GradientColorTable ChunkShadow = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
internal class Office2007ProgressBarItemPainter : ProgressBarItemPainter, IOffice2007Painter
|
||||
{
|
||||
#region IOffice2007Painter
|
||||
private Office2007ColorTable m_ColorTable = null; //new Office2007ColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets color table used by renderer.
|
||||
/// </summary>
|
||||
public Office2007ColorTable ColorTable
|
||||
{
|
||||
get { return m_ColorTable; }
|
||||
set { m_ColorTable = value; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Internal Implementation
|
||||
public override void Paint(ProgressBarItemRenderEventArgs e)
|
||||
{
|
||||
Rectangle r = e.ProgressBarItem.DisplayRectangle;
|
||||
if (r.Width <= 0 || r.Height <= 0)
|
||||
return;
|
||||
|
||||
ProgressBarItem item = e.ProgressBarItem;
|
||||
Office2007ProgressBarColorTable ct = m_ColorTable.ProgressBarItem;
|
||||
if(item.ColorTable == eProgressBarItemColor.Paused)
|
||||
ct = m_ColorTable.ProgressBarItemPaused;
|
||||
else if (item.ColorTable == eProgressBarItemColor.Error)
|
||||
ct = m_ColorTable.ProgressBarItemError;
|
||||
|
||||
Graphics g = e.Graphics;
|
||||
|
||||
SmoothingMode sm = g.SmoothingMode;
|
||||
g.SmoothingMode = SmoothingMode.Default;
|
||||
|
||||
if (StyleManager.IsMetro(item.EffectiveStyle))
|
||||
{
|
||||
DisplayHelp.DrawRectangle(g, ct.OuterBorder, r);
|
||||
}
|
||||
else
|
||||
DisplayHelp.DrawRoundedRectangle(g, ct.OuterBorder, r, 2);
|
||||
r.Inflate(-Dpi.Width1, -Dpi.Height1);
|
||||
|
||||
|
||||
Brush brush = DisplayHelp.CreateBrush(r, ct.BackgroundColors);
|
||||
if (brush != null)
|
||||
{
|
||||
g.FillRectangle(brush, r);
|
||||
brush.Dispose();
|
||||
}
|
||||
g.SmoothingMode = sm;
|
||||
if (!ct.InnerBorder.IsEmpty)
|
||||
DisplayHelp.DrawRoundedRectangle(g, ct.InnerBorder, r, 2);
|
||||
r.Inflate(-Dpi.Width1, -Dpi.Height1);
|
||||
|
||||
Region oldClip = g.Clip;
|
||||
try
|
||||
{
|
||||
g.SetClip(r, CombineMode.Intersect);
|
||||
|
||||
Rectangle chunkRect = r;
|
||||
if (item.ProgressType == eProgressItemType.Marquee)
|
||||
{
|
||||
// Horizontal
|
||||
if (item.Orientation == eOrientation.Horizontal)
|
||||
{
|
||||
chunkRect.Width = (int)(chunkRect.Width * .3);
|
||||
chunkRect.X += r.Width * item.MarqueeValue / 100 - (int)(chunkRect.Width / 2);
|
||||
}
|
||||
// Vertical
|
||||
else if (item.Orientation == eOrientation.Vertical)
|
||||
{
|
||||
chunkRect.Height = (int)(chunkRect.Height * .3);
|
||||
chunkRect.Y += r.Height * item.MarqueeValue / 100 - (int)(chunkRect.Height / 2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Horizontal
|
||||
if (item.Orientation == eOrientation.Horizontal)
|
||||
chunkRect.Width = (int)(chunkRect.Width * ((float)(item.Value - item.Minimum) / (float)(item.Maximum - item.Minimum)));
|
||||
// Vertical
|
||||
else if (item.Orientation == eOrientation.Vertical)
|
||||
{
|
||||
int height = (int)(chunkRect.Height * ((float)(item.Value - item.Minimum) / (float)(item.Maximum - item.Minimum)));
|
||||
chunkRect.Y = chunkRect.Bottom - height;
|
||||
chunkRect.Height = height;
|
||||
}
|
||||
}
|
||||
if (chunkRect.Width <= 0 || chunkRect.Height<=0) return;
|
||||
|
||||
brush = DisplayHelp.CreateBrush(chunkRect, ct.Chunk);
|
||||
if (brush != null)
|
||||
{
|
||||
g.SmoothingMode = SmoothingMode.None;
|
||||
g.FillRectangle(brush, chunkRect);
|
||||
brush.Dispose();
|
||||
g.SmoothingMode = sm;
|
||||
}
|
||||
GradientColorTable overlay = ct.ChunkOverlay;
|
||||
if (item.Orientation == eOrientation.Horizontal)
|
||||
overlay.LinearGradientAngle = 90;
|
||||
else
|
||||
overlay.LinearGradientAngle = 0;
|
||||
brush = DisplayHelp.CreateBrush(chunkRect, overlay);
|
||||
if (brush != null)
|
||||
{
|
||||
g.FillRectangle(brush, chunkRect);
|
||||
|
||||
if (item.ProgressType == eProgressItemType.Marquee)
|
||||
{
|
||||
// Horizontal
|
||||
if (item.Orientation == eOrientation.Horizontal && chunkRect.Right > r.Right + 4)
|
||||
chunkRect = new Rectangle(r.X, r.Y, chunkRect.Right - r.Right - 4, r.Height);
|
||||
// Vertical
|
||||
else if (item.Orientation == eOrientation.Vertical && chunkRect.Bottom > r.Bottom + 4)
|
||||
chunkRect = new Rectangle(r.X, r.Y, r.Height, chunkRect.Bottom - r.Bottom - 4);
|
||||
g.FillRectangle(brush, chunkRect);
|
||||
}
|
||||
|
||||
brush.Dispose();
|
||||
}
|
||||
// Horizontal
|
||||
if (item.Orientation == eOrientation.Horizontal && chunkRect.Right + 4 <= r.Right)
|
||||
{
|
||||
chunkRect.X = chunkRect.Right;
|
||||
chunkRect.Width = 4;
|
||||
brush = DisplayHelp.CreateBrush(chunkRect, ct.ChunkShadow);
|
||||
if (brush != null)
|
||||
{
|
||||
g.FillRectangle(brush, chunkRect);
|
||||
brush.Dispose();
|
||||
}
|
||||
}
|
||||
// Vertical
|
||||
else if (item.Orientation == eOrientation.Vertical && chunkRect.Y - 3 >= r.Y)
|
||||
{
|
||||
chunkRect.Y = chunkRect.Y - 3;
|
||||
chunkRect.Height = 3;
|
||||
brush = DisplayHelp.CreateBrush(chunkRect, ct.ChunkShadow.Colors, ct.ChunkShadow.LinearGradientAngle-90, ct.ChunkShadow.GradientType);
|
||||
if (brush != null)
|
||||
{
|
||||
g.FillRectangle(brush, chunkRect);
|
||||
brush.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
g.Clip = oldClip;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines painter for the Office 2007 style QAT Customize Item.
|
||||
/// </summary>
|
||||
internal class Office2007QatCustomizeItemPainter : QatCustomizeItemPainter, IOffice2007Painter
|
||||
{
|
||||
#region IOffice2007Painter
|
||||
private Office2007ColorTable m_ColorTable = null; //new Office2007ColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets color table used by renderer.
|
||||
/// </summary>
|
||||
public Office2007ColorTable ColorTable
|
||||
{
|
||||
get { return m_ColorTable; }
|
||||
set { m_ColorTable = value; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Internal Implementation
|
||||
public override void Paint(QatCustomizeItemRendererEventArgs e)
|
||||
{
|
||||
Graphics g = e.Graphics;
|
||||
QatCustomizeItem item = e.CustomizeItem;
|
||||
Rectangle r = item.DisplayRectangle;
|
||||
Region oldClip = null;
|
||||
if (g.Clip != null) oldClip = g.Clip as Region;
|
||||
g.SetClip(item.DisplayRectangle, CombineMode.Intersect);
|
||||
|
||||
|
||||
Office2007ButtonItemColorTable buttonColorTable = GetColorTable();
|
||||
Office2007ButtonItemStateColorTable state = buttonColorTable.Default;
|
||||
|
||||
if (item.Expanded)
|
||||
state = buttonColorTable.Expanded;
|
||||
else if (item.IsMouseOver)
|
||||
state = buttonColorTable.MouseOver;
|
||||
|
||||
if(StyleManager.IsMetro(item.EffectiveStyle))
|
||||
Office2007ButtonItemPainter.PaintBackground(g, state, r, RoundRectangleShapeDescriptor.RectangleShape);
|
||||
else
|
||||
Office2007ButtonItemPainter.PaintBackground(g, state, r, RoundRectangleShapeDescriptor.RoundCorner2);
|
||||
|
||||
SmoothingMode sm = g.SmoothingMode;
|
||||
g.SmoothingMode = SmoothingMode.Default;
|
||||
|
||||
Color color = state.ExpandBackground;
|
||||
Color colorLight = state.ExpandLight;
|
||||
|
||||
Presentation.Shape shape = new Presentation.Shape();
|
||||
Presentation.ShapeBorder bl = new Presentation.ShapeBorder(colorLight, 1);
|
||||
Presentation.ShapeBorder b = new Presentation.ShapeBorder(color, 1);
|
||||
shape.Children.Add(new Presentation.Line(new Presentation.Location(0, 0), new Presentation.Location(Dpi.Width4, 0), b));
|
||||
shape.Children.Add(new Presentation.Line(new Presentation.Location(0, Dpi.Height1), new Presentation.Location(Dpi.Width4, Dpi.Height1), bl));
|
||||
|
||||
shape.Children.Add(new Presentation.Line(new Presentation.Location(0, Dpi.Height3), new Presentation.Location(Dpi.Width4, Dpi.Height3), b));
|
||||
shape.Children.Add(new Presentation.Line(new Presentation.Location(Dpi.Width4, Dpi.Height3), new Presentation.Location(Dpi.Width2, Dpi.Height5), b));
|
||||
shape.Children.Add(new Presentation.Line(new Presentation.Location(Dpi.Width2, Dpi.Height5), new Presentation.Location(0, Dpi.Height3), b));
|
||||
shape.Children.Add(new Presentation.Line(new Presentation.Location(Dpi.Width1, Dpi.Height4), new Presentation.Location(Dpi.Width3, Dpi.Height4), b));
|
||||
shape.Children.Add(new Presentation.Line(new Presentation.Location(Dpi.Width4, Dpi.Height4), new Presentation.Location(Dpi.Width2, Dpi.Height6), bl));
|
||||
shape.Children.Add(new Presentation.Line(new Presentation.Location(Dpi.Width2, Dpi.Height6), new Presentation.Location(0, Dpi.Height4), bl));
|
||||
|
||||
Rectangle sr = new Rectangle(r.X + (r.Width - Dpi.Width5) / 2, r.Y + (r.Height - Dpi.Height7) / 2, Dpi.Width5, Dpi.Height7);
|
||||
Presentation.ShapePaintInfo pi = new Presentation.ShapePaintInfo(g, sr);
|
||||
shape.Paint(pi);
|
||||
|
||||
g.SmoothingMode = sm;
|
||||
|
||||
if (oldClip != null)
|
||||
{
|
||||
g.Clip = oldClip;
|
||||
oldClip.Dispose();
|
||||
}
|
||||
else
|
||||
g.ResetClip();
|
||||
}
|
||||
|
||||
protected virtual Office2007ButtonItemColorTable GetColorTable()
|
||||
{
|
||||
Office2007ColorTable colorTable = this.ColorTable;
|
||||
Office2007ButtonItemColorTable buttonColorTable = null;
|
||||
|
||||
eButtonColor color = eButtonColor.Orange;
|
||||
buttonColorTable = colorTable.ButtonItemColors[Enum.GetName(typeof(eButtonColor), color)];
|
||||
|
||||
if (buttonColorTable == null)
|
||||
return colorTable.ButtonItemColors[0];
|
||||
|
||||
return buttonColorTable;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines Office 2007 style QAT painter.
|
||||
/// </summary>
|
||||
internal class Office2007QatOverflowPainter : QatOverflowPainter, IOffice2007Painter
|
||||
{
|
||||
#region IOffice2007Painter
|
||||
private Office2007ColorTable m_ColorTable = null; //new Office2007ColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets color table used by renderer.
|
||||
/// </summary>
|
||||
public Office2007ColorTable ColorTable
|
||||
{
|
||||
get { return m_ColorTable; }
|
||||
set { m_ColorTable = value; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Internal Implementation
|
||||
public override void Paint(QatOverflowItemRendererEventArgs e)
|
||||
{
|
||||
Graphics g = e.Graphics;
|
||||
QatOverflowItem item = e.OverflowItem;
|
||||
Rectangle r = item.DisplayRectangle;
|
||||
Region oldClip = null;
|
||||
if(g.Clip!=null) oldClip = g.Clip.Clone() as Region;
|
||||
g.SetClip(item.DisplayRectangle, CombineMode.Intersect);
|
||||
|
||||
|
||||
Office2007ButtonItemColorTable buttonColorTable = GetColorTable();
|
||||
Office2007ButtonItemStateColorTable state = buttonColorTable.Default;
|
||||
|
||||
if (item.Expanded)
|
||||
state = buttonColorTable.Expanded;
|
||||
else if (item.IsMouseOver)
|
||||
state = buttonColorTable.MouseOver;
|
||||
|
||||
Office2007ButtonItemPainter.PaintBackground(g, state, r, RoundRectangleShapeDescriptor.RoundCorner2);
|
||||
|
||||
SmoothingMode sm = g.SmoothingMode;
|
||||
g.SmoothingMode = SmoothingMode.Default;
|
||||
|
||||
Color color = state.ExpandBackground;
|
||||
Color colorLight = state.ExpandLight;
|
||||
|
||||
Presentation.Shape shape = new Presentation.Shape();
|
||||
Presentation.ShapeBorder bl = new Presentation.ShapeBorder(colorLight, 1);
|
||||
Presentation.ShapeBorder b = new Presentation.ShapeBorder(color, 1);
|
||||
shape.Children.Add(new Presentation.Line(new Presentation.Location(0, 0), new Presentation.Location(2, 2), bl));
|
||||
shape.Children.Add(new Presentation.Line(new Presentation.Location(2, 2), new Presentation.Location(0, 4), bl));
|
||||
shape.Children.Add(new Presentation.Line(new Presentation.Location(0, 1), new Presentation.Location(1, 2), b));
|
||||
shape.Children.Add(new Presentation.Line(new Presentation.Location(1, 2), new Presentation.Location(0, 3), b));
|
||||
shape.Children.Add(new Presentation.Line(new Presentation.Location(0, 3), new Presentation.Location(0, 1), b));
|
||||
|
||||
Rectangle sr = new Rectangle(r.X + (r.Width - 5)/2, r.Y + (r.Height - 4) / 2, 3, 6);
|
||||
Presentation.ShapePaintInfo pi = new Presentation.ShapePaintInfo(g, sr);
|
||||
shape.Paint(pi);
|
||||
sr.Offset(4, 0);
|
||||
pi.Bounds = sr;
|
||||
shape.Paint(pi);
|
||||
g.SmoothingMode = sm;
|
||||
|
||||
if (oldClip != null)
|
||||
g.Clip = oldClip;
|
||||
else
|
||||
g.ResetClip();
|
||||
}
|
||||
|
||||
protected virtual Office2007ButtonItemColorTable GetColorTable()
|
||||
{
|
||||
Office2007ColorTable colorTable = this.ColorTable;
|
||||
Office2007ButtonItemColorTable buttonColorTable = null;
|
||||
|
||||
eButtonColor color = eButtonColor.Orange;
|
||||
buttonColorTable = colorTable.ButtonItemColors[Enum.GetName(typeof(eButtonColor), color)];
|
||||
|
||||
if (buttonColorTable == null)
|
||||
return colorTable.ButtonItemColors[0];
|
||||
|
||||
return buttonColorTable;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the color table for the quick access toolbar in all states.
|
||||
/// </summary>
|
||||
public class Office2007QuickAccessToolbarColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the quick access toolbar background when hosted in ribbon control caption and form is active
|
||||
/// or the background colors when toolbar is hosted below the ribbon control.
|
||||
/// </summary>
|
||||
public Office2007QuickAccessToolbarStateColorTable Active = new Office2007QuickAccessToolbarStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the quick access toolbar background when hosted in ribbon control caption and form is inactive
|
||||
/// </summary>
|
||||
public Office2007QuickAccessToolbarStateColorTable Inactive = new Office2007QuickAccessToolbarStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the quick access toolbar background when positioned below the ribbon bar.
|
||||
/// </summary>
|
||||
public Office2007QuickAccessToolbarStateColorTable Standalone = new Office2007QuickAccessToolbarStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background color of Customize Quick Access Toolbar menu label displayed on customize quick access toolbar menu.
|
||||
/// </summary>
|
||||
public Color QatCustomizeMenuLabelBackground = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the text color of Customize Quick Access Toolbar menu label displayed on customize quick access toolbar menu.
|
||||
/// </summary>
|
||||
public Color QatCustomizeMenuLabelText = Color.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the color table for the Quick Access toolbar.
|
||||
/// </summary>
|
||||
public class Office2007QuickAccessToolbarStateColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the colors of the top background.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable TopBackground = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors of the bottom background.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable BottomBackground = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the outer border color.
|
||||
/// </summary>
|
||||
public Color OutterBorderColor = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the middle border color.
|
||||
/// </summary>
|
||||
public Color MiddleBorderColor = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the inner border color.
|
||||
/// </summary>
|
||||
public Color InnerBorderColor = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the border when Windows Vista Glass is enabled.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable GlassBorder = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,805 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using DevComponents.DotNetBar.Controls;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents Office 2007 Control renderer.
|
||||
/// </summary>
|
||||
public class Office2007Renderer : BaseRenderer
|
||||
{
|
||||
#region Events
|
||||
/// <summary>
|
||||
/// Occurs when color table is changed by setting the ColorTable property on the renderer.
|
||||
/// </summary>
|
||||
public event EventHandler ColorTableChanged;
|
||||
#endregion
|
||||
|
||||
#region Private Variables
|
||||
//private Office12ColorTable m_ColorTable12 = null;
|
||||
private Office2007ColorTable m_ColorTable = null;
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
public Office2007Renderer()
|
||||
{
|
||||
//m_ColorTable12 = new Office12ColorTable();
|
||||
m_ColorTable = new Office2007ColorTable();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// Gets or sets color table used by renderer.
|
||||
/// </summary>
|
||||
public Office2007ColorTable ColorTable
|
||||
{
|
||||
get { return m_ColorTable; }
|
||||
set
|
||||
{
|
||||
m_ColorTable = value;
|
||||
if (ColorTableChanged != null)
|
||||
ColorTableChanged(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Key Tips Rendering
|
||||
/// <summary>
|
||||
/// Draws KeyTip for an object. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderKeyTips method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawKeyTips(KeyTipsRendererEventArgs e)
|
||||
{
|
||||
KeyTipsPainter painter = PainterFactory.CreateKeyTipsPainter();
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
painter.PaintKeyTips(e);
|
||||
|
||||
base.DrawKeyTips(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Rendering Tab Group Rendering
|
||||
/// <summary>
|
||||
/// Draws ribbon tab group. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderRibbonTabGroup method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawRibbonTabGroup(RibbonTabGroupRendererEventArgs e)
|
||||
{
|
||||
RibbonTabGroupPainter painter = PainterFactory.CreateRibbonTabGroupPainter(e.EffectiveStyle);
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
painter.PaintTabGroup(e);
|
||||
|
||||
base.DrawRibbonTabGroup(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ItemContainer Rendering
|
||||
/// <summary>
|
||||
/// Draws item container. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderItemContainer method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawItemContainer(ItemContainerRendererEventArgs e)
|
||||
{
|
||||
ItemContainerPainter painter = PainterFactory.CreateItemContainerPainter(e.ItemContainer);
|
||||
if (painter != null)
|
||||
{
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
painter.PaintBackground(e);
|
||||
}
|
||||
|
||||
base.DrawItemContainer(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the separator for an item inside of item container. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderItemContainerSeparator method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawItemContainerSeparator(ItemContainerSeparatorRendererEventArgs e)
|
||||
{
|
||||
base.DrawItemContainerSeparator(e);
|
||||
|
||||
ItemContainerPainter painter = PainterFactory.CreateItemContainerPainter(e.ItemContainer);
|
||||
if (painter != null)
|
||||
{
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
painter.PaintItemSeparator(e);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ButtonItem Rendering
|
||||
/// <summary>
|
||||
/// Draws ButtonItem. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderButtonItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawButtonItem(ButtonItemRendererEventArgs e)
|
||||
{
|
||||
ButtonItemPainter painter = PainterFactory.CreateButtonPainter(e.ButtonItem);
|
||||
if (painter != null)
|
||||
{
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
painter.PaintButton(e.ButtonItem, e.ItemPaintArgs);
|
||||
}
|
||||
|
||||
base.DrawButtonItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region RibbonTabItem Rendering
|
||||
/// <summary>
|
||||
/// Draws RibbonTabItem. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderRibbonTabItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawRibbonTabItem(RibbonTabItemRendererEventArgs e)
|
||||
{
|
||||
ButtonItemPainter painter = PainterFactory.CreateRibbonTabItemPainter(e.RibbonTabItem);
|
||||
if (painter != null)
|
||||
{
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
painter.PaintButton(e.RibbonTabItem, e.ItemPaintArgs);
|
||||
}
|
||||
|
||||
base.DrawRibbonTabItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Popup Toolbar Rendering
|
||||
/// <summary>
|
||||
/// Draws popup toolbar background. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderPopupToolbarBackground method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawPopupToolbarBackground(ToolbarRendererEventArgs e)
|
||||
{
|
||||
BarBackgroundPainter painter = PainterFactory.CreateBarBackgroundPainter(e.Bar);
|
||||
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
painter.PaintPopupBackground(e);
|
||||
|
||||
base.DrawPopupToolbarBackground(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Docked or Floating Toolbar Rendering
|
||||
/// <summary>
|
||||
/// Draws docked or floating toolbar background. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderToolbarBackground method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawToolbarBackground(ToolbarRendererEventArgs e)
|
||||
{
|
||||
BarBackgroundPainter painter = PainterFactory.CreateBarBackgroundPainter(e.Bar);
|
||||
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
if (e.Bar.BarState == eBarState.Docked)
|
||||
painter.PaintDockedBackground(e);
|
||||
else if (e.Bar.BarState == eBarState.Floating)
|
||||
painter.PaintFloatingBackground(e);
|
||||
|
||||
base.DrawToolbarBackground(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws floating toolbar background.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
protected virtual void DrawFloatingToolbarBackground(ToolbarRendererEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Ribbon Rendering
|
||||
/// <summary>
|
||||
/// Draws ribbon bar dialog launcher button. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderPopupToolbarBackground method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawRibbonDialogLauncher(RibbonBarRendererEventArgs e)
|
||||
{
|
||||
DialogLauncherPainter painter = PainterFactory.CreateRibbonBarPainter(e.RibbonBar);
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
painter.PaintDialogLauncher(e);
|
||||
|
||||
base.DrawRibbonDialogLauncher(e);
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Draws ribbon bar background. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
///// do not want default rendering to occur do not call the base implementation. You can call OnRenderRibbonBarBackground method so events can occur.
|
||||
///// </summary>
|
||||
///// <param name="e">Provides context information.</param>
|
||||
//public override void DrawRibbonBarBackground(RibbonBarRendererEventArgs e)
|
||||
//{
|
||||
// base.DrawRibbonBarBackground(e);
|
||||
|
||||
// RibbonBarPainter painter = PainterFactory.CreateRibbonBarPainter(e.RibbonBar);
|
||||
// if (painter is IOffice2007Painter)
|
||||
// ((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
// else if (painter is IOffice12Painter)
|
||||
// ((IOffice12Painter)painter).ColorTable = m_ColorTable12;
|
||||
// painter.PaintBackground(e);
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Draws ribbon bar title. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
///// do not want default rendering to occur do not call the base implementation. You can call OnRenderRibbonBarTitle method so events can occur.
|
||||
///// </summary>
|
||||
///// <param name="e">Provides context information.</param>
|
||||
//public override void DrawRibbonBarTitle(RibbonBarRendererEventArgs e)
|
||||
//{
|
||||
// base.DrawRibbonBarTitle(e);
|
||||
|
||||
// RibbonBarPainter painter = PainterFactory.CreateRibbonBarPainter(e.RibbonBar);
|
||||
// if (painter is IOffice2007Painter)
|
||||
// ((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
// else if (painter is IOffice12Painter)
|
||||
// ((IOffice12Painter)painter).ColorTable = m_ColorTable12;
|
||||
// painter.PaintTitle(e);
|
||||
//}
|
||||
#endregion
|
||||
|
||||
#region ColorItem rendering
|
||||
/// <summary>
|
||||
/// Draws ColorItem. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderColorItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawColorItem(ColorItemRendererEventArgs e)
|
||||
{
|
||||
Rendering.ColorItemPainter painter = PainterFactory.CreateColorItemPainter(e.ColorItem);
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
painter.PaintColorItem(e);
|
||||
|
||||
base.DrawColorItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Ribbon Control Rendering
|
||||
/// <summary>
|
||||
/// Draws the background of the Ribbon Control. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderRibbonControlBackground method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawRibbonControlBackground(RibbonControlRendererEventArgs e)
|
||||
{
|
||||
RibbonControlPainter painter = PainterFactory.CreateRibbonControlPainter(e.RibbonControl);
|
||||
if (painter == null)
|
||||
return;
|
||||
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
painter.PaintBackground(e);
|
||||
|
||||
base.DrawRibbonControlBackground(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the form caption text for the Ribbon Control. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderRibbonFormCaptionText method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawRibbonFormCaptionText(RibbonControlRendererEventArgs e)
|
||||
{
|
||||
base.DrawRibbonFormCaptionText(e);
|
||||
|
||||
RibbonControlPainter painter = PainterFactory.CreateRibbonControlPainter(e.RibbonControl);
|
||||
if (painter == null)
|
||||
return;
|
||||
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
painter.PaintCaptionText(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the background of Quick Access Toolbar on Ribbon Control. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderQuickAccessToolbarBackground method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawQuickAccessToolbarBackground(RibbonControlRendererEventArgs e)
|
||||
{
|
||||
base.DrawQuickAccessToolbarBackground(e);
|
||||
|
||||
RibbonControlPainter painter = PainterFactory.CreateRibbonControlPainter(e.RibbonControl);
|
||||
if (painter == null)
|
||||
return;
|
||||
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
painter.PaintQuickAccessToolbarBackground(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region SystemCaptionItem Rendering
|
||||
/// <summary>
|
||||
/// Draws the SystemCaptionItem. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderSystemCaptionItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawSystemCaptionItem(SystemCaptionItemRendererEventArgs e)
|
||||
{
|
||||
SystemCaptionItemPainter painter = PainterFactory.CreateSystemCaptionItemPainter(e.SystemCaptionItem);
|
||||
|
||||
if (painter == null)
|
||||
return;
|
||||
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
painter.Paint(e);
|
||||
|
||||
base.DrawSystemCaptionItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region MdiSystemItem Rendering
|
||||
/// <summary>
|
||||
/// Draws the MdiSystemItem. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderMdiSystemItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawMdiSystemItem(MdiSystemItemRendererEventArgs e)
|
||||
{
|
||||
MdiSystemItemPainter painter = PainterFactory.CreateMdiSystemItemPainter(e.MdiSystemItem);
|
||||
|
||||
if (painter == null)
|
||||
return;
|
||||
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
painter.Paint(e);
|
||||
|
||||
base.DrawMdiSystemItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Form Caption
|
||||
/// <summary>
|
||||
/// Draws the form caption background. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderFormCaptionBackground method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawFormCaptionBackground(FormCaptionRendererEventArgs e)
|
||||
{
|
||||
FormCaptionPainter painter = PainterFactory.CreateFormCaptionPainter(e.Form);
|
||||
|
||||
if (painter == null)
|
||||
return;
|
||||
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
painter.PaintCaptionBackground(e);
|
||||
|
||||
base.DrawFormCaptionBackground(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region QAT Overflow/Customize Item rendering
|
||||
/// <summary>
|
||||
/// Draws the Quick Access Toolbar Overflow item. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderQatOverflowItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawQatOverflowItem(QatOverflowItemRendererEventArgs e)
|
||||
{
|
||||
QatOverflowPainter painter = PainterFactory.CreateQatOverflowItemPainter(e.OverflowItem);
|
||||
|
||||
if (painter == null)
|
||||
return;
|
||||
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
painter.Paint(e);
|
||||
|
||||
base.DrawQatOverflowItem(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the Quick Access Toolbar Overflow item. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderQatOverflowItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawQatCustomizeItem(QatCustomizeItemRendererEventArgs e)
|
||||
{
|
||||
QatCustomizeItemPainter painter = PainterFactory.CreateQatCustomizeItemPainter(e.CustomizeItem);
|
||||
|
||||
if (painter == null)
|
||||
return;
|
||||
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
painter.Paint(e);
|
||||
|
||||
base.DrawQatCustomizeItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region CheckBoxItem
|
||||
public override void DrawCheckBoxItem(CheckBoxItemRenderEventArgs e)
|
||||
{
|
||||
CheckBoxItemPainter painter = PainterFactory.CreateCheckBoxItemPainter(e.CheckBoxItem);
|
||||
|
||||
if (painter == null)
|
||||
return;
|
||||
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
painter.Paint(e);
|
||||
|
||||
base.DrawCheckBoxItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ProgressBarItem
|
||||
/// <summary>
|
||||
/// Draws the ProgressBarItem. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderProgressBarItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawProgressBarItem(ProgressBarItemRenderEventArgs e)
|
||||
{
|
||||
ProgressBarItemPainter painter = PainterFactory.CreateProgressBarItemPainter(e.ProgressBarItem);
|
||||
|
||||
if (painter == null)
|
||||
return;
|
||||
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
painter.Paint(e);
|
||||
|
||||
base.DrawProgressBarItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Navigation Pane
|
||||
/// <summary>
|
||||
/// Draws the Navigation Pane button background. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderNavPaneButtonBackground method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawNavPaneButtonBackground(NavPaneRenderEventArgs e)
|
||||
{
|
||||
NavigationPanePainter painter = PainterFactory.CreateNavigationPanePainter();
|
||||
|
||||
if (painter == null)
|
||||
return;
|
||||
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
painter.PaintButtonBackground(e);
|
||||
|
||||
|
||||
base.DrawNavPaneButtonBackground(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region SliderItem
|
||||
/// <summary>
|
||||
/// Draws the Slider item. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderSliderItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawSliderItem(SliderItemRendererEventArgs e)
|
||||
{
|
||||
SliderPainter painter = PainterFactory.CreateSliderPainter(e.SliderItem);
|
||||
|
||||
if (painter == null)
|
||||
return;
|
||||
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
painter.Paint(e);
|
||||
|
||||
base.DrawSliderItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region SideBar
|
||||
/// <summary>
|
||||
/// Draws the SideBar control. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderSideBar method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawSideBar(SideBarRendererEventArgs e)
|
||||
{
|
||||
SideBarPainter painter = PainterFactory.CreateSideBarPainter();
|
||||
|
||||
if (painter == null)
|
||||
return;
|
||||
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
painter.PaintSideBar(e);
|
||||
|
||||
base.DrawSideBar(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the SideBar control. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderSideBarPanelItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawSideBarPanelItem(SideBarPanelItemRendererEventArgs e)
|
||||
{
|
||||
SideBarPainter painter = PainterFactory.CreateSideBarPainter();
|
||||
|
||||
if (painter == null)
|
||||
return;
|
||||
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
painter.PaintSideBarPanelItem(e);
|
||||
|
||||
base.DrawSideBarPanelItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region CrumbBar
|
||||
/// <summary>
|
||||
/// Draws CrumbBarItemView. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderButtonItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawCrumbBarItemView(ButtonItemRendererEventArgs e)
|
||||
{
|
||||
CrumbBarItemViewPainter painter = PainterFactory.GetCrumbBarItemViewPainter(e.ButtonItem);
|
||||
if (painter != null)
|
||||
{
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
painter.Paint(e.ButtonItem, e.ItemPaintArgs);
|
||||
}
|
||||
|
||||
base.DrawCrumbBarItemView(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws CrumbBarOverflowButton. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderCrumbBarOverflowItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawCrumbBarOverflowItem(ButtonItemRendererEventArgs e)
|
||||
{
|
||||
CrumbBarItemViewPainter painter = PainterFactory.GetCrumbBarItemViewPainter(e.ButtonItem);
|
||||
if (painter != null)
|
||||
{
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
painter.PaintOverflowButton(e.ButtonItem, e.ItemPaintArgs);
|
||||
}
|
||||
base.DrawCrumbBarOverflowItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region SwitchButton
|
||||
/// <summary>
|
||||
/// Draws SwitchButton. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderButtonItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawSwitchButton(SwitchButtonRenderEventArgs e)
|
||||
{
|
||||
SwitchButtonPainter painter = PainterFactory.CreateSwitchButtonPainter(e.SwitchButtonItem);
|
||||
if (painter != null)
|
||||
{
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
painter.Paint(e);
|
||||
}
|
||||
|
||||
base.DrawSwitchButton(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region RangeSliderItem
|
||||
/// <summary>
|
||||
/// Draws the Slider item. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderSliderItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawRangeSliderItem(RangeSliderItemRendererEventArgs e)
|
||||
{
|
||||
RangeSliderPainter painter = PainterFactory.CreateRangeSliderPainter(e.SliderItem);
|
||||
|
||||
if (painter == null)
|
||||
return;
|
||||
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
painter.Paint(e);
|
||||
|
||||
base.DrawRangeSliderItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region StepItem
|
||||
/// <summary>
|
||||
/// Draws the Step item. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderStepItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawStepItem(StepItemRendererEventArgs e)
|
||||
{
|
||||
StepItemPainter painter = PainterFactory.CreateStepItemPainter(e.Item);
|
||||
|
||||
if (painter == null)
|
||||
return;
|
||||
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
painter.Paint(e);
|
||||
|
||||
base.DrawStepItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ListBoxItem
|
||||
/// <summary>
|
||||
/// Draws the ListBoxItem. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderListBoxItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawListBoxItem(ListBoxItemRendererEventArgs e)
|
||||
{
|
||||
ListBoxItemPainter painter = PainterFactory.CreateListBoxItemPainter(e.Item);
|
||||
|
||||
if (painter == null)
|
||||
return;
|
||||
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
painter.Paint(e);
|
||||
|
||||
base.DrawListBoxItem(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region SideNavItem
|
||||
/// <summary>
|
||||
/// Draws the ListBoxItem. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderListBoxItem method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawSideNavItem(SideNavItemRendererEventArgs e)
|
||||
{
|
||||
base.DrawSideNavItem(e);
|
||||
if (e.Cancel) return;
|
||||
|
||||
SideNavItemPainter painter = PainterFactory.CreateSideNavItemPainter(e.Item);
|
||||
|
||||
if (painter == null)
|
||||
return;
|
||||
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
painter.Paint(e);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region TabStrip
|
||||
|
||||
/// <summary>
|
||||
/// Draws the TabStrip. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderTabFormStrip method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawTabFormStrip(TabFormStripPainterArgs e)
|
||||
{
|
||||
base.DrawTabFormStrip(e);
|
||||
if (e.Cancel) return;
|
||||
|
||||
TabFormStripPainter painter = PainterFactory.CreateTabFormStripPainter(e.TabFormStrip);
|
||||
if (painter == null)
|
||||
return;
|
||||
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
|
||||
painter.Paint(e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region TabFormItem
|
||||
/// <summary>
|
||||
/// Draws the TabStrip. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderTabFormStrip method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawTabFormItem(ButtonItemRendererEventArgs e)
|
||||
{
|
||||
base.DrawTabFormItem(e);
|
||||
if (e.Cancel) return;
|
||||
|
||||
ButtonItemPainter painter = PainterFactory.CreateButtonPainter(e.ButtonItem);
|
||||
if (painter != null)
|
||||
{
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
painter.PaintButton(e.ButtonItem, e.ItemPaintArgs);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region NewTabFormItem
|
||||
/// <summary>
|
||||
/// Draws the TabStrip. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderTabFormStrip method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawNewTabFormItem(ButtonItemRendererEventArgs e)
|
||||
{
|
||||
base.DrawNewTabFormItem(e);
|
||||
if (e.Cancel) return;
|
||||
|
||||
ButtonItemPainter painter = PainterFactory.CreateButtonPainter(e.ButtonItem);
|
||||
if (painter != null)
|
||||
{
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
painter.PaintButton(e.ButtonItem, e.ItemPaintArgs);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region TabParentForm
|
||||
|
||||
/// <summary>
|
||||
/// Draws the TabParentForm. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
|
||||
/// do not want default rendering to occur do not call the base implementation. You can call OnRenderTabParentForm method so events can occur.
|
||||
/// </summary>
|
||||
/// <param name="e">Provides context information.</param>
|
||||
public override void DrawTabParentForm(TabFormPainterArgs e)
|
||||
{
|
||||
base.DrawTabParentForm(e);
|
||||
if (e.Cancel) return;
|
||||
|
||||
TabFormPainter painter = PainterFactory.CreateTabFormPainter(e.TabParentForm);
|
||||
if (painter is IOffice2007Painter)
|
||||
((IOffice2007Painter)painter).ColorTable = m_ColorTable;
|
||||
painter.Paint(e);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines color table for RibbonBar in various states.
|
||||
/// </summary>
|
||||
public class Office2007RibbonBarColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the default RibbonBar state.
|
||||
/// </summary>
|
||||
public Office2007RibbonBarStateColorTable Default = new Office2007RibbonBarStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for RibbonBar when mouse is over the control.
|
||||
/// </summary>
|
||||
public Office2007RibbonBarStateColorTable MouseOver = new Office2007RibbonBarStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for RibbonBar when ribbon bar is in overflow state and expanded to show all the items.
|
||||
/// </summary>
|
||||
public Office2007RibbonBarStateColorTable Expanded = new Office2007RibbonBarStateColorTable();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the color table of RibbonBar for Office 2007 style. Default values represent blue Luna theme.
|
||||
/// </summary>
|
||||
public class Office2007RibbonBarStateColorTable
|
||||
{
|
||||
#region Color Definition
|
||||
/// <summary>
|
||||
/// Gets or sets the height in pixels of top background part.
|
||||
/// </summary>
|
||||
public float TopBackgroundHeight = 15;
|
||||
/// <summary>
|
||||
/// Gets or sets the outer border colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable OuterBorder = new LinearGradientColorTable(0xC6D2DF, 0x9FC1DB);
|
||||
/// <summary>
|
||||
/// Gets or sets the inner border colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable InnerBorder = new LinearGradientColorTable(0xEFF4FA, 0xF3F9FF);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the top background colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable TopBackground = new LinearGradientColorTable(0xDEE8F5, 0xD1DFF0);
|
||||
/// <summary>
|
||||
/// Gets or sets the bottom background colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable BottomBackground = new LinearGradientColorTable(0xC7D8ED, 0xE7F2FF);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the title background colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable TitleBackground = new LinearGradientColorTable(0xC2D9F1, 0xC1D9F0);
|
||||
/// <summary>
|
||||
/// Gets or sets the color of title text.
|
||||
/// </summary>
|
||||
public Color TitleText = ColorScheme.GetColor(0x3E6AAA);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines color table for Ribbon Control.
|
||||
/// </summary>
|
||||
public class Office2007RibbonColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the outer border.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable OuterBorder = new LinearGradientColorTable(ColorScheme.GetColor("8DB2E3"), ColorScheme.GetColor("88A1C2"));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the inner border.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable InnerBorder = new LinearGradientColorTable(ColorScheme.GetColor("E7EFF8"), ColorScheme.GetColor("C0F9FF"));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the tabs background area.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable TabsBackground = new LinearGradientColorTable(ColorScheme.GetColor("BFDBFF"), Color.Empty);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the tabs background area when Windows Glass is enabled.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable TabsGlassBackground = new LinearGradientColorTable(ColorScheme.GetColor("BFDBFF"), Color.Empty);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color of border which is drawn above the tab.
|
||||
/// </summary>
|
||||
public Color TabDividerBorder = ColorScheme.GetColor("AECAF0");
|
||||
/// <summary>
|
||||
/// Gets or sets the light color of border which is drawn above the tab.
|
||||
/// </summary>
|
||||
public Color TabDividerBorderLight = ColorScheme.GetColor("D4E3F5");
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the round corner size for the ribbon control parts.
|
||||
/// </summary>
|
||||
public int CornerSize = 3;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the height in pixels of top background part.
|
||||
/// </summary>
|
||||
public float PanelTopBackgroundHeight = 15;
|
||||
/// <summary>
|
||||
/// Gets or sets the top background colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable PanelTopBackground = new LinearGradientColorTable(ColorScheme.GetColor("DBE6F4"), ColorScheme.GetColor("CFDDEF"));
|
||||
/// <summary>
|
||||
/// Gets or sets the bottom background colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable PanelBottomBackground = new LinearGradientColorTable(ColorScheme.GetColor("C9D9ED"), ColorScheme.GetColor("E7F2FF"));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background image used on Office 2007 style start button displayed in top-left corner of ribbon control.
|
||||
/// Note that image assigned to all StartButton properties must be the same size. The size for the button will be determined by image
|
||||
/// size set on this property.
|
||||
/// </summary>
|
||||
public Image StartButtonDefault = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the background image used on Office 2007 style start button displayed in top-left corner of ribbon control when mouse is over the button.
|
||||
/// </summary>
|
||||
public Image StartButtonMouseOver = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the background image used on Office 2007 style start button displayed in top-left corner of ribbon control when button is pressed.
|
||||
/// </summary>
|
||||
public Image StartButtonPressed = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents painter for Office 2007 style ribbon overflow button.
|
||||
/// </summary>
|
||||
internal class Office2007RibbonOverflowPainter : Office2007ButtonItemPainter
|
||||
{
|
||||
public override Rectangle GetImageRectangle(ButtonItem button, ItemPaintArgs pa, CompositeImage image)
|
||||
{
|
||||
Rectangle imageRect = Rectangle.Empty;
|
||||
bool isOnMenu = IsOnMenu(button, pa);
|
||||
|
||||
// Calculate image position
|
||||
if (image != null)
|
||||
{
|
||||
imageRect.Width = image.Width + 16;
|
||||
imageRect.Height = image.Height + 16;
|
||||
imageRect.X = button.DisplayRectangle.X + (button.DisplayRectangle.Width - imageRect.Width) / 2;
|
||||
imageRect.Y = button.DisplayRectangle.Y + 3;
|
||||
}
|
||||
|
||||
return imageRect;
|
||||
}
|
||||
|
||||
public override void PaintButtonImage(ButtonItem button, ItemPaintArgs pa, CompositeImage image, Rectangle imagebounds)
|
||||
{
|
||||
if (imagebounds.Width <= 0 || imagebounds.Height <= 0) return;
|
||||
|
||||
// Paint image background
|
||||
RibbonOverflowButtonItem overflow = button as RibbonOverflowButtonItem;
|
||||
if (overflow == null || overflow.RibbonBar==null)
|
||||
{
|
||||
base.PaintButtonImage(button, pa, image, imagebounds);
|
||||
return;
|
||||
}
|
||||
ElementStyle backStyle = overflow.RibbonBar.GetPaintBackgroundStyle();
|
||||
ElementStyle titleStyle = overflow.RibbonBar.TitleStyle;
|
||||
|
||||
int cornerSize = 3;
|
||||
|
||||
if (backStyle.BackColorBlend.Count > 0)
|
||||
DisplayHelp.FillRoundedRectangle(pa.Graphics, imagebounds, cornerSize, backStyle.BackColorBlend[0].Color, backStyle.BackColorBlend[backStyle.BackColorBlend.Count-1].Color, overflow.RibbonBar.BackgroundStyle.BackColorGradientAngle);
|
||||
else
|
||||
DisplayHelp.FillRoundedRectangle(pa.Graphics, imagebounds, cornerSize, backStyle.BackColor, backStyle.BackColor2, backStyle.BackColorGradientAngle);
|
||||
if(!button.Expanded)
|
||||
DisplayHelp.FillRectangle(pa.Graphics, new Rectangle(imagebounds.X+1, imagebounds.Bottom - 8, imagebounds.Width-2, 7), titleStyle.BackColor, titleStyle.BackColor2, titleStyle.BackColorGradientAngle);
|
||||
|
||||
if (!backStyle.BorderColor.IsEmpty)
|
||||
{
|
||||
using (GraphicsPath path = new GraphicsPath())
|
||||
{
|
||||
path.AddLine(imagebounds.X, imagebounds.Bottom - 8, imagebounds.Right, imagebounds.Bottom - 8);
|
||||
ElementStyleDisplay.AddCornerArc(path, imagebounds, cornerSize, eCornerArc.BottomRight);
|
||||
ElementStyleDisplay.AddCornerArc(path, imagebounds, cornerSize, eCornerArc.BottomLeft);
|
||||
path.CloseAllFigures();
|
||||
using (SolidBrush brush = new SolidBrush(Color.FromArgb(192, backStyle.BorderColor)))
|
||||
pa.Graphics.FillPath(brush, path);
|
||||
}
|
||||
}
|
||||
|
||||
DisplayHelp.DrawRoundGradientRectangle(pa.Graphics, imagebounds, backStyle.BorderColor, backStyle.BorderColor2, backStyle.BorderGradientAngle, 1, cornerSize);
|
||||
|
||||
imagebounds.X += (imagebounds.Width - image.Width) / 2;
|
||||
imagebounds.Y += 4;
|
||||
imagebounds.Width = image.Width;
|
||||
imagebounds.Height = image.Height;
|
||||
|
||||
image.DrawImage(pa.Graphics, imagebounds);
|
||||
}
|
||||
|
||||
protected override Rectangle GetTextRectangle(ButtonItem button, ItemPaintArgs pa, eTextFormat stringFormat, CompositeImage image)
|
||||
{
|
||||
Rectangle r = base.GetTextRectangle(button, pa, stringFormat, image);
|
||||
r.Offset(0, 12);
|
||||
//r.Height -= 18;
|
||||
return r;
|
||||
}
|
||||
|
||||
protected override void PaintState(ButtonItem button, ItemPaintArgs pa, CompositeImage image, Rectangle r, bool isMouseDown)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the color table for the Ribbon Tab Group.
|
||||
/// </summary>
|
||||
public class Office2007RibbonTabGroupColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the color table.
|
||||
/// </summary>
|
||||
public string Name = "";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background color.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable Background = new LinearGradientColorTable(ColorScheme.GetColor(0xCADBF3), ColorScheme.GetColor(0xCDBFD7));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background highlight colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable BackgroundHighlight = new LinearGradientColorTable(Color.FromArgb(192, ColorScheme.GetColor(0xD068C9)), Color.Transparent);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the text color.
|
||||
/// </summary>
|
||||
public Color Text = ColorScheme.GetColor(0x15428B);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the border color
|
||||
/// </summary>
|
||||
public LinearGradientColorTable Border = new LinearGradientColorTable(Color.FromArgb(16, Color.DarkGray), Color.FromArgb(192, Color.DarkGray));
|
||||
}
|
||||
}
|
||||
+151
@@ -0,0 +1,151 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Collection for Office2007RibbonTabGroupColorTable type.
|
||||
/// </summary>
|
||||
public class Office2007RibbonTabGroupColorTableCollection : CollectionBase
|
||||
{
|
||||
#region Internal Implementation
|
||||
/// <summary>Creates new instance of the class.</summary>
|
||||
public Office2007RibbonTabGroupColorTableCollection() { }
|
||||
|
||||
/// <summary>
|
||||
/// Adds new object to the collection.
|
||||
/// </summary>
|
||||
/// <param name="Office2007RibbonTabItemColorTable">Object to add.</param>
|
||||
/// <returns>Index of newly added object.</returns>
|
||||
public int Add(Office2007RibbonTabGroupColorTable colorTable)
|
||||
{
|
||||
return List.Add(colorTable);
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns reference to the object in collection based on it's index.
|
||||
/// </summary>
|
||||
public Office2007RibbonTabGroupColorTable this[int index]
|
||||
{
|
||||
get {return (Office2007RibbonTabGroupColorTable)(List[index]);}
|
||||
set {List[index] = value;}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns reference to the object in collection based on it's index.
|
||||
/// </summary>
|
||||
public Office2007RibbonTabGroupColorTable this[string name]
|
||||
{
|
||||
get
|
||||
{
|
||||
foreach (Office2007RibbonTabGroupColorTable ct in this.List)
|
||||
{
|
||||
if (ct.Name == name)
|
||||
return ct;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inserts new object into the collection.
|
||||
/// </summary>
|
||||
/// <param name="index">Position of the object.</param>
|
||||
/// <param name="value">Object to insert.</param>
|
||||
public void Insert(int index, Office2007RibbonTabGroupColorTable value)
|
||||
{
|
||||
List.Insert(index, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns index of the object inside of the collection.
|
||||
/// </summary>
|
||||
/// <param name="value">Reference to the object.</param>
|
||||
/// <returns>Index of the object.</returns>
|
||||
public int IndexOf(Office2007RibbonTabGroupColorTable value)
|
||||
{
|
||||
return List.IndexOf(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether collection contains specified object.
|
||||
/// </summary>
|
||||
/// <param name="value">Object to look for.</param>
|
||||
/// <returns>true if object is part of the collection, otherwise false.</returns>
|
||||
public bool Contains(Office2007RibbonTabGroupColorTable value)
|
||||
{
|
||||
return List.Contains(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether collection contains object with specified name.
|
||||
/// </summary>
|
||||
/// <param name="name">Name of the object to look for</param>
|
||||
/// <returns>true if object with given name is part of the collection otherwise false</returns>
|
||||
public bool Contains(string name)
|
||||
{
|
||||
foreach (Office2007RibbonTabGroupColorTable ct in this.List)
|
||||
{
|
||||
if (ct.Name == name)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes specified object from the collection.
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
public void Remove(Office2007RibbonTabGroupColorTable value)
|
||||
{
|
||||
List.Remove(value);
|
||||
}
|
||||
|
||||
//protected override void OnRemoveComplete(int index,object value)
|
||||
//{
|
||||
// base.OnRemoveComplete(index,value);
|
||||
// Office2007RibbonTabItemColorTable me=value as Office2007RibbonTabItemColorTable;
|
||||
// if (m_Parent != null)
|
||||
// {
|
||||
// me.SetParent(null);
|
||||
// m_Parent.IsSizeValid = false;
|
||||
// }
|
||||
//}
|
||||
//protected override void OnInsertComplete(int index,object value)
|
||||
//{
|
||||
// base.OnInsertComplete(index,value);
|
||||
// Office2007RibbonTabItemColorTable me=value as Office2007RibbonTabItemColorTable;
|
||||
// if (m_Parent != null)
|
||||
// {
|
||||
// me.SetParent(m_Parent);
|
||||
// m_Parent.IsSizeValid = false;
|
||||
// }
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Copies collection into the specified array.
|
||||
/// </summary>
|
||||
/// <param name="array">Array to copy collection to.</param>
|
||||
/// <param name="index">Starting index.</param>
|
||||
public void CopyTo(Office2007RibbonTabGroupColorTable[] array, int index)
|
||||
{
|
||||
List.CopyTo(array, index);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copies contained items to the Office2007RibbonTabItemColorTable array.
|
||||
/// </summary>
|
||||
/// <param name="array">Array to copy to.</param>
|
||||
internal void CopyTo(Office2007RibbonTabGroupColorTable[] array)
|
||||
{
|
||||
List.CopyTo(array,0);
|
||||
}
|
||||
|
||||
protected override void OnClear()
|
||||
{
|
||||
base.OnClear();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the color table for RibbonTabItem states.
|
||||
/// </summary>
|
||||
public class Office2007RibbonTabItemColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the color table.
|
||||
/// </summary>
|
||||
public string Name = "";
|
||||
/// <summary>
|
||||
/// Gets or sets the default tab colors.
|
||||
/// </summary>
|
||||
public Office2007RibbonTabItemStateColorTable Default = new Office2007RibbonTabItemStateColorTable();
|
||||
/// <summary>
|
||||
/// Gets or sets the selected tab colors.
|
||||
/// </summary>
|
||||
public Office2007RibbonTabItemStateColorTable Selected = new Office2007RibbonTabItemStateColorTable();
|
||||
/// <summary>
|
||||
/// Gets or sets the selected tab colors when mouse is over the tab.
|
||||
/// </summary>
|
||||
public Office2007RibbonTabItemStateColorTable SelectedMouseOver = new Office2007RibbonTabItemStateColorTable();
|
||||
/// <summary>
|
||||
/// Gets or sets the colors when mouse is over the tab but tab is not selected.
|
||||
/// </summary>
|
||||
public Office2007RibbonTabItemStateColorTable MouseOver = new Office2007RibbonTabItemStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the round corner size for the top part of the ribbon tab item.
|
||||
/// </summary>
|
||||
public int CornerSize = 3;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines collection for Office2007RibbonTabItemColorTable items.
|
||||
/// </summary>
|
||||
public class Office2007RibbonTabItemColorTableCollection : CollectionBase
|
||||
{
|
||||
#region Internal Implementation
|
||||
/// <summary>Creates new instance of the class.</summary>
|
||||
public Office2007RibbonTabItemColorTableCollection() { }
|
||||
|
||||
/// <summary>
|
||||
/// Adds new object to the collection.
|
||||
/// </summary>
|
||||
/// <param name="Office2007ButtonItemColorTable">Object to add.</param>
|
||||
/// <returns>Index of newly added object.</returns>
|
||||
public int Add(Office2007RibbonTabItemColorTable colorTable)
|
||||
{
|
||||
return List.Add(colorTable);
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns reference to the object in collection based on it's index.
|
||||
/// </summary>
|
||||
public Office2007RibbonTabItemColorTable this[int index]
|
||||
{
|
||||
get {return (Office2007RibbonTabItemColorTable)(List[index]);}
|
||||
set {List[index] = value;}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns reference to the object in collection based on it's index.
|
||||
/// </summary>
|
||||
public Office2007RibbonTabItemColorTable this[string name]
|
||||
{
|
||||
get
|
||||
{
|
||||
foreach (Office2007RibbonTabItemColorTable ct in this.List)
|
||||
{
|
||||
if (ct.Name == name)
|
||||
return ct;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inserts new object into the collection.
|
||||
/// </summary>
|
||||
/// <param name="index">Position of the object.</param>
|
||||
/// <param name="value">Object to insert.</param>
|
||||
public void Insert(int index, Office2007RibbonTabItemColorTable value)
|
||||
{
|
||||
List.Insert(index, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns index of the object inside of the collection.
|
||||
/// </summary>
|
||||
/// <param name="value">Reference to the object.</param>
|
||||
/// <returns>Index of the object.</returns>
|
||||
public int IndexOf(Office2007RibbonTabItemColorTable value)
|
||||
{
|
||||
return List.IndexOf(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether collection contains specified object.
|
||||
/// </summary>
|
||||
/// <param name="value">Object to look for.</param>
|
||||
/// <returns>true if object is part of the collection, otherwise false.</returns>
|
||||
public bool Contains(Office2007RibbonTabItemColorTable value)
|
||||
{
|
||||
return List.Contains(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether collection contains object with specified name.
|
||||
/// </summary>
|
||||
/// <param name="name">Name of the object to look for</param>
|
||||
/// <returns>true if object with given name is part of the collection otherwise false</returns>
|
||||
public bool Contains(string name)
|
||||
{
|
||||
foreach (Office2007RibbonTabItemColorTable ct in this.List)
|
||||
{
|
||||
if (ct.Name == name)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes specified object from the collection.
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
public void Remove(Office2007RibbonTabItemColorTable value)
|
||||
{
|
||||
List.Remove(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copies collection into the specified array.
|
||||
/// </summary>
|
||||
/// <param name="array">Array to copy collection to.</param>
|
||||
/// <param name="index">Starting index.</param>
|
||||
public void CopyTo(Office2007RibbonTabItemColorTable[] array, int index)
|
||||
{
|
||||
List.CopyTo(array, index);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copies contained items to the Office2007ButtonItemColorTable array.
|
||||
/// </summary>
|
||||
/// <param name="array">Array to copy to.</param>
|
||||
internal void CopyTo(Office2007RibbonTabItemColorTable[] array)
|
||||
{
|
||||
List.CopyTo(array,0);
|
||||
}
|
||||
|
||||
protected override void OnClear()
|
||||
{
|
||||
base.OnClear();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the colors for the RibbonTabItem state like but not limited to selected, mouse over etc.
|
||||
/// </summary>
|
||||
public class Office2007RibbonTabItemStateColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the outer border.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable OuterBorder = new LinearGradientColorTable();
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the inner border.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable InnerBorder = new LinearGradientColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable Background = new LinearGradientColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background highlight colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable BackgroundHighlight = new LinearGradientColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the text color.
|
||||
/// </summary>
|
||||
public Color Text = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the text color when rendered on Windows Glass.
|
||||
/// </summary>
|
||||
public Color GlassText = Color.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the colors for the scroll bar control.
|
||||
/// </summary>
|
||||
public class Office2007ScrollBarColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the control default state.
|
||||
/// </summary>
|
||||
public Office2007ScrollBarStateColorTable Default = new Office2007ScrollBarStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the control when mouse is pressed over the control.
|
||||
/// </summary>
|
||||
public Office2007ScrollBarStateColorTable Pressed = new Office2007ScrollBarStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the control when mouse is over the control but not over an active part of the control like scroll buttons.
|
||||
/// </summary>
|
||||
public Office2007ScrollBarStateColorTable MouseOverControl = new Office2007ScrollBarStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the control when mouse is over the active part of the control like scroll buttons.
|
||||
/// </summary>
|
||||
public Office2007ScrollBarStateColorTable MouseOver = new Office2007ScrollBarStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the control when control is disabled.
|
||||
/// </summary>
|
||||
public Office2007ScrollBarStateColorTable Disabled = new Office2007ScrollBarStateColorTable();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the color table for the Scroll bar in single state.
|
||||
/// </summary>
|
||||
public class Office2007ScrollBarStateColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the outer border color for the scroll bar thumb.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable ThumbOuterBorder = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the inner border color for the scroll bar thumb.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable ThumbInnerBorder = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the thumb background color blend collection.
|
||||
/// </summary>
|
||||
public BackgroundColorBlendCollection ThumbBackground = new BackgroundColorBlendCollection();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the directional sign background color for the scroll bar thumb.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable ThumbSignBackground = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the outer border color for the scroll bar track button.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable TrackOuterBorder = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the inner border color for the scroll bar track button.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable TrackInnerBorder = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the track background color blend collection.
|
||||
/// </summary>
|
||||
public BackgroundColorBlendCollection TrackBackground = new BackgroundColorBlendCollection();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background color for the track signs.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable TrackSignBackground = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background colors for the entire control.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable Background = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the border colors for the entire control.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable Border = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the color table for Office 2007 Style Side Bar Control.
|
||||
/// </summary>
|
||||
public class Office2007SideBarColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the background color of the control.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable Background = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the control border color.
|
||||
/// </summary>
|
||||
public Color Border = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color of SideBarPanelItem text.
|
||||
/// </summary>
|
||||
public Color SideBarPanelItemText = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color table for SideBarPanelItem in default state.
|
||||
/// </summary>
|
||||
public GradientColorTable SideBarPanelItemDefault = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color table for SideBarPanelItem in mouse over state.
|
||||
/// </summary>
|
||||
public GradientColorTable SideBarPanelItemMouseOver = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color table for SideBarPanelItem in expanded state.
|
||||
/// </summary>
|
||||
public GradientColorTable SideBarPanelItemExpanded = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color table for SideBarPanelItem when mouse button is pressed on the item.
|
||||
/// </summary>
|
||||
public GradientColorTable SideBarPanelItemPressed = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
internal class Office2007SideBarPainter : SideBarPainter, IOffice2007Painter
|
||||
{
|
||||
#region IOffice2007Painter
|
||||
private Office2007ColorTable m_ColorTable = null;
|
||||
/// <summary>
|
||||
/// Gets or sets color table used by renderer.
|
||||
/// </summary>
|
||||
public Office2007ColorTable ColorTable
|
||||
{
|
||||
get { return m_ColorTable; }
|
||||
set { m_ColorTable = value; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Internal Implementation
|
||||
public override void PaintSideBar(SideBarRendererEventArgs e)
|
||||
{
|
||||
Graphics g = e.Graphics;
|
||||
SideBar sb = e.SideBar;
|
||||
Office2007SideBarColorTable ct = m_ColorTable.SideBar;
|
||||
LinearGradientColorTable background = ct.Background;
|
||||
//if (sb.BackColor != SystemColors.Control)
|
||||
//{
|
||||
// background.Start = sb.BackColor;
|
||||
// background.End = Color.Empty;
|
||||
//}
|
||||
|
||||
Rectangle r = new Rectangle(Point.Empty, sb.Size);
|
||||
DisplayHelp.FillRectangle(g, r, background);
|
||||
|
||||
Color border = ct.Border;
|
||||
|
||||
DisplayHelp.DrawRectangle(g, border, r);
|
||||
|
||||
base.PaintSideBar(e);
|
||||
}
|
||||
|
||||
public override void PaintSideBarPanelItem(SideBarPanelItemRendererEventArgs e)
|
||||
{
|
||||
Graphics g = e.Graphics;
|
||||
SideBarPanelItem sb = e.SideBarPanelItem;
|
||||
Office2007SideBarColorTable ct = m_ColorTable.SideBar;
|
||||
GradientColorTable stateColorTable = sb.Expanded ? ct.SideBarPanelItemExpanded : ct.SideBarPanelItemDefault;
|
||||
if (sb.IsMouseDown)
|
||||
stateColorTable = ct.SideBarPanelItemPressed;
|
||||
else if (sb.IsMouseOver)
|
||||
stateColorTable = ct.SideBarPanelItemMouseOver;
|
||||
|
||||
if (!sb.BackgroundStyle.BackColor1.IsEmpty || sb.BackgroundStyle.BackgroundImage != null)
|
||||
sb.BackgroundStyle.Paint(g, sb.DisplayRectangle);
|
||||
|
||||
Rectangle r = sb.PanelRect;
|
||||
Rectangle bounds = sb.DisplayRectangle;
|
||||
r.Offset(bounds.Location);
|
||||
|
||||
if (stateColorTable != null)
|
||||
{
|
||||
using (Brush brush = DisplayHelp.CreateBrush(r, stateColorTable))
|
||||
{
|
||||
g.FillRectangle(brush, r);
|
||||
}
|
||||
}
|
||||
|
||||
if (sb.Expanded)
|
||||
{
|
||||
DisplayHelp.DrawLine(g, r.X, r.Bottom, r.Right, r.Bottom, ct.Border, 1);
|
||||
}
|
||||
|
||||
DisplayHelp.DrawLine(g, bounds.X, bounds.Bottom, bounds.Right, bounds.Bottom, ct.Border, 1);
|
||||
|
||||
Font font = sb.GetFont();
|
||||
CompositeImage image = sb.GetImage();
|
||||
|
||||
if (image != null)
|
||||
{
|
||||
r.X += 2;
|
||||
r.Width -= 2;
|
||||
image.DrawImage(g, new Rectangle(r.X, r.Y + (r.Height - image.Height) / 2, image.Width, image.Height));
|
||||
r.X += (image.Width + 4);
|
||||
r.Width -= (image.Width + 8);
|
||||
}
|
||||
|
||||
Rectangle rText = Rectangle.Empty;
|
||||
if (sb.Text.Length > 0)
|
||||
{
|
||||
Color textColor = ct.SideBarPanelItemText;
|
||||
if (!sb.ForeColor.IsEmpty) textColor = sb.ForeColor;
|
||||
if (sb.IsMouseOver && !sb.HotForeColor.IsEmpty) textColor = sb.HotForeColor;
|
||||
TextDrawing.DrawString(g, sb.Text, font, textColor, r, sb.GetStringFormat());
|
||||
rText = r;
|
||||
}
|
||||
|
||||
if (sb.Focused)
|
||||
{
|
||||
if (sb.DesignMode)
|
||||
{
|
||||
Rectangle rFocus = sb.PanelRect;
|
||||
rFocus.Offset(sb.DisplayRectangle.Location);
|
||||
rFocus.Inflate(-2, -2);
|
||||
DesignTime.DrawDesignTimeSelection(g, rFocus, e.ItemPaintArgs.Colors.ItemDesignTimeBorder);
|
||||
}
|
||||
else if (!rText.IsEmpty)
|
||||
{
|
||||
System.Windows.Forms.ControlPaint.DrawFocusRectangle(g, rText);
|
||||
}
|
||||
}
|
||||
|
||||
base.PaintSideBarPanelItem(e);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the color table for the slider item.
|
||||
/// </summary>
|
||||
public class Office2007SliderColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the default state colors.
|
||||
/// </summary>
|
||||
public Office2007SliderStateColorTable Default = new Office2007SliderStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the mouse over state colors.
|
||||
/// </summary>
|
||||
public Office2007SliderStateColorTable MouseOver = new Office2007SliderStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the mouse pressed colors.
|
||||
/// </summary>
|
||||
public Office2007SliderStateColorTable Pressed = new Office2007SliderStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the disabled colors.
|
||||
/// </summary>
|
||||
public Office2007SliderStateColorTable Disabled = new Office2007SliderStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the optional color table for Thumb part of the slider. When set to null default values from Office2007SliderColorTable are used.
|
||||
/// </summary>
|
||||
public Office2007SliderPartColorTable TrackPart = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the optional color table for Increase button part of the slider. When set to null default values from Office2007SliderColorTable are used.
|
||||
/// </summary>
|
||||
public Office2007SliderPartColorTable IncreaseButtonPart = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the optional color table for Decrease button part of the slider. When set to null default values from Office2007SliderColorTable are used.
|
||||
/// </summary>
|
||||
public Office2007SliderPartColorTable DecreaseButtonPart = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines set of color tables for single slider part.
|
||||
/// </summary>
|
||||
public class Office2007SliderPartColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the default state colors.
|
||||
/// </summary>
|
||||
public Office2007SliderStateColorTable Default = new Office2007SliderStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the mouse over state colors.
|
||||
/// </summary>
|
||||
public Office2007SliderStateColorTable MouseOver = new Office2007SliderStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the mouse pressed colors.
|
||||
/// </summary>
|
||||
public Office2007SliderStateColorTable Pressed = new Office2007SliderStateColorTable();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,480 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using DevComponents.DotNetBar.Ribbon;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
internal class Office2007SliderPainter : SliderPainter, IOffice2007Painter
|
||||
{
|
||||
#region IOffice2007Painter
|
||||
private Office2007ColorTable m_ColorTable = null; //new Office2007ColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets color table used by renderer.
|
||||
/// </summary>
|
||||
public Office2007ColorTable ColorTable
|
||||
{
|
||||
get { return m_ColorTable; }
|
||||
set { m_ColorTable = value; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Internal Implementation
|
||||
protected virtual Office2007SliderColorTable GetColorTable(SliderItem item, System.Windows.Forms.Control container)
|
||||
{
|
||||
if (item.ColorTable != null)
|
||||
return item.ColorTable;
|
||||
|
||||
if (container == null)
|
||||
return m_ColorTable.Slider;
|
||||
|
||||
Office2007ColorTable table = m_ColorTable;
|
||||
|
||||
string key = Office2007ColorTable.GetContextualKey(typeof(Office2007SliderColorTable), container.GetType());
|
||||
object st = null;
|
||||
|
||||
if (container is Bar)
|
||||
{
|
||||
if (table.ContextualTables.TryGetValue(key + "+" + ((Bar)container).BarType.ToString(), out st))
|
||||
return (Office2007SliderColorTable)st;
|
||||
}
|
||||
|
||||
if (table.ContextualTables.TryGetValue(key, out st))
|
||||
return (Office2007SliderColorTable)st;
|
||||
|
||||
return m_ColorTable.Slider;
|
||||
}
|
||||
|
||||
public override void Paint(SliderItemRendererEventArgs e)
|
||||
{
|
||||
SliderItem item = e.SliderItem;
|
||||
Office2007SliderColorTable ct = GetColorTable(item, e.ItemPaintArgs.ContainerControl);
|
||||
Office2007SliderStateColorTable decreaseCt = null;
|
||||
Office2007SliderStateColorTable increaseCt = null;
|
||||
Office2007SliderStateColorTable trackCt = null;
|
||||
eDotNetBarStyle effectiveStyle = item.EffectiveStyle;
|
||||
|
||||
if (item.GetEnabled())
|
||||
{
|
||||
decreaseCt = ct.Default;
|
||||
increaseCt = ct.Default;
|
||||
trackCt = ct.Default;
|
||||
|
||||
if (ct.DecreaseButtonPart != null)
|
||||
decreaseCt = ct.DecreaseButtonPart.Default;
|
||||
if (ct.IncreaseButtonPart != null)
|
||||
increaseCt = ct.IncreaseButtonPart.Default;
|
||||
if (ct.TrackPart != null)
|
||||
trackCt = ct.TrackPart.Default;
|
||||
|
||||
if (item.MouseDownPart == eSliderPart.DecreaseButton)
|
||||
{
|
||||
if (ct.DecreaseButtonPart != null)
|
||||
decreaseCt = ct.DecreaseButtonPart.Pressed;
|
||||
else
|
||||
decreaseCt = ct.Pressed;
|
||||
}
|
||||
else if (item.MouseDownPart == eSliderPart.IncreaseButton)
|
||||
{
|
||||
if (ct.IncreaseButtonPart != null)
|
||||
increaseCt = ct.IncreaseButtonPart.Pressed;
|
||||
else
|
||||
increaseCt = ct.Pressed;
|
||||
}
|
||||
else if (item.MouseDownPart == eSliderPart.TrackArea)
|
||||
{
|
||||
if (ct.TrackPart != null)
|
||||
trackCt = ct.TrackPart.Pressed;
|
||||
else
|
||||
trackCt = ct.Pressed;
|
||||
}
|
||||
else if (item.MouseOverPart == eSliderPart.DecreaseButton)
|
||||
{
|
||||
if (ct.DecreaseButtonPart != null)
|
||||
decreaseCt = ct.DecreaseButtonPart.MouseOver;
|
||||
else
|
||||
decreaseCt = ct.MouseOver;
|
||||
}
|
||||
else if (item.MouseOverPart == eSliderPart.IncreaseButton)
|
||||
{
|
||||
if (ct.IncreaseButtonPart != null)
|
||||
increaseCt = ct.IncreaseButtonPart.MouseOver;
|
||||
else
|
||||
increaseCt = ct.MouseOver;
|
||||
}
|
||||
else if (item.MouseOverPart == eSliderPart.TrackArea)
|
||||
{
|
||||
if (ct.TrackPart != null)
|
||||
trackCt = ct.TrackPart.MouseOver;
|
||||
else
|
||||
trackCt = ct.MouseOver;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
decreaseCt = ct.Disabled;
|
||||
increaseCt = ct.Disabled;
|
||||
trackCt = ct.Disabled;
|
||||
}
|
||||
|
||||
Rectangle itemRect = item.DisplayRectangle;
|
||||
Rectangle r = item.LabelBounds;
|
||||
Graphics g = e.Graphics;
|
||||
|
||||
string text = GetText(item);
|
||||
if (!r.IsEmpty && text.Length > 0)
|
||||
{
|
||||
r.Offset(itemRect.Location);
|
||||
eTextFormat tf = eTextFormat.Default | eTextFormat.WordEllipsis;
|
||||
if (item.LabelPosition == eSliderLabelPosition.Left)
|
||||
tf |= eTextFormat.Left | eTextFormat.VerticalCenter;
|
||||
else if (item.LabelPosition == eSliderLabelPosition.Right)
|
||||
tf |= eTextFormat.Right | eTextFormat.VerticalCenter;
|
||||
else if (item.LabelPosition == eSliderLabelPosition.Top)
|
||||
tf |= eTextFormat.HorizontalCenter | eTextFormat.Top | eTextFormat.WordBreak;
|
||||
else if (item.LabelPosition == eSliderLabelPosition.Bottom)
|
||||
tf |= eTextFormat.HorizontalCenter | eTextFormat.Bottom | eTextFormat.WordBreak;
|
||||
|
||||
Color cl = trackCt.LabelColor;
|
||||
if (e.ItemPaintArgs.ContainerControl is DevComponents.DotNetBar.Controls.Slider)
|
||||
cl = trackCt.SliderLabelColor;
|
||||
|
||||
if (!item.TextColor.IsEmpty)
|
||||
cl = item.TextColor;
|
||||
if (item.TextMarkupBody == null)
|
||||
{
|
||||
#if FRAMEWORK20
|
||||
if (e.ItemPaintArgs != null && e.ItemPaintArgs.GlassEnabled && item.Parent is CaptionItemContainer && !(e.ItemPaintArgs.ContainerControl is QatToolbar))
|
||||
{
|
||||
if (!e.ItemPaintArgs.CachedPaint)
|
||||
Office2007RibbonControlPainter.PaintTextOnGlass(g, GetText(item), e.ItemPaintArgs.Font, r, TextDrawing.GetTextFormat(tf));
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (item.SliderOrientation == eOrientation.Vertical)
|
||||
{
|
||||
g.RotateTransform(90);
|
||||
TextDrawing.DrawString(g, GetText(item), e.ItemPaintArgs.Font, cl, new Rectangle(r.Top, -r.Right, r.Height, r.Width), tf);
|
||||
g.ResetTransform();
|
||||
}
|
||||
else
|
||||
TextDrawing.DrawString(g, GetText(item), e.ItemPaintArgs.Font, cl, r, tf);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item.SliderOrientation == eOrientation.Vertical)
|
||||
{
|
||||
g.RotateTransform(90);
|
||||
TextMarkup.MarkupDrawContext d = new TextMarkup.MarkupDrawContext(g, e.ItemPaintArgs.Font, cl, e.ItemPaintArgs.RightToLeft);
|
||||
d.HotKeyPrefixVisible = !((tf & eTextFormat.HidePrefix) == eTextFormat.HidePrefix);
|
||||
item.TextMarkupBody.Bounds = new Rectangle(r.Top, -r.Right, item.TextMarkupBody.Bounds.Width, item.TextMarkupBody.Bounds.Height);
|
||||
item.TextMarkupBody.Render(d);
|
||||
g.ResetTransform();
|
||||
}
|
||||
else
|
||||
{
|
||||
TextMarkup.MarkupDrawContext d = new TextMarkup.MarkupDrawContext(g, e.ItemPaintArgs.Font, cl, e.ItemPaintArgs.RightToLeft);
|
||||
d.HotKeyPrefixVisible = !((tf & eTextFormat.HidePrefix) == eTextFormat.HidePrefix);
|
||||
item.TextMarkupBody.Bounds = r;
|
||||
item.TextMarkupBody.Render(d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
r = item.SlideBounds;
|
||||
int penWidth = Dpi.Width1;
|
||||
if (!r.IsEmpty)
|
||||
{
|
||||
SmoothingMode sm = g.SmoothingMode;
|
||||
g.SmoothingMode = SmoothingMode.None;
|
||||
r.Offset(itemRect.Location);
|
||||
if (item.SliderOrientation == eOrientation.Horizontal)
|
||||
{
|
||||
// Draw the track line
|
||||
int ty = r.Y + r.Height / 2 - 1;
|
||||
int tmx = r.X + r.Width / 2;
|
||||
if (!trackCt.TrackLineColor.IsEmpty)
|
||||
{
|
||||
using (Pen pen = new Pen(trackCt.TrackLineColor, penWidth))
|
||||
{
|
||||
g.DrawLine(pen, r.X - 1, ty, r.Right, ty);
|
||||
}
|
||||
}
|
||||
|
||||
if (!trackCt.TrackLineLightColor.IsEmpty)
|
||||
{
|
||||
ty++;
|
||||
tmx++;
|
||||
using (Pen pen = new Pen(trackCt.TrackLineLightColor, penWidth))
|
||||
{
|
||||
if (item.TrackMarker)
|
||||
g.DrawLine(pen, tmx, ty - 3, tmx, ty + 3);
|
||||
g.DrawLine(pen, r.X - 1, ty, r.Right, ty);
|
||||
}
|
||||
}
|
||||
|
||||
if (!trackCt.TrackLineColor.IsEmpty && item.TrackMarker)
|
||||
{
|
||||
ty--;
|
||||
tmx--;
|
||||
using (Pen pen = new Pen(trackCt.TrackLineColor, penWidth))
|
||||
{
|
||||
g.DrawLine(pen, tmx, ty - 3, tmx, ty + 3);
|
||||
}
|
||||
}
|
||||
g.SmoothingMode = sm;
|
||||
|
||||
int tx = 0;
|
||||
if (e.ItemPaintArgs.RightToLeft)
|
||||
tx = (int)((r.Width - Dpi.Width11) * (1 - ((item.Maximum - item.Minimum == 0) ? 0 : (float)(item.Value - item.Minimum) / (item.Maximum - item.Minimum))));
|
||||
else
|
||||
tx = (int)((r.Width - Dpi.Width11) * ((item.Maximum - item.Minimum == 0) ? 0 : (float)(item.Value - item.Minimum) / (item.Maximum - item.Minimum)));
|
||||
|
||||
// Draw the tracker
|
||||
Rectangle trackRect = r;
|
||||
trackRect.X += tx;
|
||||
trackRect.Width = Dpi.Width11;
|
||||
trackRect.Height = Dpi.Height15;
|
||||
trackRect.Y += (r.Height - trackRect.Height) / 2;
|
||||
PaintSliderPart(trackCt, trackRect, g, eSliderPart.TrackArea, item.SliderOrientation, effectiveStyle);
|
||||
item.TrackBounds = trackRect;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Draw the track line
|
||||
int tx = r.X + r.Width / 2 - 1;
|
||||
int tmy = r.Y + r.Height / 2;
|
||||
if (!trackCt.TrackLineColor.IsEmpty)
|
||||
{
|
||||
using (Pen pen = new Pen(trackCt.TrackLineColor, penWidth))
|
||||
{
|
||||
g.DrawLine(pen, tx, r.Y - 1, tx, r.Bottom);
|
||||
}
|
||||
}
|
||||
|
||||
if (!trackCt.TrackLineLightColor.IsEmpty)
|
||||
{
|
||||
tx++;
|
||||
tmy++;
|
||||
using (Pen pen = new Pen(trackCt.TrackLineLightColor, penWidth))
|
||||
{
|
||||
if (item.TrackMarker)
|
||||
g.DrawLine(pen, tx - 3, tmy, tx + 3, tmy);
|
||||
g.DrawLine(pen, tx, r.Y - 1, tx, r.Bottom);
|
||||
}
|
||||
}
|
||||
|
||||
if (!trackCt.TrackLineColor.IsEmpty && item.TrackMarker)
|
||||
{
|
||||
tx--;
|
||||
tmy--;
|
||||
using (Pen pen = new Pen(trackCt.TrackLineColor, penWidth))
|
||||
{
|
||||
g.DrawLine(pen, tx - 3, tmy, tx + 3, tmy);
|
||||
}
|
||||
}
|
||||
g.SmoothingMode = sm;
|
||||
|
||||
int ty = 0;
|
||||
ty = (r.Height - 16) - (int)((r.Height - 11) * ((item.Maximum - item.Minimum == 0) ? 0 : (float)(item.Value - item.Minimum) / (item.Maximum - item.Minimum)));
|
||||
|
||||
// Draw the tracker
|
||||
Rectangle trackRect = r;
|
||||
trackRect.Y += ty;
|
||||
trackRect.Width = Dpi.Width15;
|
||||
trackRect.Height = Dpi.Height11;
|
||||
trackRect.X += (r.Width - trackRect.Width) / 2;
|
||||
PaintSliderPart(trackCt, trackRect, g, eSliderPart.TrackArea, item.SliderOrientation, effectiveStyle);
|
||||
item.TrackBounds = trackRect;
|
||||
}
|
||||
}
|
||||
|
||||
r = item.DecreaseBounds;
|
||||
if (!r.IsEmpty)
|
||||
{
|
||||
r.Offset(itemRect.Location);
|
||||
r.Width--;
|
||||
r.Height--;
|
||||
PaintSliderPart(decreaseCt, r, g, eSliderPart.DecreaseButton, item.SliderOrientation, effectiveStyle);
|
||||
}
|
||||
|
||||
r = item.IncreaseBounds;
|
||||
if (!r.IsEmpty)
|
||||
{
|
||||
r.Offset(itemRect.Location);
|
||||
r.Width--;
|
||||
r.Height--;
|
||||
PaintSliderPart(increaseCt, r, g, eSliderPart.IncreaseButton, item.SliderOrientation, effectiveStyle);
|
||||
}
|
||||
|
||||
base.Paint(e);
|
||||
}
|
||||
|
||||
private string GetText(SliderItem item)
|
||||
{
|
||||
return item.Text;
|
||||
}
|
||||
|
||||
//private void PaintSliderPart(Office2007SliderStateColorTable ct, Rectangle r, Graphics g, eSliderPart part)
|
||||
//{
|
||||
// PaintSliderPart(ct, r, g, part, eOrientation.Horizontal, eDotNetBarStyle.Office2010);
|
||||
//}
|
||||
|
||||
private void PaintSliderPart(Office2007SliderStateColorTable ct, Rectangle r, Graphics g, eSliderPart part, eOrientation orientation, eDotNetBarStyle effectiveStyle)
|
||||
{
|
||||
if (r.Width <= 0 || r.Height <= 0) return;
|
||||
|
||||
if (part == eSliderPart.DecreaseButton || part == eSliderPart.IncreaseButton)
|
||||
{
|
||||
r.Inflate(-1, -1);
|
||||
SmoothingMode sm = g.SmoothingMode;
|
||||
g.SmoothingMode = SmoothingMode.AntiAlias;
|
||||
if (ct.PartBackground.Colors.Count > 0)
|
||||
{
|
||||
using (Brush brush = DisplayHelp.CreateBrush(r, ct.PartBackground))
|
||||
{
|
||||
g.FillEllipse(brush, r);
|
||||
}
|
||||
}
|
||||
|
||||
if (!ct.PartBorderColor.IsEmpty)
|
||||
{
|
||||
using (Pen pen = new Pen(ct.PartBorderColor, 1))
|
||||
g.DrawEllipse(pen, r);
|
||||
}
|
||||
|
||||
r.Inflate(1, 1);
|
||||
if (!ct.PartBorderLightColor.IsEmpty)
|
||||
{
|
||||
using (Pen pen = new Pen(ct.PartBorderLightColor, 1))
|
||||
g.DrawEllipse(pen, r);
|
||||
}
|
||||
g.SmoothingMode = SmoothingMode.None;
|
||||
|
||||
if (part == eSliderPart.DecreaseButton)
|
||||
{
|
||||
Size ps = new Size(Dpi.Width9, Dpi.Height3);
|
||||
Rectangle rp = new Rectangle(r.X + (r.Width - ps.Width) / 2, r.Y + (r.Height - ps.Height) / 2, ps.Width, ps.Height);
|
||||
if (!ct.PartForeLightColor.IsEmpty)
|
||||
{
|
||||
using (Pen pen = new Pen(ct.PartForeLightColor, 1))
|
||||
g.DrawRectangle(pen, rp);
|
||||
}
|
||||
|
||||
if (!ct.PartForeColor.IsEmpty)
|
||||
{
|
||||
rp.Offset(1, 1);
|
||||
rp.Width--;
|
||||
rp.Height--;
|
||||
using (SolidBrush brush = new SolidBrush(ct.PartForeColor))
|
||||
g.FillRectangle(brush, rp);
|
||||
}
|
||||
}
|
||||
else if (part == eSliderPart.IncreaseButton)
|
||||
{
|
||||
Size ps = new Size(Dpi.Width8, Dpi.Height8);
|
||||
Rectangle rp = new Rectangle(r.X + (r.Width - ps.Width) / 2, r.Y + (r.Height - ps.Height) / 2, ps.Width, ps.Height);
|
||||
if (!ct.TrackLineLightColor.IsEmpty)
|
||||
{
|
||||
using (SolidBrush brush = new SolidBrush(ct.PartForeLightColor))
|
||||
{
|
||||
g.FillRectangle(brush, new Rectangle(rp.X, rp.Y + Dpi.Height3, rp.Width + Dpi.Width2, Dpi.Height4));
|
||||
g.FillRectangle(brush, new Rectangle(rp.X + Dpi.Width3, rp.Y, Dpi.Width4, Dpi.Height3));
|
||||
g.FillRectangle(brush, new Rectangle(rp.X + Dpi.Width3, rp.Bottom - Dpi.Height1, Dpi.Width4, Dpi.Height3));
|
||||
}
|
||||
}
|
||||
|
||||
if (!ct.TrackLineColor.IsEmpty)
|
||||
{
|
||||
using (SolidBrush brush = new SolidBrush(ct.PartForeColor))
|
||||
{
|
||||
g.FillRectangle(brush, new Rectangle(rp.X + Dpi.Width1, rp.Y + Dpi.Width4, rp.Width, Dpi.Width2));
|
||||
g.FillRectangle(brush, new Rectangle(rp.X + Dpi.Width4, rp.Y + Dpi.Height1, Dpi.Width2, Dpi.Height4));
|
||||
g.FillRectangle(brush, new Rectangle(rp.X + Dpi.Width4, rp.Bottom - Dpi.Width2, Dpi.Width2, Dpi.Height3));
|
||||
}
|
||||
}
|
||||
}
|
||||
g.SmoothingMode = sm;
|
||||
}
|
||||
else if (part == eSliderPart.TrackArea)
|
||||
{
|
||||
if (orientation == eOrientation.Vertical)
|
||||
{
|
||||
// Left
|
||||
Matrix m = new Matrix();
|
||||
m.RotateAt(-90, new PointF(r.X, r.Bottom));
|
||||
m.Translate(r.Height, r.Width - r.Height, MatrixOrder.Append);
|
||||
g.Transform = m;
|
||||
}
|
||||
if (StyleManager.IsMetro(effectiveStyle))
|
||||
{
|
||||
if (!ct.PartBackground.IsEmpty)
|
||||
{
|
||||
SmoothingMode sm = g.SmoothingMode;
|
||||
g.SmoothingMode = SmoothingMode.Default;
|
||||
Rectangle slideBounds = new Rectangle(r.X + (r.Width - Dpi.Width3) / 2, r.Y + Dpi.Width2, Dpi.Width3, r.Height - Dpi.Width4);
|
||||
using (Brush brush = DisplayHelp.CreateBrush(slideBounds, ct.PartBackground))
|
||||
{
|
||||
g.FillRectangle(brush, slideBounds);
|
||||
}
|
||||
g.SmoothingMode = sm;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
using (GraphicsPath path = new GraphicsPath())
|
||||
{
|
||||
int x1 = Dpi.Width11;
|
||||
path.AddLine(r.X, r.Y, r.X + x1, r.Y);
|
||||
path.AddLine(r.X + x1, r.Y, r.X + x1, r.Y + Dpi.Height9);
|
||||
path.AddLine(r.X + x1, r.Y + Dpi.Height9, r.X + Dpi.Width6, r.Y + Dpi.Height15);
|
||||
path.AddLine(r.X + Dpi.Width5, r.Y + Dpi.Height15, r.X, r.Y + Dpi.Width10);
|
||||
path.CloseAllFigures();
|
||||
using (SolidBrush brush = new SolidBrush(ct.PartBorderLightColor))
|
||||
g.FillPath(brush, path);
|
||||
}
|
||||
|
||||
SmoothingMode sm = g.SmoothingMode;
|
||||
g.SmoothingMode = SmoothingMode.AntiAlias;
|
||||
r.Offset(1, 1);
|
||||
using (GraphicsPath path = new GraphicsPath())
|
||||
{
|
||||
int n2 = Dpi.Width8;
|
||||
path.AddLine(r.X, r.Y, r.X + n2, r.Y);
|
||||
path.AddLine(r.X + n2, r.Y + n2, r.X + n2/2, r.Y + Dpi.Height12);
|
||||
path.AddLine(r.X, r.Y + n2, r.X, r.Y);
|
||||
path.CloseAllFigures();
|
||||
|
||||
if (ct.PartBackground.Colors.Count > 0)
|
||||
{
|
||||
using (Brush brush = DisplayHelp.CreateBrush(Rectangle.Ceiling(path.GetBounds()), ct.PartBackground))
|
||||
{
|
||||
g.FillPath(brush, path);
|
||||
}
|
||||
}
|
||||
|
||||
using (Pen pen = new Pen(ct.PartBorderColor, 1))
|
||||
g.DrawPath(pen, path);
|
||||
}
|
||||
|
||||
using (Pen pen = new Pen(Color.FromArgb(200, ct.PartForeColor), 1))
|
||||
g.DrawLine(pen, r.X + Dpi.Width4, r.Y + Dpi.Height3, r.X + Dpi.Width4, r.Y + Dpi.Height8);
|
||||
|
||||
using (Pen pen = new Pen(ct.PartForeLightColor, 1))
|
||||
g.DrawLine(pen, r.X + Dpi.Width5, r.Y + Dpi.Height4, r.X + Dpi.Width5, r.Y + Dpi.Height7);
|
||||
|
||||
g.SmoothingMode = sm;
|
||||
}
|
||||
|
||||
if (orientation == eOrientation.Vertical)
|
||||
g.ResetTransform();
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the color table for the Slider Item in single state.
|
||||
/// </summary>
|
||||
public class Office2007SliderStateColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the part background colors.
|
||||
/// </summary>
|
||||
public GradientColorTable PartBackground = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the part border color
|
||||
/// </summary>
|
||||
public Color PartBorderColor = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the part border light color
|
||||
/// </summary>
|
||||
public Color PartBorderLightColor = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the part foreground color.
|
||||
/// </summary>
|
||||
public Color PartForeColor = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the part foreground light color.
|
||||
/// </summary>
|
||||
public Color PartForeLightColor = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the track line color.
|
||||
/// </summary>
|
||||
public Color TrackLineColor = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the track line light color.
|
||||
/// </summary>
|
||||
public Color TrackLineLightColor = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the track label color.
|
||||
/// </summary>
|
||||
public Color LabelColor = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the track label color when on Slider control.
|
||||
/// </summary>
|
||||
public Color SliderLabelColor = Color.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the color table for the SuperTooltip.
|
||||
/// </summary>
|
||||
public class Office2007SuperTooltipColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the background colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable BackgroundColors = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the text color.
|
||||
/// </summary>
|
||||
public Color TextColor = Color.Empty;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents color table for Office 2007 style system button displayed in form caption.
|
||||
/// </summary>
|
||||
public class Office2007SystemButtonColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the color table of default button state.
|
||||
/// </summary>
|
||||
public Office2007SystemButtonStateColorTable Default = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color table of button state when mouse is over the button.
|
||||
/// </summary>
|
||||
public Office2007SystemButtonStateColorTable MouseOver = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color table of button state when mouse is pressed over the button.
|
||||
/// </summary>
|
||||
public Office2007SystemButtonStateColorTable Pressed = null;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents color table for single state of Office 2007 style system button displayed in form caption.
|
||||
/// </summary>
|
||||
public class Office2007SystemButtonStateColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the outer border colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable OuterBorder = new LinearGradientColorTable();
|
||||
/// <summary>
|
||||
/// Gets or sets the inner border colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable InnerBorder = new LinearGradientColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets top part background colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable TopBackground = new LinearGradientColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets bottom part background colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable BottomBackground = new LinearGradientColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets highlight colors for the top background part.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable TopHighlight = new LinearGradientColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets highlight colors for the bottom background part.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable BottomHighlight = new LinearGradientColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the foreground color for the button.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable Foreground = new LinearGradientColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the dark shading color for the foreground.
|
||||
/// </summary>
|
||||
public Color DarkShade = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the light shading color for the foreground.
|
||||
/// </summary>
|
||||
public Color LightShade = Color.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the color table for the tab control.
|
||||
/// </summary>
|
||||
public class Office2007TabColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the default tab item colors.
|
||||
/// </summary>
|
||||
public Office2007TabItemStateColorTable Default = new Office2007TabItemStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the mouse over tab item colors.
|
||||
/// </summary>
|
||||
public Office2007TabItemStateColorTable MouseOver = new Office2007TabItemStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the selected tab item colors.
|
||||
/// </summary>
|
||||
public Office2007TabItemStateColorTable Selected = new Office2007TabItemStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color of the tab background colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable TabBackground = new LinearGradientColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tab-strip background image.
|
||||
/// </summary>
|
||||
public Image TabBackgroundImage = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color of the tab panel background colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable TabPanelBackground = new LinearGradientColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color of tab panel border.
|
||||
/// </summary>
|
||||
public Color TabPanelBorder = Color.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the color table for the tab item.
|
||||
/// </summary>
|
||||
public class Office2007TabItemStateColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets top part background colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable TopBackground = new LinearGradientColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the bottom part background colors.
|
||||
/// </summary>
|
||||
public LinearGradientColorTable BottomBackground = new LinearGradientColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the outer border colors.
|
||||
/// </summary>
|
||||
public Color OuterBorder = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the inner border colors.
|
||||
/// </summary>
|
||||
public Color InnerBorder = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the text colors.
|
||||
/// </summary>
|
||||
public Color Text = Color.Empty;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,88 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines colors for the WarningBox control.
|
||||
/// </summary>
|
||||
public class Office2007WarningBoxColorTable
|
||||
{
|
||||
#region Default
|
||||
/// <summary>
|
||||
/// Gets or sets the background color of WarningBox control.
|
||||
/// </summary>
|
||||
public Color BackColor = Color.FromArgb(255, 196, 219, 249);
|
||||
/// <summary>
|
||||
/// Gets or sets the border color of the warning panel.
|
||||
/// </summary>
|
||||
public Color WarningBorderColor = Color.FromArgb(255, 162, 188, 213);
|
||||
/// <summary>
|
||||
/// Gets or sets the back color of the warning panel.
|
||||
/// </summary>
|
||||
public Color WarningBackColor1 = Color.FromArgb(255, 255, 255, 255);
|
||||
/// <summary>
|
||||
/// Gets or sets the end gradient back color of the warning panel.
|
||||
/// </summary>
|
||||
public Color WarningBackColor2 = Color.FromArgb(255, 229, 244, 254);
|
||||
#endregion
|
||||
|
||||
#region Green
|
||||
/// <summary>
|
||||
/// Gets or sets the background color of WarningBox control.
|
||||
/// </summary>
|
||||
public Color GreenBackColor = ColorScheme.GetColor(0xC6E5B8);
|
||||
/// <summary>
|
||||
/// Gets or sets the border color of the warning panel.
|
||||
/// </summary>
|
||||
public Color GreenWarningBorderColor = ColorScheme.GetColor(0x72A45A);
|
||||
/// <summary>
|
||||
/// Gets or sets the back color of the warning panel.
|
||||
/// </summary>
|
||||
public Color GreenWarningBackColor1 = ColorScheme.GetColor(0xC3D9B9);
|
||||
/// <summary>
|
||||
/// Gets or sets the end gradient back color of the warning panel.
|
||||
/// </summary>
|
||||
public Color GreenWarningBackColor2 = ColorScheme.GetColor(0x9CBF8B);
|
||||
#endregion
|
||||
|
||||
#region Yellow
|
||||
/// <summary>
|
||||
/// Gets or sets the background color of WarningBox control.
|
||||
/// </summary>
|
||||
public Color YellowBackColor = ColorScheme.GetColor(0xFFE69F);
|
||||
/// <summary>
|
||||
/// Gets or sets the border color of the warning panel.
|
||||
/// </summary>
|
||||
public Color YellowWarningBorderColor = ColorScheme.GetColor(0xEE9311);
|
||||
/// <summary>
|
||||
/// Gets or sets the back color of the warning panel.
|
||||
/// </summary>
|
||||
public Color YellowWarningBackColor1 = ColorScheme.GetColor(0xFFEBB6);
|
||||
/// <summary>
|
||||
/// Gets or sets the end gradient back color of the warning panel.
|
||||
/// </summary>
|
||||
public Color YellowWarningBackColor2 = ColorScheme.GetColor(0xFFDF86);
|
||||
#endregion
|
||||
|
||||
#region Red
|
||||
/// <summary>
|
||||
/// Gets or sets the background color of WarningBox control.
|
||||
/// </summary>
|
||||
public Color RedBackColor = ColorScheme.GetColor(0xDDACAC);
|
||||
/// <summary>
|
||||
/// Gets or sets the border color of the warning panel.
|
||||
/// </summary>
|
||||
public Color RedWarningBorderColor = ColorScheme.GetColor(0xC16969);
|
||||
/// <summary>
|
||||
/// Gets or sets the back color of the warning panel.
|
||||
/// </summary>
|
||||
public Color RedWarningBackColor1 = ColorScheme.GetColor(0xE5BFBF);
|
||||
/// <summary>
|
||||
/// Gets or sets the end gradient back color of the warning panel.
|
||||
/// </summary>
|
||||
public Color RedWarningBackColor2 = ColorScheme.GetColor(0xD39696);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
internal class Office2010AppButtonPainter : Office2007ButtonItemPainter
|
||||
{
|
||||
public override Office2007ButtonItemColorTable GetColorTable(ButtonItem button, eButtonContainer buttonCont)
|
||||
{
|
||||
Office2007ColorTable colorTable = this.ColorTable;
|
||||
Office2007ButtonItemColorTable buttonColorTable = null;
|
||||
|
||||
if (button.CustomColorName != "")
|
||||
buttonColorTable = colorTable.ApplicationButtonColors[button.CustomColorName];
|
||||
|
||||
if (buttonColorTable == null)
|
||||
buttonColorTable = colorTable.ApplicationButtonColors[button.GetColorTableName()];
|
||||
|
||||
if (buttonColorTable == null && colorTable.ApplicationButtonColors.Count > 0)
|
||||
buttonColorTable = colorTable.ApplicationButtonColors[0];
|
||||
|
||||
if (buttonColorTable == null) // Return fall-back color table
|
||||
buttonColorTable = Office2010ColorTable.GetFallBackAppButtonColorTable();
|
||||
|
||||
return buttonColorTable;
|
||||
}
|
||||
|
||||
public override void PaintButtonText(ButtonItem button, ItemPaintArgs pa, Color textColor, CompositeImage image)
|
||||
{
|
||||
Rectangle r = button.DisplayRectangle;
|
||||
r.Inflate(-1, -1);
|
||||
r.Width--;
|
||||
|
||||
Office2007ButtonItemColorTable colorTable = GetColorTable(button, eButtonContainer.RibbonStrip);
|
||||
Color shadowColor = Color.FromArgb(32, Color.Black);
|
||||
if (colorTable.Default != null && colorTable.Default.OuterBorder != null && !colorTable.Default.OuterBorder.IsEmpty)
|
||||
shadowColor = colorTable.Default.OuterBorder.Start;
|
||||
if (pa.GlassEnabled)
|
||||
{
|
||||
ThemeTextFormat textFormat = ThemeTextFormat.Center | ThemeTextFormat.VCenter | ThemeTextFormat.HidePrefix | ThemeTextFormat.SingleLine;
|
||||
Office2007RibbonControlPainter.PaintShadowTextOnGlass(pa.Graphics, button.Text, pa.Font, r, textFormat,textColor, shadowColor , true);
|
||||
}
|
||||
else
|
||||
{
|
||||
eTextFormat format = eTextFormat.HorizontalCenter | eTextFormat.VerticalCenter | eTextFormat.HidePrefix;
|
||||
// Shadow
|
||||
r.Offset(1, 1);
|
||||
TextDrawing.DrawString(pa.Graphics, button.Text, pa.Font, shadowColor, r, format);
|
||||
r.Offset(-1, -1);
|
||||
TextDrawing.DrawString(pa.Graphics, button.Text, pa.Font, textColor, r, format);
|
||||
}
|
||||
}
|
||||
|
||||
protected override Color GetTextColor(ButtonItem button, ItemPaintArgs pa)
|
||||
{
|
||||
return base.GetTextColor(button, pa, GetColorTable(button, eButtonContainer.RibbonStrip));
|
||||
}
|
||||
|
||||
public override void PaintButtonImage(ButtonItem button, ItemPaintArgs pa, CompositeImage image, Rectangle imagebounds)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(button.Text)) return;
|
||||
Rectangle r = button.DisplayRectangle;
|
||||
r.X = r.X + (r.Width - imagebounds.Width) / 2;
|
||||
r.Y = r.Y + (r.Height - imagebounds.Height) / 2;
|
||||
r.Width = imagebounds.Width;
|
||||
r.Height = imagebounds.Height;
|
||||
base.PaintButtonImage(button, pa, image, r);
|
||||
}
|
||||
|
||||
public override void PaintButtonBackground(ButtonItem button, ItemPaintArgs pa, CompositeImage image)
|
||||
{
|
||||
Office2007ButtonItemColorTable colors = GetColorTable(button, eButtonContainer.RibbonStrip);
|
||||
Office2007ButtonItemStateColorTable stateColors = colors.Default;
|
||||
if (button.IsMouseDown)
|
||||
stateColors = colors.Pressed;
|
||||
else if (button.IsMouseOver)
|
||||
stateColors = colors.MouseOver;
|
||||
Rectangle bounds = button.DisplayRectangle;
|
||||
bounds.Width--;
|
||||
Graphics g = pa.Graphics;
|
||||
|
||||
using (GraphicsPath borderPath = DisplayHelp.GetRoundedRectanglePath(bounds, 2, 2, 0, 0))
|
||||
{
|
||||
DisplayHelp.FillPath(g, borderPath, stateColors.Background);
|
||||
|
||||
if (stateColors.BottomBackgroundHighlight != null && !stateColors.BottomBackgroundHighlight.IsEmpty)
|
||||
{
|
||||
Rectangle ellipse = new Rectangle(bounds.X - 12, bounds.Y + bounds.Height / 2 - 4, bounds.Width + 24, bounds.Height + 4);
|
||||
using (GraphicsPath path = new GraphicsPath())
|
||||
{
|
||||
path.AddEllipse(ellipse);
|
||||
using (PathGradientBrush brush = new PathGradientBrush(path))
|
||||
{
|
||||
brush.CenterColor = stateColors.BottomBackgroundHighlight.Start;
|
||||
brush.SurroundColors = new Color[] { stateColors.BottomBackgroundHighlight.End };
|
||||
brush.CenterPoint = new PointF(ellipse.X + ellipse.Width / 2, bounds.Bottom - 1);
|
||||
|
||||
g.FillRectangle(brush, bounds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (stateColors.InnerBorder != null && !stateColors.InnerBorder.IsEmpty)
|
||||
{
|
||||
Rectangle innerBorder = bounds;
|
||||
innerBorder.Y += 1;
|
||||
innerBorder.Width -= 1;
|
||||
innerBorder.X++;
|
||||
DisplayHelp.DrawGradientRectangle(g, innerBorder, stateColors.InnerBorder, 1);
|
||||
//using (GraphicsPath innerBorderPath = DisplayHelp.GetRoundedRectanglePath(innerBorder, 1, 1, 0, 0))
|
||||
//{
|
||||
// DisplayHelp.DrawGradientPathBorder(g, innerBorderPath, stateColors.InnerBorder, 1);
|
||||
//}
|
||||
using (Pen pen = new Pen(ColorScheme.GetColor(10, 0xffffff)))
|
||||
{
|
||||
g.DrawLine(pen, innerBorder.X + 1, innerBorder.Y + 1, innerBorder.X + 1, innerBorder.Bottom - 1);
|
||||
g.DrawLine(pen, innerBorder.Right - 2, innerBorder.Y + 1, innerBorder.Right - 2, innerBorder.Bottom - 1);
|
||||
}
|
||||
}
|
||||
|
||||
DisplayHelp.DrawGradientPathBorder(g, borderPath, stateColors.OuterBorder, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,295 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents color table for Office 2010 style.
|
||||
/// </summary>
|
||||
public class Office2010ColorTable : Office2007ColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the Office2010ColorTable class.
|
||||
/// </summary>
|
||||
public Office2010ColorTable()
|
||||
{
|
||||
Office2010BlueFactory.InitializeColorTable(this, ColorFactory.Empty);
|
||||
InitAppButtonColors(this, ColorFactory.Empty);
|
||||
}
|
||||
|
||||
public Office2010ColorTable(eOffice2010ColorScheme color)
|
||||
{
|
||||
if(color == eOffice2010ColorScheme.Blue)
|
||||
Office2010BlueFactory.InitializeColorTable(this, ColorFactory.Empty);
|
||||
else if(color == eOffice2010ColorScheme.Silver)
|
||||
Office2010SilverFactory.InitializeColorTable(this, ColorFactory.Empty);
|
||||
else if (color == eOffice2010ColorScheme.Black)
|
||||
Office2010BlackFactory.InitializeColorTable(this, ColorFactory.Empty);
|
||||
else if (color == eOffice2010ColorScheme.VS2010)
|
||||
VisualStudio2010Factory.InitializeColorTable(this, ColorFactory.Empty);
|
||||
InitAppButtonColors(this, ColorFactory.Empty);
|
||||
_ColorScheme = color;
|
||||
}
|
||||
|
||||
public Office2010ColorTable(eOffice2010ColorScheme color, Color blendColor)
|
||||
{
|
||||
ColorFactory factory = blendColor.IsEmpty ? ColorFactory.Empty : new ColorBlendFactory(blendColor);
|
||||
if (color == eOffice2010ColorScheme.Blue)
|
||||
Office2010BlueFactory.InitializeColorTable(this, factory);
|
||||
else if (color == eOffice2010ColorScheme.Silver)
|
||||
Office2010SilverFactory.InitializeColorTable(this, factory);
|
||||
else if (color == eOffice2010ColorScheme.Black)
|
||||
Office2010BlackFactory.InitializeColorTable(this, factory);
|
||||
else if (color == eOffice2010ColorScheme.VS2010)
|
||||
VisualStudio2010Factory.InitializeColorTable(this, factory);
|
||||
InitAppButtonColors(this, factory);
|
||||
_ColorScheme = color;
|
||||
}
|
||||
|
||||
private eOffice2010ColorScheme _ColorScheme;
|
||||
/// <summary>
|
||||
/// Gets the color scheme color table is initialized with.
|
||||
/// </summary>
|
||||
public eOffice2010ColorScheme ColorScheme
|
||||
{
|
||||
get { return _ColorScheme; }
|
||||
}
|
||||
|
||||
#region Application Button Colors
|
||||
private static Office2007ButtonItemColorTable FallBackAppButtonColorTable = null;
|
||||
internal static Office2007ButtonItemColorTable GetFallBackAppButtonColorTable()
|
||||
{
|
||||
if (FallBackAppButtonColorTable != null) return FallBackAppButtonColorTable;
|
||||
|
||||
// Blue default
|
||||
Office2007ButtonItemColorTable table = new Office2007ButtonItemColorTable();
|
||||
table.Name = Enum.GetName(typeof(eButtonColor), eButtonColor.Blue);
|
||||
|
||||
Office2007ButtonItemStateColorTable ct = new Office2007ButtonItemStateColorTable();
|
||||
ct.Background = new LinearGradientColorTable(0x3E7DDB, 0x265FB2);
|
||||
ct.BottomBackgroundHighlight = new LinearGradientColorTable(DevComponents.DotNetBar.ColorScheme.GetColor(64, 0xFFFFFF), Color.Transparent);
|
||||
ct.OuterBorder = new LinearGradientColorTable(0x1E48A0, 0x244FA6);
|
||||
ct.InnerBorder = new LinearGradientColorTable(32, 0xFFFFFF);
|
||||
ct.Text = DevComponents.DotNetBar.ColorScheme.GetColor(0xFFFFFF);
|
||||
table.Default = ct;
|
||||
|
||||
ct = new Office2007ButtonItemStateColorTable();
|
||||
ct.Background = new LinearGradientColorTable(0x4786E5, 0x2D65BC);
|
||||
ct.BottomBackgroundHighlight = new LinearGradientColorTable(DevComponents.DotNetBar.ColorScheme.GetColor(82, 0xFFFFFF), Color.Transparent);
|
||||
ct.OuterBorder = new LinearGradientColorTable(0x1F48A1, 0x2954A9);
|
||||
ct.InnerBorder = new LinearGradientColorTable(DevComponents.DotNetBar.ColorScheme.GetColor(72, 0xFFFFFF), DevComponents.DotNetBar.ColorScheme.GetColor(48, 0xFFFFFF));
|
||||
ct.Text = DevComponents.DotNetBar.ColorScheme.GetColor(0xFFFFFF);
|
||||
table.MouseOver = ct;
|
||||
|
||||
ct = new Office2007ButtonItemStateColorTable();
|
||||
ct.Background = new LinearGradientColorTable(0x2861B6, 0x1D5AB2);
|
||||
ct.BottomBackgroundHighlight = new LinearGradientColorTable(DevComponents.DotNetBar.ColorScheme.GetColor(82, 0xFFFFFF), Color.Transparent);
|
||||
ct.OuterBorder = new LinearGradientColorTable(0x1F48A1, 0x224EA6);
|
||||
ct.InnerBorder = new LinearGradientColorTable(DevComponents.DotNetBar.ColorScheme.GetColor(72, 0xFFFFFF), DevComponents.DotNetBar.ColorScheme.GetColor(48, 0xFFFFFF));
|
||||
ct.Text = DevComponents.DotNetBar.ColorScheme.GetColor(0xFFFFFF);
|
||||
table.Pressed = ct;
|
||||
|
||||
table.Expanded = table.Pressed;
|
||||
table.Checked = table.Pressed;
|
||||
|
||||
FallBackAppButtonColorTable = table;
|
||||
return table;
|
||||
}
|
||||
internal static void InitAppButtonColors(Office2007ColorTable colorTable, ColorFactory factory)
|
||||
{
|
||||
Office2007ButtonItemColorTableCollection colors = colorTable.ApplicationButtonColors;
|
||||
colors.Clear();
|
||||
|
||||
// Blue default
|
||||
Office2007ButtonItemColorTable table = new Office2007ButtonItemColorTable();
|
||||
table.Name = Enum.GetName(typeof(eButtonColor), eButtonColor.Blue);
|
||||
|
||||
Office2007ButtonItemStateColorTable ct = new Office2007ButtonItemStateColorTable();
|
||||
ct.Background = new LinearGradientColorTable(factory.GetColor(0x3E7DDB), factory.GetColor(0x265FB2));
|
||||
ct.BottomBackgroundHighlight = new LinearGradientColorTable(factory.GetColor(64, 0xFFFFFF), Color.Transparent);
|
||||
ct.OuterBorder = new LinearGradientColorTable(factory.GetColor(0x1E48A0), factory.GetColor(0x244FA6));
|
||||
ct.InnerBorder = new LinearGradientColorTable(factory.GetColor(32, 0xFFFFFF));
|
||||
ct.Text = factory.GetColor(0xFFFFFF);
|
||||
table.Default = ct;
|
||||
|
||||
ct = new Office2007ButtonItemStateColorTable();
|
||||
ct.Background = new LinearGradientColorTable(factory.GetColor(0x4786E5), factory.GetColor(0x2D65BC));
|
||||
ct.BottomBackgroundHighlight = new LinearGradientColorTable(factory.GetColor(82, 0xFFFFFF), Color.Transparent);
|
||||
ct.OuterBorder = new LinearGradientColorTable(factory.GetColor(0x1F48A1), factory.GetColor(0x2954A9));
|
||||
ct.InnerBorder = new LinearGradientColorTable(factory.GetColor(72, 0xFFFFFF), factory.GetColor(48, 0xFFFFFF)); //new LinearGradientColorTable(factory.GetColor(0x55A1F3), factory.GetColor(0x4F9EEE));
|
||||
ct.Text = factory.GetColor(0xFFFFFF);
|
||||
table.MouseOver = ct;
|
||||
|
||||
ct = new Office2007ButtonItemStateColorTable();
|
||||
ct.Background = new LinearGradientColorTable(factory.GetColor(0x2861B6), factory.GetColor(0x1D5AB2));
|
||||
ct.BottomBackgroundHighlight = new LinearGradientColorTable(factory.GetColor(82, 0xFFFFFF), Color.Transparent);
|
||||
ct.OuterBorder = new LinearGradientColorTable(factory.GetColor(0x1F48A1), factory.GetColor(0x224EA6));
|
||||
ct.InnerBorder = new LinearGradientColorTable(factory.GetColor(72, 0xFFFFFF), factory.GetColor(48, 0xFFFFFF)); //new LinearGradientColorTable(factory.GetColor(0x55A1F3), factory.GetColor(0x4F9EEE));
|
||||
ct.Text = factory.GetColor(0xFFFFFF);
|
||||
table.Pressed = ct;
|
||||
|
||||
table.Expanded = table.Pressed;
|
||||
table.Checked = table.Pressed;
|
||||
|
||||
colors.Add(table);
|
||||
|
||||
// Magenta
|
||||
table = new Office2007ButtonItemColorTable();
|
||||
table.Name = Enum.GetName(typeof(eButtonColor), eButtonColor.Magenta);
|
||||
|
||||
ct = new Office2007ButtonItemStateColorTable();
|
||||
ct.Background = new LinearGradientColorTable(factory.GetColor(0xCC256B), factory.GetColor(0xB10851));
|
||||
ct.BottomBackgroundHighlight = new LinearGradientColorTable(factory.GetColor(64, 0xFFFFFF), Color.Transparent);
|
||||
ct.OuterBorder = new LinearGradientColorTable(factory.GetColor(0x8F013C), factory.GetColor(0x940741));
|
||||
ct.InnerBorder = new LinearGradientColorTable(factory.GetColor(32, 0xFFFFFF));
|
||||
ct.Text = factory.GetColor(0xFFFFFF);
|
||||
table.Default = ct;
|
||||
|
||||
ct = new Office2007ButtonItemStateColorTable();
|
||||
ct.Background = new LinearGradientColorTable(factory.GetColor(0xD63272), factory.GetColor(0xB10B52));
|
||||
ct.BottomBackgroundHighlight = new LinearGradientColorTable(factory.GetColor(82, 0xFFFFFF), Color.Transparent);
|
||||
ct.OuterBorder = new LinearGradientColorTable(factory.GetColor(0x8F013C), factory.GetColor(0x950942));
|
||||
ct.InnerBorder = new LinearGradientColorTable(factory.GetColor(72, 0xFFFFFF), factory.GetColor(48, 0xFFFFFF)); //new LinearGradientColorTable(factory.GetColor(0x55A1F3), factory.GetColor(0x4F9EEE));
|
||||
ct.Text = factory.GetColor(0xFFFFFF);
|
||||
table.MouseOver = ct;
|
||||
|
||||
ct = new Office2007ButtonItemStateColorTable();
|
||||
ct.Background = new LinearGradientColorTable(factory.GetColor(0xB50C53), factory.GetColor(0xB00B52));
|
||||
ct.BottomBackgroundHighlight = new LinearGradientColorTable(factory.GetColor(82, 0xFFFFFF), Color.Transparent);
|
||||
ct.OuterBorder = new LinearGradientColorTable(factory.GetColor(0x8F013D), factory.GetColor(0x950741));
|
||||
ct.InnerBorder = new LinearGradientColorTable(factory.GetColor(72, 0xFFFFFF), factory.GetColor(48, 0xFFFFFF)); //new LinearGradientColorTable(factory.GetColor(0x55A1F3), factory.GetColor(0x4F9EEE));
|
||||
ct.Text = factory.GetColor(0xFFFFFF);
|
||||
table.Pressed = ct;
|
||||
|
||||
table.Expanded = table.Pressed;
|
||||
table.Checked = table.Pressed;
|
||||
|
||||
colors.Add(table);
|
||||
|
||||
// Orange
|
||||
table = new Office2007ButtonItemColorTable();
|
||||
table.Name = Enum.GetName(typeof(eButtonColor), eButtonColor.Orange);
|
||||
|
||||
ct = new Office2007ButtonItemStateColorTable();
|
||||
ct.Background = new LinearGradientColorTable(factory.GetColor(0xF27350), factory.GetColor(0xE5552F));
|
||||
ct.BottomBackgroundHighlight = new LinearGradientColorTable(factory.GetColor(0xF89E42), Color.Transparent);
|
||||
ct.OuterBorder = new LinearGradientColorTable(factory.GetColor(0xCC2B12), factory.GetColor(0xCF3415));
|
||||
ct.InnerBorder = new LinearGradientColorTable(factory.GetColor(0xF68954), factory.GetColor(0xF78B3E));
|
||||
ct.Text = factory.GetColor(0xFFFFFF);
|
||||
table.Default = ct;
|
||||
|
||||
ct = new Office2007ButtonItemStateColorTable();
|
||||
ct.Background = new LinearGradientColorTable(factory.GetColor(0xF87E4D), factory.GetColor(0xE6552E));
|
||||
ct.BottomBackgroundHighlight = new LinearGradientColorTable(factory.GetColor(0xFBBD5E), Color.Transparent);
|
||||
ct.OuterBorder = new LinearGradientColorTable(factory.GetColor(0xCA2810), factory.GetColor(0xCD3217));
|
||||
ct.InnerBorder = new LinearGradientColorTable(factory.GetColor(0xFBAA5A), factory.GetColor(0xFCB857)); //new LinearGradientColorTable(factory.GetColor(0x55A1F3), factory.GetColor(0x4F9EEE));
|
||||
ct.Text = factory.GetColor(0xFFFFFF);
|
||||
table.MouseOver = ct;
|
||||
|
||||
ct = new Office2007ButtonItemStateColorTable();
|
||||
ct.Background = new LinearGradientColorTable(factory.GetColor(0xE3531D), factory.GetColor(0xE04E19));
|
||||
ct.BottomBackgroundHighlight = new LinearGradientColorTable(factory.GetColor(0xFDAF4C), Color.Transparent);
|
||||
ct.OuterBorder = new LinearGradientColorTable(factory.GetColor(0xCA2810), factory.GetColor(0xCD3013));
|
||||
ct.InnerBorder = new LinearGradientColorTable(factory.GetColor(0xE86229), factory.GetColor(0xFB8D44)); //new LinearGradientColorTable(factory.GetColor(0x55A1F3), factory.GetColor(0x4F9EEE));
|
||||
ct.Text = factory.GetColor(0xFFFFFF);
|
||||
table.Pressed = ct;
|
||||
|
||||
table.Expanded = table.Pressed;
|
||||
table.Checked = table.Pressed;
|
||||
|
||||
colors.Add(table);
|
||||
|
||||
// Green
|
||||
table = new Office2007ButtonItemColorTable();
|
||||
table.Name = Enum.GetName(typeof(eButtonColor), eButtonColor.BlueWithBackground);
|
||||
|
||||
ct = new Office2007ButtonItemStateColorTable();
|
||||
ct.Background = new LinearGradientColorTable(factory.GetColor(0x459731), factory.GetColor(0x2B7F2C));
|
||||
ct.BottomBackgroundHighlight = new LinearGradientColorTable(factory.GetColor(0x6BCA45), Color.Transparent);
|
||||
ct.OuterBorder = new LinearGradientColorTable(factory.GetColor(0x186337), factory.GetColor(0x1E6A39));
|
||||
ct.InnerBorder = new LinearGradientColorTable(factory.GetColor(0x4CA231), factory.GetColor(0x53B331));
|
||||
ct.Text = factory.GetColor(0xFFFFFF);
|
||||
table.Default = ct;
|
||||
|
||||
ct = new Office2007ButtonItemStateColorTable();
|
||||
ct.Background = new LinearGradientColorTable(factory.GetColor(0x469734), factory.GetColor(0x267C2B));
|
||||
ct.BottomBackgroundHighlight = new LinearGradientColorTable(factory.GetColor(0x89D668), Color.Transparent);
|
||||
ct.OuterBorder = new LinearGradientColorTable(factory.GetColor(0x196437), factory.GetColor(0x216B3C));
|
||||
ct.InnerBorder = new LinearGradientColorTable(factory.GetColor(0x65B943), factory.GetColor(0x70CC4A));
|
||||
ct.Text = factory.GetColor(0xFFFFFF);
|
||||
table.MouseOver = ct;
|
||||
|
||||
ct = new Office2007ButtonItemStateColorTable();
|
||||
ct.Background = new LinearGradientColorTable(factory.GetColor(0x2F822A), factory.GetColor(0x2A7E2C));
|
||||
ct.BottomBackgroundHighlight = new LinearGradientColorTable(factory.GetColor(0x68CB38), Color.Transparent);
|
||||
ct.OuterBorder = new LinearGradientColorTable(factory.GetColor(0x186437), factory.GetColor(0x1D6A38));
|
||||
ct.InnerBorder = new LinearGradientColorTable(factory.GetColor(0x368F2B), factory.GetColor(0x59BD2D)); //new LinearGradientColorTable(factory.GetColor(0x55A1F3), factory.GetColor(0x4F9EEE));
|
||||
ct.Text = factory.GetColor(0xFFFFFF);
|
||||
table.Pressed = ct;
|
||||
|
||||
table.Expanded = table.Pressed;
|
||||
table.Checked = table.Pressed;
|
||||
|
||||
colors.Add(table);
|
||||
|
||||
// Teal
|
||||
table = new Office2007ButtonItemColorTable();
|
||||
table.Name = Enum.GetName(typeof(eButtonColor), eButtonColor.MagentaWithBackground);
|
||||
|
||||
ct = new Office2007ButtonItemStateColorTable();
|
||||
ct.Background = new LinearGradientColorTable(factory.GetColor(0x159795), factory.GetColor(0x018281));
|
||||
ct.BottomBackgroundHighlight = new LinearGradientColorTable(factory.GetColor(0x20B7B4), Color.Transparent);
|
||||
ct.OuterBorder = new LinearGradientColorTable(factory.GetColor(0x055E5E), factory.GetColor(0x076464));
|
||||
ct.InnerBorder = new LinearGradientColorTable(factory.GetColor(0x1BA29D), factory.GetColor(0x1FB1A9));
|
||||
ct.Text = factory.GetColor(0xFFFFFF);
|
||||
table.Default = ct;
|
||||
|
||||
ct = new Office2007ButtonItemStateColorTable();
|
||||
ct.Background = new LinearGradientColorTable(factory.GetColor(0x1F9C99), factory.GetColor(0x038584));
|
||||
ct.BottomBackgroundHighlight = new LinearGradientColorTable(factory.GetColor(0x36CDCA), Color.Transparent);
|
||||
ct.OuterBorder = new LinearGradientColorTable(factory.GetColor(0x055E5E), factory.GetColor(0x096767));
|
||||
ct.InnerBorder = new LinearGradientColorTable(factory.GetColor(0x30B8B3), factory.GetColor(0x34C2BE));
|
||||
ct.Text = factory.GetColor(0xFFFFFF);
|
||||
table.MouseOver = ct;
|
||||
|
||||
ct = new Office2007ButtonItemStateColorTable();
|
||||
ct.Background = new LinearGradientColorTable(factory.GetColor(0x028482), factory.GetColor(0x028081));
|
||||
ct.BottomBackgroundHighlight = new LinearGradientColorTable(factory.GetColor(0x2CC2BE), Color.Transparent);
|
||||
ct.OuterBorder = new LinearGradientColorTable(factory.GetColor(0x055E5E), factory.GetColor(0x086565));
|
||||
ct.InnerBorder = new LinearGradientColorTable(factory.GetColor(0x028F8D), factory.GetColor(0x1DB4AD)); //new LinearGradientColorTable(factory.GetColor(0x55A1F3), factory.GetColor(0x4F9EEE));
|
||||
ct.Text = factory.GetColor(0xFFFFFF);
|
||||
table.Pressed = ct;
|
||||
|
||||
table.Expanded = table.Pressed;
|
||||
table.Checked = table.Pressed;
|
||||
|
||||
colors.Add(table);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the color scheme type for the Office2010ColorTable.
|
||||
/// </summary>
|
||||
public enum eOffice2010ColorScheme
|
||||
{
|
||||
/// <summary>
|
||||
/// Silver color scheme.
|
||||
/// </summary>
|
||||
Silver,
|
||||
/// <summary>
|
||||
/// Blue color scheme.
|
||||
/// </summary>
|
||||
Blue,
|
||||
/// <summary>
|
||||
/// Black color scheme.
|
||||
/// </summary>
|
||||
Black,
|
||||
/// <summary>
|
||||
/// Visual Studio 2010 Blue color scheme.
|
||||
/// </summary>
|
||||
VS2010
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
internal class Office2010NavPaneButtonPainter : Office2007ButtonItemPainter
|
||||
{
|
||||
protected override void PaintStateBackground(ButtonItem button, Graphics g, Office2007ButtonItemStateColorTable stateColors, Rectangle r, IShapeDescriptor shape, bool isDefault, bool paintBorder)
|
||||
{
|
||||
if (stateColors == null || stateColors.Background == null || stateColors.Background.IsEmpty)
|
||||
return;
|
||||
|
||||
Rectangle shadowRect = r;
|
||||
ShadowPaintInfo spi = new ShadowPaintInfo();
|
||||
spi.Graphics = g;
|
||||
spi.Rectangle = shadowRect;
|
||||
ShadowPainter.Paint3(spi);
|
||||
|
||||
r.Width -= 4;
|
||||
r.Height -= 4;
|
||||
r.Offset(1, 1);
|
||||
|
||||
DisplayHelp.FillRectangle(g, r, stateColors.Background);
|
||||
if (stateColors.BottomBackgroundHighlight != null && !stateColors.BottomBackgroundHighlight.IsEmpty)
|
||||
{
|
||||
Rectangle ellipse = new Rectangle(r.X, r.Y + r.Height / 2 - 2, r.Width, r.Height + 4);
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
path.AddEllipse(ellipse);
|
||||
PathGradientBrush brush = new PathGradientBrush(path);
|
||||
brush.CenterColor = stateColors.BottomBackgroundHighlight.Start;
|
||||
brush.SurroundColors = new Color[] { stateColors.BottomBackgroundHighlight.End };
|
||||
brush.CenterPoint = new PointF(ellipse.X + ellipse.Width / 2, r.Bottom);
|
||||
Blend blend = new Blend();
|
||||
blend.Factors = new float[] { 0f, .5f, .6f };
|
||||
blend.Positions = new float[] { .0f, .4f, 1f };
|
||||
brush.Blend = blend;
|
||||
|
||||
g.FillRectangle(brush, r);
|
||||
brush.Dispose();
|
||||
path.Dispose();
|
||||
}
|
||||
|
||||
DisplayHelp.DrawGradientRectangle(g, r, stateColors.OuterBorder, 1);
|
||||
r.Inflate(-1, -1);
|
||||
DisplayHelp.DrawGradientRectangle(g, r, stateColors.InnerBorder, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the color table for the Range Slider Item in single state.
|
||||
/// </summary>
|
||||
public class Office2010RangeSliderColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the slider which changes the minimum value of the range.
|
||||
/// </summary>
|
||||
public Office2010RangeSliderPartStateColorTable MinRangeSlider = new Office2010RangeSliderPartStateColorTable();
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the slider which changes the maximum value of the range.
|
||||
/// </summary>
|
||||
public Office2010RangeSliderPartStateColorTable MaxRangeSlider = new Office2010RangeSliderPartStateColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tick line color.
|
||||
/// </summary>
|
||||
public Color TickLineColor = Color.Empty;
|
||||
/// <summary>
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color for the line which indicates current range value.
|
||||
/// </summary>
|
||||
public Color RangeValueLineColor = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the background colors of the current range value.
|
||||
/// </summary>
|
||||
public GradientColorTable RangeValueBackground = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color for the line showing control range.
|
||||
/// </summary>
|
||||
public Color RangeLineColor = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets the background colors for the line showing control range.
|
||||
/// </summary>
|
||||
public GradientColorTable RangeBackground = null;
|
||||
/// <summary>
|
||||
/// Gets or sets the corner radius for the range rectangle.
|
||||
/// </summary>
|
||||
public int RangeCornerRadius = 1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the color table for the Range Slider Item in single state.
|
||||
/// </summary>
|
||||
public class Office2010RangeSliderPartStateColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the default state colors.
|
||||
/// </summary>
|
||||
public Office2010RangeChangePartColorTable Default = new Office2010RangeChangePartColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the mouse over state colors.
|
||||
/// </summary>
|
||||
public Office2010RangeChangePartColorTable MouseOver = new Office2010RangeChangePartColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the mouse pressed colors.
|
||||
/// </summary>
|
||||
public Office2010RangeChangePartColorTable Pressed = new Office2010RangeChangePartColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the disabled colors.
|
||||
/// </summary>
|
||||
public Office2010RangeChangePartColorTable Disabled = new Office2010RangeChangePartColorTable();
|
||||
}
|
||||
|
||||
public class Office2010RangeChangePartColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the Office2010RangeChangePartColorTable class.
|
||||
/// </summary>
|
||||
public Office2010RangeChangePartColorTable()
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the Office2010RangeChangePartColorTable class.
|
||||
/// </summary>
|
||||
/// <param name="background"></param>
|
||||
/// <param name="borderColor"></param>
|
||||
/// <param name="borderLightColor"></param>
|
||||
public Office2010RangeChangePartColorTable(GradientColorTable background, Color borderColor, Color borderLightColor)
|
||||
{
|
||||
Background = background;
|
||||
BorderColor = borderColor;
|
||||
BorderLightColor = borderLightColor;
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or sets the part background colors.
|
||||
/// </summary>
|
||||
public GradientColorTable Background = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the part border color
|
||||
/// </summary>
|
||||
public Color BorderColor = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the part border light color
|
||||
/// </summary>
|
||||
public Color BorderLightColor = Color.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,463 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing;
|
||||
using System.Threading;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
internal class Office2010RangeSliderPainter : RangeSliderPainter, IOffice2007Painter
|
||||
{
|
||||
#region IOffice2007Painter
|
||||
private Office2007ColorTable _ColorTable = null; //new Office2007ColorTable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets color table used by renderer.
|
||||
/// </summary>
|
||||
public Office2007ColorTable ColorTable
|
||||
{
|
||||
get { return _ColorTable; }
|
||||
set { _ColorTable = value; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Implementation
|
||||
public override void Paint(RangeSliderItemRendererEventArgs e)
|
||||
{
|
||||
RangeSliderItem item = e.SliderItem;
|
||||
ItemPaintArgs p = e.ItemPaintArgs;
|
||||
Graphics g = e.Graphics;
|
||||
Office2010RangeSliderColorTable table = GetColorTable(item, p.ContainerControl);
|
||||
eOrientation sliderOrientation = item.SliderOrientation;
|
||||
RangeValue minmaxValue = item.GetNormalizedMinMaxValues();
|
||||
int min = minmaxValue.Min;
|
||||
int max = minmaxValue.Max;
|
||||
RangeValue value = item.GetNormalizedRangeValue();
|
||||
|
||||
if (table == null)
|
||||
{
|
||||
g.FillRectangle(Brushes.Gray, item.Bounds);
|
||||
return;
|
||||
}
|
||||
|
||||
if (item.RangeLineHeight > 0)
|
||||
{
|
||||
Rectangle rangeBounds;
|
||||
if (item.SliderOrientation == eOrientation.Horizontal)
|
||||
{
|
||||
rangeBounds = new Rectangle(item.TicksBounds.X,
|
||||
item.RangeButtonMinBounds.Y + (item.RangeButtonMinBounds.Height - item.RangeLineHeight) / 2 + 1,
|
||||
item.TicksBounds.Width, item.RangeLineHeight);
|
||||
}
|
||||
else
|
||||
{
|
||||
rangeBounds = new Rectangle(
|
||||
item.RangeButtonMinBounds.X + (item.RangeButtonMinBounds.Width - item.RangeLineHeight) / 2,
|
||||
item.TicksBounds.Y,
|
||||
item.RangeLineHeight, item.TicksBounds.Height);
|
||||
}
|
||||
if (table.RangeBackground != null)
|
||||
{
|
||||
table.RangeBackground.LinearGradientAngle = (item.SliderOrientation == eOrientation.Horizontal) ? 90 : 180;
|
||||
Rectangle rb = rangeBounds;
|
||||
rb.Offset(item.Bounds.Location);
|
||||
rb.Height--;
|
||||
using (Brush brush = DisplayHelp.CreateBrush(rb, table.RangeBackground))
|
||||
DisplayHelp.FillRoundedRectangle(g, brush, rb, table.RangeCornerRadius);
|
||||
rb.Height++;
|
||||
if (!table.RangeLineColor.IsEmpty)
|
||||
DisplayHelp.DrawRoundedRectangle(g, table.RangeLineColor, rb, table.RangeCornerRadius);
|
||||
}
|
||||
if (table.RangeValueBackground != null)
|
||||
{
|
||||
if (item.SliderOrientation == eOrientation.Horizontal)
|
||||
{
|
||||
rangeBounds.X = item.RangeButtonMinBounds.Right;
|
||||
rangeBounds.Width = item.RangeButtonMaxBounds.X - item.RangeButtonMinBounds.Right;
|
||||
}
|
||||
else
|
||||
{
|
||||
rangeBounds.Y = item.RangeButtonMinBounds.Bottom;
|
||||
rangeBounds.Height = item.RangeButtonMaxBounds.Y - item.RangeButtonMinBounds.Bottom;
|
||||
}
|
||||
Rectangle rb = rangeBounds;
|
||||
rb.Offset(item.Bounds.Location);
|
||||
table.RangeValueBackground.LinearGradientAngle = (item.SliderOrientation == eOrientation.Horizontal) ? 90 : 180;
|
||||
rb.Height--;
|
||||
if (item.RangeValueColor.IsEmpty)
|
||||
{
|
||||
using (Brush brush = DisplayHelp.CreateBrush(rb, table.RangeValueBackground))
|
||||
g.FillRectangle(brush, rb);
|
||||
}
|
||||
else
|
||||
{
|
||||
using(SolidBrush brush=new SolidBrush(item.RangeValueColor))
|
||||
g.FillRectangle(brush, rb);
|
||||
}
|
||||
rb.Height++;
|
||||
if (!table.RangeValueLineColor.IsEmpty)
|
||||
{
|
||||
using (Pen pen = new Pen(table.RangeValueLineColor))
|
||||
{
|
||||
if (item.SliderOrientation == eOrientation.Horizontal)
|
||||
{
|
||||
g.DrawLine(pen, rb.X, rb.Y, rb.Right, rb.Y);
|
||||
g.DrawLine(pen, rb.X, rb.Bottom - 1, rb.Right, rb.Bottom - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
g.DrawLine(pen, rb.X, rb.Y, rb.X, rb.Bottom);
|
||||
g.DrawLine(pen, rb.Right - 1, rb.Y, rb.Right - 1, rb.Bottom);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (item.TicksVisible && !table.TickLineColor.IsEmpty)
|
||||
{
|
||||
Rectangle ticksBounds = item.TicksBounds;
|
||||
ticksBounds.Offset(item.Bounds.Location);
|
||||
int steps = item.TicksStep;
|
||||
//g.FillRectangle(Brushes.Yellow, ticksBounds);
|
||||
if (sliderOrientation == eOrientation.Horizontal)
|
||||
{
|
||||
DrawHTicks(g, table, min, max, ticksBounds, steps);
|
||||
if (!item.TicksBounds2.IsEmpty)
|
||||
{
|
||||
ticksBounds = item.TicksBounds2;
|
||||
ticksBounds.Offset(item.Bounds.Location);
|
||||
DrawHTicks(g, table, min, max, ticksBounds, steps);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawVTicks(g, table, min, max, ticksBounds, steps);
|
||||
if (!item.TicksBounds2.IsEmpty)
|
||||
{
|
||||
ticksBounds = item.TicksBounds2;
|
||||
ticksBounds.Offset(item.Bounds.Location);
|
||||
DrawVTicks(g, table, min, max, ticksBounds, steps);
|
||||
}
|
||||
}
|
||||
}
|
||||
g.ResetClip();
|
||||
if (item.MinRangeSliderImage != null)
|
||||
{
|
||||
Rectangle br = item.RangeButtonMinBounds;
|
||||
br.Offset(item.Bounds.Location);
|
||||
g.DrawImage(item.MinRangeSliderImage, br);
|
||||
}
|
||||
else
|
||||
{
|
||||
Office2010RangeChangePartColorTable ct = table.MinRangeSlider.Default;
|
||||
if (!item.GetEnabled() && table.MinRangeSlider.Disabled != null)
|
||||
ct = table.MinRangeSlider.Disabled;
|
||||
else if (item.MouseDownPart == eRangeSliderPart.MinRangeSlider && table.MinRangeSlider.Pressed != null)
|
||||
ct = table.MinRangeSlider.Pressed;
|
||||
else if (item.MouseOverPart == eRangeSliderPart.MinRangeSlider && table.MinRangeSlider.MouseOver != null)
|
||||
ct = table.MinRangeSlider.MouseOver;
|
||||
if (ct.Background != null)
|
||||
ct.Background.LinearGradientAngle = (item.SliderOrientation == eOrientation.Horizontal) ? 90 : 0;
|
||||
Rectangle br = item.RangeButtonMinBounds;
|
||||
br.Offset(item.Bounds.Location);
|
||||
using (GraphicsPath sliderButtonPath = CreateMinSlider(br, item.TicksPosition, item.SliderOrientation))
|
||||
{
|
||||
using (Brush brush = DisplayHelp.CreateBrush(br, ct.Background))
|
||||
g.FillPath(brush, sliderButtonPath);
|
||||
if (!ct.BorderLightColor.IsEmpty)
|
||||
{
|
||||
br.Inflate(-1, -1);
|
||||
using (GraphicsPath borderPath = CreateMinSlider(br, item.TicksPosition, item.SliderOrientation))
|
||||
{
|
||||
using (Pen pen = new Pen(ct.BorderLightColor, 1))
|
||||
g.DrawPath(pen, sliderButtonPath);
|
||||
}
|
||||
}
|
||||
if (!ct.BorderColor.IsEmpty)
|
||||
{
|
||||
using (Pen pen = new Pen(ct.BorderColor, 1))
|
||||
g.DrawPath(pen, sliderButtonPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (item.MaxRangeSliderImage != null)
|
||||
{
|
||||
Rectangle br = item.RangeButtonMaxBounds;
|
||||
br.Offset(item.Bounds.Location);
|
||||
g.DrawImage(item.MaxRangeSliderImage, br);
|
||||
}
|
||||
else
|
||||
{
|
||||
Office2010RangeChangePartColorTable ct = table.MaxRangeSlider.Default;
|
||||
if (!item.GetEnabled() && table.MaxRangeSlider.Disabled != null)
|
||||
ct = table.MaxRangeSlider.Disabled;
|
||||
else if (item.MouseDownPart == eRangeSliderPart.MaxRangeSlider && table.MaxRangeSlider.Pressed != null)
|
||||
ct = table.MaxRangeSlider.Pressed;
|
||||
else if (item.MouseOverPart == eRangeSliderPart.MaxRangeSlider && table.MaxRangeSlider.MouseOver != null)
|
||||
ct = table.MaxRangeSlider.MouseOver;
|
||||
if (ct.Background != null)
|
||||
ct.Background.LinearGradientAngle = (item.SliderOrientation == eOrientation.Horizontal) ? 90 : 0;
|
||||
Rectangle br = item.RangeButtonMaxBounds;
|
||||
br.Offset(item.Bounds.Location);
|
||||
using (GraphicsPath sliderButtonPath = CreateMaxSlider(br, item.TicksPosition, item.SliderOrientation))
|
||||
{
|
||||
using (Brush brush = DisplayHelp.CreateBrush(br, ct.Background))
|
||||
g.FillPath(brush, sliderButtonPath);
|
||||
if (!ct.BorderLightColor.IsEmpty)
|
||||
{
|
||||
br.Inflate(-1, -1);
|
||||
using (GraphicsPath borderPath = CreateMaxSlider(br, item.TicksPosition, item.SliderOrientation))
|
||||
{
|
||||
using (Pen pen = new Pen(ct.BorderLightColor, 1))
|
||||
g.DrawPath(pen, sliderButtonPath);
|
||||
}
|
||||
}
|
||||
if (!ct.BorderColor.IsEmpty)
|
||||
{
|
||||
using (Pen pen = new Pen(ct.BorderColor, 1))
|
||||
g.DrawPath(pen, sliderButtonPath);
|
||||
}
|
||||
}
|
||||
|
||||
//using (GraphicsPath sliderButtonPath = CreateMaxSlider(item.RangeButtonMaxBounds, item.TicksPosition, item.SliderOrientation))
|
||||
//{
|
||||
// g.FillPath(Brushes.Red, sliderButtonPath);
|
||||
// g.DrawPath(Pens.BlanchedAlmond, sliderButtonPath);
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawHTicks(Graphics g, Office2010RangeSliderColorTable table, int min, int max, Rectangle ticksBounds, int steps)
|
||||
{
|
||||
SmoothingMode sm = g.SmoothingMode;
|
||||
g.SmoothingMode = SmoothingMode.None;
|
||||
|
||||
if (ticksBounds.Width / 2 < Math.Abs(max - min) / steps)
|
||||
steps = (int)Math.Max(2, Math.Ceiling(Math.Abs(max - min) / ((float)ticksBounds.Width / 2)));
|
||||
int xstep = (int)RangeSliderItem.GetXStep(ticksBounds.Width, min, max, steps);
|
||||
int x = ticksBounds.X;
|
||||
using (Pen linePen = new Pen(table.TickLineColor))
|
||||
{
|
||||
for (int i = min; i <= max; i += steps)
|
||||
{
|
||||
g.DrawLine(linePen, x, ticksBounds.Y, x, ticksBounds.Bottom - 1);
|
||||
x += xstep;
|
||||
}
|
||||
}
|
||||
g.SmoothingMode = sm;
|
||||
}
|
||||
private static void DrawVTicks(Graphics g, Office2010RangeSliderColorTable table, int min, int max, Rectangle ticksBounds, int steps)
|
||||
{
|
||||
SmoothingMode sm = g.SmoothingMode;
|
||||
g.SmoothingMode = SmoothingMode.None;
|
||||
if (ticksBounds.Height / 2 < Math.Abs(max - min) / steps)
|
||||
steps = Math.Max(2, Math.Abs(max - min) / (ticksBounds.Height / 2));
|
||||
int y = ticksBounds.Y;
|
||||
int ystep = (int)RangeSliderItem.GetXStep(ticksBounds.Height, min, max, steps);
|
||||
using (Pen linePen = new Pen(table.TickLineColor))
|
||||
{
|
||||
for (int i = min; i <= max; i += steps)
|
||||
{
|
||||
g.DrawLine(linePen, ticksBounds.X, y, ticksBounds.Right - 1, y);
|
||||
y += ystep;
|
||||
}
|
||||
}
|
||||
g.SmoothingMode = sm;
|
||||
}
|
||||
|
||||
//private void PaintTrackPart(Office2010RangeChangePartColorTable ct, Rectangle r, Graphics g, eOrientation orientation, eDotNetBarStyle effectiveStyle)
|
||||
//{
|
||||
// if (r.Width <= 0 || r.Height <= 0) return;
|
||||
|
||||
// if (orientation == eOrientation.Vertical)
|
||||
// {
|
||||
// // Left
|
||||
// Matrix m = new Matrix();
|
||||
// m.RotateAt(-90, new PointF(r.X, r.Bottom));
|
||||
// m.Translate(r.Height, r.Width - r.Height, MatrixOrder.Append);
|
||||
// g.Transform = m;
|
||||
// }
|
||||
// if (StyleManager.IsMetro(effectiveStyle))
|
||||
// {
|
||||
// if (!ct.PartBackground.IsEmpty)
|
||||
// {
|
||||
// SmoothingMode sm = g.SmoothingMode;
|
||||
// g.SmoothingMode = SmoothingMode.Default;
|
||||
// Rectangle slideBounds = new Rectangle(r.X + (r.Width - 3) / 2, r.Y + 2, 3, r.Height - 4);
|
||||
// using (Brush brush = DisplayHelp.CreateBrush(slideBounds, ct.Background))
|
||||
// {
|
||||
// g.FillRectangle(brush, slideBounds);
|
||||
// }
|
||||
// g.SmoothingMode = sm;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// using (GraphicsPath path = new GraphicsPath())
|
||||
// {
|
||||
// path.AddLine(r.X, r.Y, r.X + 11, r.Y);
|
||||
// path.AddLine(r.X + 11, r.Y, r.X + 11, r.Y + 9);
|
||||
// path.AddLine(r.X + 11, r.Y + 9, r.X + 6, r.Y + 15);
|
||||
// path.AddLine(r.X + 5, r.Y + 15, r.X, r.Y + 10);
|
||||
// path.CloseAllFigures();
|
||||
// using (SolidBrush brush = new SolidBrush(ct.BorderLightColor))
|
||||
// g.FillPath(brush, path);
|
||||
// }
|
||||
|
||||
// SmoothingMode sm = g.SmoothingMode;
|
||||
// g.SmoothingMode = SmoothingMode.AntiAlias;
|
||||
// r.Offset(1, 1);
|
||||
// using (GraphicsPath path = new GraphicsPath())
|
||||
// {
|
||||
// path.AddLine(r.X, r.Y, r.X + 8, r.Y);
|
||||
// path.AddLine(r.X + 8, r.Y + 8, r.X + 4, r.Y + 12);
|
||||
// path.AddLine(r.X, r.Y + 8, r.X, r.Y);
|
||||
// path.CloseAllFigures();
|
||||
|
||||
// if (ct.PartBackground.Colors.Count > 0)
|
||||
// {
|
||||
// using (Brush brush = DisplayHelp.CreateBrush(Rectangle.Ceiling(path.GetBounds()), ct.Background))
|
||||
// {
|
||||
// g.FillPath(brush, path);
|
||||
// }
|
||||
// }
|
||||
|
||||
// using (Pen pen = new Pen(ct.PartBorderColor, 1))
|
||||
// g.DrawPath(pen, path);
|
||||
// }
|
||||
|
||||
// using (Pen pen = new Pen(Color.FromArgb(200, ct.PartForeColor), 1))
|
||||
// g.DrawLine(pen, r.X + 4, r.Y + 3, r.X + 4, r.Y + 8);
|
||||
|
||||
// using (Pen pen = new Pen(ct.PartForeLightColor, 1))
|
||||
// g.DrawLine(pen, r.X + 5, r.Y + 4, r.X + 5, r.Y + 7);
|
||||
|
||||
// g.SmoothingMode = sm;
|
||||
// }
|
||||
|
||||
// if (orientation == eOrientation.Vertical)
|
||||
// g.ResetTransform();
|
||||
//}
|
||||
|
||||
private GraphicsPath CreateMinSlider(Rectangle r, eTicksPosition position, eOrientation sliderOrientation)
|
||||
{
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
if (sliderOrientation == eOrientation.Horizontal)
|
||||
{
|
||||
if (position == eTicksPosition.Top)
|
||||
{
|
||||
path.AddLine(r.Right, r.Y, r.Right, r.Bottom);
|
||||
path.AddLine(r.Right, r.Bottom, r.X, r.Bottom);
|
||||
path.AddLine(r.X, r.Bottom, r.X, r.Y + r.Width);
|
||||
path.CloseAllFigures();
|
||||
}
|
||||
else if (position == eTicksPosition.Bottom)
|
||||
{
|
||||
path.AddLine(r.Right, r.Bottom, r.Right, r.Y);
|
||||
path.AddLine(r.Right, r.Y, r.X, r.Y);
|
||||
path.AddLine(r.X, r.Y, r.X, r.Bottom - r.Width);
|
||||
path.CloseAllFigures();
|
||||
}
|
||||
else
|
||||
{
|
||||
path.AddRectangle(r);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (position == eTicksPosition.Top)
|
||||
{
|
||||
path.AddLine(r.X, r.Bottom, r.Right, r.Bottom);
|
||||
path.AddLine(r.Right, r.Bottom, r.Right, r.Y);
|
||||
path.AddLine(r.Right, r.Y, r.X + r.Height, r.Y);
|
||||
path.CloseAllFigures();
|
||||
}
|
||||
else if (position == eTicksPosition.Bottom)
|
||||
{
|
||||
path.AddLine(r.Right, r.Bottom, r.X, r.Bottom);
|
||||
path.AddLine(r.X, r.Bottom, r.X, r.Y);
|
||||
path.AddLine(r.X, r.Y, r.Right - r.Height, r.Y);
|
||||
path.CloseAllFigures();
|
||||
}
|
||||
else
|
||||
{
|
||||
path.AddRectangle(r);
|
||||
}
|
||||
}
|
||||
return path;
|
||||
}
|
||||
private GraphicsPath CreateMaxSlider(Rectangle r, eTicksPosition position, eOrientation sliderOrientation)
|
||||
{
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
|
||||
if (sliderOrientation == eOrientation.Horizontal)
|
||||
{
|
||||
if (position == eTicksPosition.Top)
|
||||
{
|
||||
path.AddLine(r.X, r.Y, r.X, r.Bottom);
|
||||
path.AddLine(r.X, r.Bottom, r.Right, r.Bottom);
|
||||
path.AddLine(r.Right, r.Bottom, r.Right, r.Y + r.Width);
|
||||
path.CloseAllFigures();
|
||||
}
|
||||
else if (position == eTicksPosition.Bottom)
|
||||
{
|
||||
path.AddLine(r.X, r.Bottom, r.X, r.Y);
|
||||
path.AddLine(r.X, r.Y, r.Right, r.Y);
|
||||
path.AddLine(r.Right, r.Y, r.Right, r.Bottom - r.Width);
|
||||
path.CloseAllFigures();
|
||||
}
|
||||
else
|
||||
{
|
||||
path.AddRectangle(r);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (position == eTicksPosition.Top)
|
||||
{
|
||||
path.AddLine(r.X, r.Y, r.Right, r.Y);
|
||||
path.AddLine(r.Right, r.Y, r.Right, r.Bottom);
|
||||
path.AddLine(r.Right, r.Bottom, r.X + r.Height, r.Bottom);
|
||||
path.CloseAllFigures();
|
||||
}
|
||||
else if (position == eTicksPosition.Bottom)
|
||||
{
|
||||
path.AddLine(r.Right, r.Y, r.X, r.Y);
|
||||
path.AddLine(r.X, r.Y, r.X, r.Bottom);
|
||||
path.AddLine(r.X, r.Bottom, r.Right - r.Height, r.Bottom);
|
||||
path.CloseAllFigures();
|
||||
}
|
||||
else
|
||||
{
|
||||
path.AddRectangle(r);
|
||||
}
|
||||
}
|
||||
return path;
|
||||
}
|
||||
protected virtual Office2010RangeSliderColorTable GetColorTable(RangeSliderItem item, System.Windows.Forms.Control container)
|
||||
{
|
||||
if (container == null)
|
||||
return _ColorTable.RangeSlider;
|
||||
|
||||
Office2007ColorTable table = _ColorTable;
|
||||
|
||||
string key = Office2007ColorTable.GetContextualKey(typeof(Office2010RangeSliderColorTable), container.GetType());
|
||||
object st = null;
|
||||
|
||||
if (container is Bar)
|
||||
{
|
||||
if (table.ContextualTables.TryGetValue(key + "+" + ((Bar)container).BarType.ToString(), out st))
|
||||
return (Office2010RangeSliderColorTable)st;
|
||||
}
|
||||
|
||||
if (table.ContextualTables.TryGetValue(key, out st))
|
||||
return (Office2010RangeSliderColorTable)st;
|
||||
|
||||
return _ColorTable.RangeSlider;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using DevComponents.DotNetBar.Rendering;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
internal class Office2010RibbonTabGroupPainter : Office2007RibbonTabGroupPainter
|
||||
{
|
||||
#region Internal Implementation
|
||||
protected override void PaintTabGroupBackground(System.Drawing.Graphics g, Office2007RibbonTabGroupColorTable colorTable, System.Drawing.Rectangle bounds, System.Drawing.Rectangle groupBounds, bool glassEnabled)
|
||||
{
|
||||
if (colorTable == null)
|
||||
return;
|
||||
|
||||
// Draw title rectangle part of the group
|
||||
Rectangle r = bounds;
|
||||
r.Height -= 2;
|
||||
|
||||
// GDI+ bug
|
||||
Rectangle rFill = r;
|
||||
rFill.Width--;
|
||||
rFill.Height--;
|
||||
|
||||
// First draw background
|
||||
DisplayHelp.FillRectangle(g, rFill, colorTable.Background);//.Start, colorTable.Background.End, 90, new float[] { 0f, 1f, 1f }, new float[] { 0f, .4f, 1f });
|
||||
|
||||
r = bounds;
|
||||
SmoothingMode sm = g.SmoothingMode;
|
||||
g.SmoothingMode = SmoothingMode.Default;
|
||||
|
||||
Rectangle rAll = groupBounds;
|
||||
|
||||
if (!colorTable.Border.IsEmpty)
|
||||
{
|
||||
r.Height += 18;
|
||||
using (SolidBrush brush = new SolidBrush(colorTable.Border.Start))
|
||||
{
|
||||
// Draw border top
|
||||
g.FillRectangle(brush, rAll.X+1, rAll.Y, rAll.Width-2, 4);
|
||||
}
|
||||
|
||||
// Draw border ... Left first
|
||||
DisplayHelp.FillRectangle(g, new Rectangle(rAll.X+1, r.Y, 1, r.Height), colorTable.Border);
|
||||
// Then right
|
||||
DisplayHelp.FillRectangle(g, new Rectangle(rAll.Right - 1, r.Y, 1, r.Height), colorTable.Border);
|
||||
|
||||
using (Pen pen = new Pen(Color.FromArgb(92, Color.White)))
|
||||
{
|
||||
g.DrawLine(pen, rAll.X, r.Y, rAll.X, r.Height - 2);
|
||||
g.DrawLine(pen, rAll.Right, r.Y, rAll.Right, r.Height - 2);
|
||||
}
|
||||
}
|
||||
g.SmoothingMode = sm;
|
||||
}
|
||||
|
||||
protected override ThemeTextFormat GetThemeFormat()
|
||||
{
|
||||
ThemeTextFormat tf = ThemeTextFormat.Center | ThemeTextFormat.EndEllipsis | ThemeTextFormat.Top | ThemeTextFormat.SingleLine;
|
||||
return tf;
|
||||
}
|
||||
protected override eTextFormat GetTextFormat()
|
||||
{
|
||||
return eTextFormat.Top;
|
||||
}
|
||||
protected override Themes.RECT GetThemeTextBounds(Rectangle rect)
|
||||
{
|
||||
Themes.RECT bounds = new Themes.RECT(new Rectangle(0, 6, rect.Width, rect.Height - 6));
|
||||
return bounds;
|
||||
}
|
||||
protected override Rectangle GetTextBounds(RibbonTabGroupRendererEventArgs e)
|
||||
{
|
||||
Rectangle r = e.Bounds;
|
||||
r.Y += 6;
|
||||
r.Height -= 6;
|
||||
return r;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,188 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using DevComponents.DotNetBar.Rendering;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
internal class Office2010SystemCaptionItemPainter : Office2007SystemCaptionItemPainter
|
||||
{
|
||||
#region Internal Implementation
|
||||
protected override void PaintMinimize(Graphics g, Rectangle r, Office2007SystemButtonStateColorTable ct, bool isEnabled, LinearGradientColorTable foregroundOverride)
|
||||
{
|
||||
//SmoothingMode sm = g.SmoothingMode;
|
||||
//g.SmoothingMode = SmoothingMode.AntiAlias;
|
||||
|
||||
Size s = new Size(Dpi.Width11, Dpi.Height5);
|
||||
Rectangle rm = GetSignRect(r, s);
|
||||
|
||||
DisplayHelp.DrawRoundedRectangle(g, ct.DarkShade, (foregroundOverride ?? ct.Foreground), rm, 1);
|
||||
|
||||
//g.SmoothingMode = sm;
|
||||
}
|
||||
|
||||
protected override void PaintRestore(Graphics g, Rectangle r, Office2007SystemButtonStateColorTable ct, bool isEnabled, LinearGradientColorTable foregroundOverride)
|
||||
{
|
||||
//SmoothingMode sm = g.SmoothingMode;
|
||||
//g.SmoothingMode = SmoothingMode.Default;
|
||||
|
||||
Size s = new Size(Dpi.Width12, Dpi.Height11);
|
||||
Rectangle rm = GetSignRect(r, s);
|
||||
Region oldClip = g.Clip;
|
||||
|
||||
LinearGradientColorTable foreground = foregroundOverride ?? ct.Foreground;
|
||||
using (Brush fill = DisplayHelp.CreateBrush(rm, foreground))
|
||||
{
|
||||
using (Pen pen = new Pen(ct.DarkShade))
|
||||
{
|
||||
using (GraphicsPath path = DisplayHelp.GetRoundedRectanglePath(new Rectangle(rm.X + Dpi.Width5, rm.Y, Dpi.Width8, Dpi.Height8), 1))
|
||||
{
|
||||
Rectangle inner = new Rectangle(rm.X + Dpi.Width7, rm.Y + Dpi.Height4, Dpi.Width4, Dpi.Width2);
|
||||
g.SetClip(inner, CombineMode.Exclude);
|
||||
g.SetClip(new Rectangle(rm.X, rm.Y + Dpi.Height3, Dpi.Width8, Dpi.Height8), CombineMode.Exclude);
|
||||
g.FillPath(fill, path);
|
||||
g.DrawPath(pen, path);
|
||||
g.ResetClip();
|
||||
g.DrawRectangle(pen, inner);
|
||||
}
|
||||
using (GraphicsPath path = DisplayHelp.GetRoundedRectanglePath(new Rectangle(rm.X, rm.Y + Dpi.Height3, Dpi.Width8, Dpi.Height8), 1))
|
||||
{
|
||||
Rectangle inner = new Rectangle(rm.X + Dpi.Width2, rm.Y + Dpi.Height7, Dpi.Width4, Dpi.Width2);
|
||||
g.SetClip(inner, CombineMode.Exclude);
|
||||
g.FillPath(fill, path);
|
||||
g.DrawPath(pen, path);
|
||||
g.ResetClip();
|
||||
g.DrawRectangle(pen, inner);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (oldClip != null)
|
||||
{
|
||||
g.Clip = oldClip;
|
||||
oldClip.Dispose();
|
||||
}
|
||||
//g.SmoothingMode = sm;
|
||||
}
|
||||
|
||||
protected override void PaintMaximize(Graphics g, Rectangle r, Office2007SystemButtonStateColorTable ct, bool isEnabled, LinearGradientColorTable foregroundOverride)
|
||||
{
|
||||
Size s = new Size(Dpi.Width11, Dpi.Height9);
|
||||
Rectangle rm = GetSignRect(r, s);
|
||||
Region oldClip = g.Clip;
|
||||
|
||||
LinearGradientColorTable foreground = foregroundOverride ?? ct.Foreground;
|
||||
using (Brush fill = DisplayHelp.CreateBrush(rm, foreground))
|
||||
{
|
||||
using (Pen pen = new Pen(ct.DarkShade))
|
||||
{
|
||||
Rectangle inner = new Rectangle(rm.X + Dpi.Width3, rm.Y + Dpi.Height3, Dpi.Width(ct.DarkShade.IsEmpty ? 5 : 4), Dpi.Height(ct.DarkShade.IsEmpty ? 3 : 2));
|
||||
g.SetClip(inner, CombineMode.Exclude);
|
||||
DisplayHelp.DrawRoundedRectangle(g, pen, fill, rm.X, rm.Y, rm.Width, rm.Height, 1);
|
||||
g.ResetClip();
|
||||
g.DrawRectangle(pen, inner);
|
||||
}
|
||||
}
|
||||
|
||||
if (oldClip != null)
|
||||
{
|
||||
g.Clip = oldClip;
|
||||
oldClip.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void PaintClose(Graphics g, Rectangle r, Office2007SystemButtonStateColorTable ct, bool isEnabled, LinearGradientColorTable foregroundOverride)
|
||||
{
|
||||
SmoothingMode sm = g.SmoothingMode;
|
||||
g.SmoothingMode = SmoothingMode.Default;
|
||||
|
||||
Size s = new Size(Dpi.Width11, Dpi.Height9);
|
||||
Rectangle rm = GetSignRect(r, s);
|
||||
|
||||
Rectangle r1 = rm;
|
||||
r1.Inflate(-1, 0);
|
||||
r1.Height--;
|
||||
|
||||
using (GraphicsPath path = new GraphicsPath())
|
||||
{
|
||||
path.AddLine(r1.X + Dpi.Width1, r1.Y, r1.X + Dpi.Width3, r1.Y);
|
||||
path.AddLine(r1.X + Dpi.Width3, r1.Y, r1.X + Dpi.Width5, r1.Y + Dpi.Width2);
|
||||
path.AddLine(r1.X + Dpi.Width5, r1.Y + Dpi.Width2, r1.X + Dpi.Width7, r1.Y);
|
||||
path.AddLine(r1.X + Dpi.Width7, r1.Y, r1.X + Dpi.Width9, r1.Y);
|
||||
path.AddLine(r1.X + Dpi.Width10, r1.Y + Dpi.Height1, r1.X + Dpi.Width7, r1.Y + Dpi.Height4);
|
||||
path.AddLine(r1.X + Dpi.Width7, r1.Y + Dpi.Height4, r1.X + Dpi.Width10, r1.Y + Dpi.Height7);
|
||||
path.AddLine(r1.X + Dpi.Width10, r1.Y + Dpi.Height7, r1.X + Dpi.Width9, r1.Y + Dpi.Height8);
|
||||
path.AddLine(r1.X + Dpi.Width9, r1.Y + Dpi.Height8, r1.X + Dpi.Width7, r1.Y + Dpi.Height8);
|
||||
path.AddLine(r1.X + Dpi.Width7, r1.Y + Dpi.Height8, r1.X + Dpi.Width5, r1.Y + Dpi.Height6);
|
||||
path.AddLine(r1.X + Dpi.Width5, r1.Y + Dpi.Height6, r1.X + Dpi.Width3, r1.Y + Dpi.Height8);
|
||||
path.AddLine(r1.X + Dpi.Width3, r1.Y + Dpi.Height8, r1.X + Dpi.Width1, r1.Y + Dpi.Height8);
|
||||
path.AddLine(r1.X, r1.Y + Dpi.Height7, r1.X + Dpi.Width3, r1.Y + Dpi.Height4);
|
||||
path.AddLine(r1.X + Dpi.Width3, r1.Y + Dpi.Height4, r1.X, r1.Y + Dpi.Height1);
|
||||
|
||||
LinearGradientColorTable foreground = foregroundOverride ?? ct.Foreground;
|
||||
if (isEnabled)
|
||||
{
|
||||
DisplayHelp.FillPath(g, path, foreground);
|
||||
if (!ct.DarkShade.IsEmpty)
|
||||
{
|
||||
using (Pen pen = new Pen(ct.DarkShade))
|
||||
{
|
||||
g.DrawPath(pen, path);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
using (Pen pen = new Pen(foreground.Start))
|
||||
{
|
||||
g.DrawPath(pen, path);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LinearGradientColorTable lg = new LinearGradientColorTable(foreground.Start.IsEmpty ? foreground.Start : Color.FromArgb(128, foreground.Start),
|
||||
foreground.End.IsEmpty ? foreground.End : Color.FromArgb(128, foreground.End),
|
||||
foreground.GradientAngle);
|
||||
DisplayHelp.FillPath(g, path, lg);
|
||||
DisplayHelp.DrawGradientPathBorder(g, path, lg, 1);
|
||||
}
|
||||
}
|
||||
|
||||
g.SmoothingMode = sm;
|
||||
}
|
||||
|
||||
protected override void PaintHelp(Graphics g, Rectangle r, Office2007SystemButtonStateColorTable ct, bool isEnabled, LinearGradientColorTable foregroundOverride)
|
||||
{
|
||||
SmoothingMode sm = g.SmoothingMode;
|
||||
TextRenderingHint th = g.TextRenderingHint;
|
||||
g.SmoothingMode = SmoothingMode.Default;
|
||||
g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
|
||||
#if FRAMEWORK20
|
||||
using (Font font = new Font(SystemFonts.DefaultFont, FontStyle.Bold))
|
||||
#else
|
||||
using(Font font = new Font("Arial", 10, FontStyle.Bold))
|
||||
#endif
|
||||
{
|
||||
Size s = TextDrawing.MeasureString(g, "?", font);
|
||||
s.Width += 4;
|
||||
s.Height -= 2;
|
||||
Rectangle rm = GetSignRect(r, s);
|
||||
|
||||
rm.Offset(1, 1);
|
||||
using (SolidBrush brush = new SolidBrush(ct.DarkShade))
|
||||
g.DrawString("?", font, brush, rm);
|
||||
rm.Offset(-1, -1);
|
||||
LinearGradientColorTable foreground = foregroundOverride ?? ct.Foreground;
|
||||
using (SolidBrush brush = new SolidBrush(foreground.Start))
|
||||
g.DrawString("?", font, brush, rm);
|
||||
|
||||
}
|
||||
g.SmoothingMode = sm;
|
||||
g.TextRenderingHint = th;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines abstract class for the ProgressBarItem painter.
|
||||
/// </summary>
|
||||
internal abstract class ProgressBarItemPainter
|
||||
{
|
||||
public abstract void Paint(ProgressBarItemRenderEventArgs e);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines base class for QAT customize item painter.
|
||||
/// </summary>
|
||||
internal abstract class QatCustomizeItemPainter
|
||||
{
|
||||
public abstract void Paint(QatCustomizeItemRendererEventArgs e);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines base class for QAT overflow item painter.
|
||||
/// </summary>
|
||||
internal abstract class QatOverflowPainter
|
||||
{
|
||||
public abstract void Paint(QatOverflowItemRendererEventArgs e);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
internal static class ResizeHandlePainter
|
||||
{
|
||||
internal static void DrawResizeHandle(Graphics g, Rectangle statusBarBounds, Color lightColor, Color color, bool rightToLeft)
|
||||
{
|
||||
int direction = 1;
|
||||
Point startLoc = new Point(statusBarBounds.Right, statusBarBounds.Bottom);
|
||||
if (rightToLeft)
|
||||
{
|
||||
direction = -1;
|
||||
startLoc = new Point(0, statusBarBounds.Bottom - Dpi.Width2);
|
||||
}
|
||||
|
||||
using (Pen pen = new Pen(lightColor, Dpi.Width1))
|
||||
{
|
||||
g.DrawLine(pen, startLoc.X - Dpi.Width2 * direction, startLoc.Y - Dpi.Height2,
|
||||
startLoc.X - Dpi.Width3 * direction, startLoc.Y - Dpi.Height2);
|
||||
g.DrawLine(pen, startLoc.X - Dpi.Width6 * direction, startLoc.Y - Dpi.Height2,
|
||||
startLoc.X - Dpi.Width7 * direction, startLoc.Y - Dpi.Height2);
|
||||
g.DrawLine(pen, startLoc.X - Dpi.Width10 * direction, startLoc.Y - Dpi.Height2,
|
||||
startLoc.X - Dpi.Width11 * direction, startLoc.Y - Dpi.Height2);
|
||||
g.DrawLine(pen, startLoc.X - Dpi.Width2 * direction, startLoc.Y - Dpi.Height2,
|
||||
startLoc.X - Dpi.Width2 * direction, startLoc.Y - Dpi.Height3);
|
||||
g.DrawLine(pen, startLoc.X - Dpi.Width6 * direction, startLoc.Y - Dpi.Height2,
|
||||
startLoc.X - Dpi.Width6 * direction, startLoc.Y - Dpi.Height3);
|
||||
g.DrawLine(pen, startLoc.X - Dpi.Width10 * direction, startLoc.Y - Dpi.Height2,
|
||||
startLoc.X - Dpi.Width10 * direction, startLoc.Y - Dpi.Height3);
|
||||
g.DrawLine(pen, startLoc.X - Dpi.Width2 * direction, startLoc.Y - Dpi.Height6,
|
||||
startLoc.X - Dpi.Width3 * direction, startLoc.Y - Dpi.Height6);
|
||||
g.DrawLine(pen, startLoc.X - Dpi.Width6 * direction, startLoc.Y - Dpi.Height6,
|
||||
startLoc.X - Dpi.Width7 * direction, startLoc.Y - Dpi.Height6);
|
||||
g.DrawLine(pen, startLoc.X - Dpi.Width2 * direction, startLoc.Y - Dpi.Height6,
|
||||
startLoc.X - Dpi.Width2 * direction, startLoc.Y - Dpi.Height7);
|
||||
g.DrawLine(pen, startLoc.X - Dpi.Width6 * direction, startLoc.Y - Dpi.Height6,
|
||||
startLoc.X - Dpi.Width6 * direction, startLoc.Y - Dpi.Height7);
|
||||
g.DrawLine(pen, startLoc.X - Dpi.Width2 * direction, startLoc.Y - Dpi.Height10,
|
||||
startLoc.X - Dpi.Width3 * direction, startLoc.Y - Dpi.Height10);
|
||||
g.DrawLine(pen, startLoc.X - Dpi.Width2 * direction, startLoc.Y - Dpi.Height10,
|
||||
startLoc.X - Dpi.Width2 * direction, startLoc.Y - Dpi.Height11);
|
||||
}
|
||||
|
||||
// draw dark squares
|
||||
using (Pen pen = new Pen(color, Dpi.Width1))
|
||||
{
|
||||
g.DrawRectangle(pen, startLoc.X - Dpi.Width4 * direction, startLoc.Y - Dpi.Height4, Dpi.Width1, Dpi.Width1);
|
||||
g.DrawRectangle(pen, startLoc.X - Dpi.Width8 * direction, startLoc.Y - Dpi.Height4, Dpi.Width1, Dpi.Width1);
|
||||
g.DrawRectangle(pen, startLoc.X - Dpi.Width12 * direction, startLoc.Y - Dpi.Height4, Dpi.Width1, Dpi.Width1);
|
||||
g.DrawRectangle(pen, startLoc.X - Dpi.Width4 * direction, startLoc.Y - Dpi.Height8, Dpi.Width1, Dpi.Width1);
|
||||
g.DrawRectangle(pen, startLoc.X - Dpi.Width8 * direction, startLoc.Y - Dpi.Height8, Dpi.Width1, Dpi.Width1);
|
||||
g.DrawRectangle(pen, startLoc.X - Dpi.Width4 * direction, startLoc.Y - Dpi.Height12, Dpi.Width1, Dpi.Width1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
internal class SideBarPainter
|
||||
{
|
||||
public virtual void PaintSideBar(SideBarRendererEventArgs e){}
|
||||
|
||||
public virtual void PaintSideBarPanelItem(SideBarPanelItemRendererEventArgs e) { }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Renders the Slider items.
|
||||
/// </summary>
|
||||
internal class SliderPainter
|
||||
{
|
||||
public virtual void Paint(SliderItemRendererEventArgs e) { }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Renders the Range Slider items.
|
||||
/// </summary>
|
||||
internal class RangeSliderPainter
|
||||
{
|
||||
public virtual void Paint(RangeSliderItemRendererEventArgs e) { }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies colors for StepIndicator control.
|
||||
/// </summary>
|
||||
public class StepIndicatorColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the StepIndicatorColorTable class.
|
||||
/// </summary>
|
||||
public StepIndicatorColorTable()
|
||||
{
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the StepIndicatorColorTable class.
|
||||
/// </summary>
|
||||
/// <param name="backgroundColor"></param>
|
||||
/// <param name="indicatorColor"></param>
|
||||
public StepIndicatorColorTable(Color backgroundColor, Color indicatorColor)
|
||||
{
|
||||
BackgroundColor = backgroundColor;
|
||||
IndicatorColor = indicatorColor;
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or sets Background color of the control.
|
||||
/// </summary>
|
||||
public Color BackgroundColor = Color.Empty;
|
||||
/// <summary>
|
||||
/// Gets or sets indicator color.
|
||||
/// </summary>
|
||||
public Color IndicatorColor = Color.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,506 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the color table for SuperTab states
|
||||
/// </summary>
|
||||
[TypeConverter(typeof(SuperTabColorTableConvertor))]
|
||||
public class SuperTabColorTable : ICloneable, IDisposable
|
||||
{
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
/// Event raised when the SuperTabColorTable is changed
|
||||
/// </summary>
|
||||
[Description("Event raised when the SuperTabColorTable is changed")]
|
||||
public event EventHandler<EventArgs> ColorTableChanged;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private variables
|
||||
|
||||
private Color _OuterBorder = Color.Empty;
|
||||
private Color _InnerBorder = Color.Empty;
|
||||
private SuperTabLinearGradientColorTable _Background;
|
||||
|
||||
private SuperTabControlBoxStateColorTable _ControlBoxDefault;
|
||||
private SuperTabControlBoxStateColorTable _ControlBoxMouseOver;
|
||||
private SuperTabControlBoxStateColorTable _ControlBoxPressed;
|
||||
|
||||
private Color _InsertMarker = Color.Empty;
|
||||
private Color _SelectionMarker = Color.Empty;
|
||||
|
||||
#endregion
|
||||
|
||||
public SuperTabColorTable()
|
||||
{
|
||||
_Background = new SuperTabLinearGradientColorTable();
|
||||
_Background.ColorTableChanged += SctColorTableChanged;
|
||||
|
||||
_ControlBoxDefault = new SuperTabControlBoxStateColorTable();
|
||||
_ControlBoxDefault.ColorTableChanged += SctColorTableChanged;
|
||||
|
||||
_ControlBoxMouseOver = new SuperTabControlBoxStateColorTable();
|
||||
_ControlBoxMouseOver.ColorTableChanged += SctColorTableChanged;
|
||||
|
||||
_ControlBoxPressed = new SuperTabControlBoxStateColorTable();
|
||||
_ControlBoxPressed.ColorTableChanged += SctColorTableChanged;
|
||||
}
|
||||
|
||||
#region Public properties
|
||||
|
||||
#region Background
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Background color
|
||||
/// </summary>
|
||||
[Browsable(true), Category("Appearance")]
|
||||
[Description("Indicates the Background color.")]
|
||||
[NotifyParentProperty(true)]
|
||||
public SuperTabLinearGradientColorTable Background
|
||||
{
|
||||
get { return (_Background); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_Background.Equals(value) == false)
|
||||
{
|
||||
if (_Background != null)
|
||||
_Background.ColorTableChanged -= SctColorTableChanged;
|
||||
|
||||
_Background = value;
|
||||
|
||||
if (_Background != null)
|
||||
_Background.ColorTableChanged += SctColorTableChanged;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeBackground()
|
||||
{
|
||||
return (_Background.IsEmpty == false);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetBackground()
|
||||
{
|
||||
Background = new SuperTabLinearGradientColorTable();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region OuterBorder
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the outer border.
|
||||
/// </summary>
|
||||
[Browsable(true), Category("Appearance")]
|
||||
[Description("Indicates the colors for the outer border.")]
|
||||
[NotifyParentProperty(true)]
|
||||
public Color OuterBorder
|
||||
{
|
||||
get { return (_OuterBorder); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_OuterBorder != value)
|
||||
{
|
||||
_OuterBorder = value;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeOuterBorder()
|
||||
{
|
||||
return (_OuterBorder != Color.Empty);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetOuterBorder()
|
||||
{
|
||||
_OuterBorder = Color.Empty;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region InnerBorder
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the inner border.
|
||||
/// </summary>
|
||||
[Browsable(true), Category("Appearance")]
|
||||
[Description("Indicates the colors for the inner border.")]
|
||||
[NotifyParentProperty(true)]
|
||||
public Color InnerBorder
|
||||
{
|
||||
get { return (_InnerBorder); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_InnerBorder != value)
|
||||
{
|
||||
_InnerBorder = value;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeInnerBorder()
|
||||
{
|
||||
return (_InnerBorder != Color.Empty);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetInnerBorder()
|
||||
{
|
||||
_InnerBorder = Color.Empty;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ControlBoxDefault
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ControlBoxDefault colors
|
||||
/// </summary>
|
||||
[Browsable(true), Category("Appearance")]
|
||||
[Description("Indicates the ControlBoxDefault colors.")]
|
||||
[NotifyParentProperty(true)]
|
||||
public SuperTabControlBoxStateColorTable ControlBoxDefault
|
||||
{
|
||||
get { return (_ControlBoxDefault); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_ControlBoxDefault.Equals(value) == false)
|
||||
{
|
||||
if (_ControlBoxDefault != null)
|
||||
_ControlBoxDefault.ColorTableChanged -= SctColorTableChanged;
|
||||
|
||||
_ControlBoxDefault = value;
|
||||
|
||||
if (_ControlBoxDefault != null)
|
||||
_ControlBoxDefault.ColorTableChanged += SctColorTableChanged;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeControlBoxDefault()
|
||||
{
|
||||
return (_ControlBoxDefault.IsEmpty == false);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetControlBoxDefault()
|
||||
{
|
||||
ControlBoxDefault = new SuperTabControlBoxStateColorTable();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ControlBoxDefault
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ControlBoxMouseOver colors
|
||||
/// </summary>
|
||||
[Browsable(true), Category("Appearance")]
|
||||
[Description("Indicates the ControlBoxMouseOver colors.")]
|
||||
[NotifyParentProperty(true)]
|
||||
public SuperTabControlBoxStateColorTable ControlBoxMouseOver
|
||||
{
|
||||
get { return (_ControlBoxMouseOver); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_ControlBoxMouseOver.Equals(value) == false)
|
||||
{
|
||||
if (_ControlBoxMouseOver != null)
|
||||
_ControlBoxMouseOver.ColorTableChanged -= SctColorTableChanged;
|
||||
|
||||
_ControlBoxMouseOver = value;
|
||||
|
||||
if (_ControlBoxMouseOver != null)
|
||||
_ControlBoxMouseOver.ColorTableChanged += SctColorTableChanged;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeControlBoxMouseOver()
|
||||
{
|
||||
return (_ControlBoxMouseOver.IsEmpty == false);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetControlBoxMouseOver()
|
||||
{
|
||||
ControlBoxMouseOver = new SuperTabControlBoxStateColorTable();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ControlBoxPressed
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ControlBoxPressed colors
|
||||
/// </summary>
|
||||
[Browsable(true), Category("Appearance")]
|
||||
[Description("Indicates the ControlBoxPressed colors.")]
|
||||
[NotifyParentProperty(true)]
|
||||
public SuperTabControlBoxStateColorTable ControlBoxPressed
|
||||
{
|
||||
get { return (_ControlBoxPressed); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_ControlBoxPressed.Equals(value) == false)
|
||||
{
|
||||
if (_ControlBoxPressed != null)
|
||||
_ControlBoxPressed.ColorTableChanged -= SctColorTableChanged;
|
||||
|
||||
_ControlBoxPressed = value;
|
||||
|
||||
if (_ControlBoxPressed != null)
|
||||
_ControlBoxPressed.ColorTableChanged += SctColorTableChanged;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeControlBoxPressed()
|
||||
{
|
||||
return (_ControlBoxPressed.IsEmpty == false);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetControlBoxPressed()
|
||||
{
|
||||
ControlBoxPressed = new SuperTabControlBoxStateColorTable();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region InsertMarker
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the InsertMarker.
|
||||
/// </summary>
|
||||
[Browsable(true), Category("Appearance")]
|
||||
[Description("Indicates the color for the InsertMarker.")]
|
||||
[NotifyParentProperty(true)]
|
||||
public Color InsertMarker
|
||||
{
|
||||
get { return (_InsertMarker); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_InsertMarker != value)
|
||||
{
|
||||
_InsertMarker = value;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeInsertMarker()
|
||||
{
|
||||
return (_InsertMarker != Color.Empty);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetInsertMarker()
|
||||
{
|
||||
_InsertMarker = Color.Empty;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region SelectionMarker
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color for the SelectionMarker.
|
||||
/// </summary>
|
||||
[Browsable(true), Category("Appearance")]
|
||||
[Description("Indicates the color for the SelectionMarker.")]
|
||||
[NotifyParentProperty(true)]
|
||||
public Color SelectionMarker
|
||||
{
|
||||
get { return (_SelectionMarker); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_SelectionMarker != value)
|
||||
{
|
||||
_SelectionMarker = value;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeSelectionMarker()
|
||||
{
|
||||
return (_SelectionMarker != Color.Empty);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetSelectionMarker()
|
||||
{
|
||||
_SelectionMarker = Color.Empty;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IsEmpty
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether the ColorTable is empty.
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public bool IsEmpty
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Background.IsEmpty == false)
|
||||
return (false);
|
||||
|
||||
if (_OuterBorder != Color.Empty)
|
||||
return (false);
|
||||
|
||||
if (_InnerBorder != Color.Empty)
|
||||
return (false);
|
||||
|
||||
if (_ControlBoxDefault.IsEmpty == false)
|
||||
return (false);
|
||||
|
||||
if (_ControlBoxMouseOver.IsEmpty == false)
|
||||
return (false);
|
||||
|
||||
if (_ControlBoxPressed.IsEmpty == false)
|
||||
return (false);
|
||||
|
||||
if (_InsertMarker != Color.Empty)
|
||||
return (false);
|
||||
|
||||
if (_SelectionMarker != Color.Empty)
|
||||
return (false);
|
||||
|
||||
return (true);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region SctColorTableChanged
|
||||
|
||||
void SctColorTableChanged(object sender, EventArgs e)
|
||||
{
|
||||
OnColorTableChanged();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region OnColorTableChanged
|
||||
|
||||
private void OnColorTableChanged()
|
||||
{
|
||||
if (ColorTableChanged != null)
|
||||
ColorTableChanged(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ICloneable Members
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
SuperTabColorTable sct = new SuperTabColorTable();
|
||||
|
||||
sct.Background = (SuperTabLinearGradientColorTable)Background.Clone();
|
||||
sct.OuterBorder = OuterBorder;
|
||||
sct.InnerBorder = InnerBorder;
|
||||
|
||||
sct.ControlBoxDefault = (SuperTabControlBoxStateColorTable)ControlBoxDefault.Clone();
|
||||
sct.ControlBoxMouseOver = (SuperTabControlBoxStateColorTable)ControlBoxMouseOver.Clone();
|
||||
sct.ControlBoxPressed = (SuperTabControlBoxStateColorTable)ControlBoxPressed.Clone();
|
||||
|
||||
sct.InsertMarker = InsertMarker;
|
||||
sct.SelectionMarker = SelectionMarker;
|
||||
|
||||
return (sct);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposable Members
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Background = null;
|
||||
ControlBoxDefault = null;
|
||||
ControlBoxMouseOver = null;
|
||||
ControlBoxPressed = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#region SuperTabColorTableConvertor
|
||||
|
||||
public class SuperTabColorTableConvertor : ExpandableObjectConverter
|
||||
{
|
||||
public override object ConvertTo(
|
||||
ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
if (destinationType == typeof(string))
|
||||
{
|
||||
SuperTabColorTable sct = value as SuperTabColorTable;
|
||||
|
||||
if (sct != null)
|
||||
{
|
||||
ColorConverter cvt = new ColorConverter();
|
||||
|
||||
if (sct.Background.Colors != null)
|
||||
return (cvt.ConvertToString(sct.Background.Colors));
|
||||
|
||||
if (sct.InnerBorder.IsEmpty == false)
|
||||
return (cvt.ConvertToString(sct.InnerBorder));
|
||||
|
||||
if (sct.OuterBorder.IsEmpty == false)
|
||||
return (cvt.ConvertToString(sct.OuterBorder));
|
||||
|
||||
return (String.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
return (base.ConvertTo(context, culture, value, destinationType));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -0,0 +1,225 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the colors for the SuperTabControlBox states
|
||||
/// </summary>
|
||||
[TypeConverter(typeof(SuperTabControlBoxStateColorTableConvertor))]
|
||||
public class SuperTabControlBoxStateColorTable : ICloneable
|
||||
{
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
/// Event raised when the SuperTabControlBoxStateColorTable is changed
|
||||
/// </summary>
|
||||
[Description("Event raised when the SuperTabControlBoxStateColorTable is changed")]
|
||||
public event EventHandler<EventArgs> ColorTableChanged;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private variables
|
||||
|
||||
private Color _Background;
|
||||
private Color _Border = Color.Empty;
|
||||
private Color _Image = Color.Empty;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public properties
|
||||
|
||||
#region Background
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the background.
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
public Color Background
|
||||
{
|
||||
get { return (_Background); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_Background != value)
|
||||
{
|
||||
_Background = value;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeBackground()
|
||||
{
|
||||
return (_Background != Color.Empty);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetBackground()
|
||||
{
|
||||
_Background = Color.Empty;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Border
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the border.
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
public Color Border
|
||||
{
|
||||
get { return (_Border); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_Border != value)
|
||||
{
|
||||
_Border = value;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeBorder()
|
||||
{
|
||||
return (_Border != Color.Empty);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetBorder()
|
||||
{
|
||||
_Border = Color.Empty;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Image
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the drawn image.
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
public Color Image
|
||||
{
|
||||
get { return (_Image); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_Image != value)
|
||||
{
|
||||
_Image = value;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeImage()
|
||||
{
|
||||
return (_Image != Color.Empty);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetImage()
|
||||
{
|
||||
_Image = Color.Empty;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IsEmpty
|
||||
|
||||
[Browsable(false)]
|
||||
public bool IsEmpty
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Background.IsEmpty == false)
|
||||
return (false);
|
||||
|
||||
if (_Border != Color.Empty)
|
||||
return (false);
|
||||
|
||||
if (_Image != Color.Empty)
|
||||
return (false);
|
||||
|
||||
return (true);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region OnColorTableChanged
|
||||
|
||||
private void OnColorTableChanged()
|
||||
{
|
||||
if (ColorTableChanged != null)
|
||||
ColorTableChanged(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ICloneable Members
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
SuperTabControlBoxStateColorTable sct = new SuperTabControlBoxStateColorTable();
|
||||
|
||||
sct.Background = Background;
|
||||
sct.Border = Border;
|
||||
sct.Image = Image;
|
||||
|
||||
return (sct);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#region SuperTabItemStateColorTableConvertor
|
||||
|
||||
public class SuperTabControlBoxStateColorTableConvertor : ExpandableObjectConverter
|
||||
{
|
||||
public override object ConvertTo(
|
||||
ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
if (destinationType == typeof(string))
|
||||
{
|
||||
SuperTabControlBoxStateColorTable sct = value as SuperTabControlBoxStateColorTable;
|
||||
|
||||
if (sct != null)
|
||||
{
|
||||
ColorConverter cvt = new ColorConverter();
|
||||
|
||||
if (sct.Background.IsEmpty == false)
|
||||
return (cvt.ConvertToString(sct.Background));
|
||||
|
||||
if (sct.Border.IsEmpty == false)
|
||||
return (cvt.ConvertToString(sct.Border));
|
||||
|
||||
if (sct.Image.IsEmpty == false)
|
||||
return (cvt.ConvertToString(sct.Image));
|
||||
|
||||
return (String.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
return (base.ConvertTo(context, culture, value, destinationType));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,542 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the color table for SuperTabItem states
|
||||
/// </summary>
|
||||
[TypeConverter(typeof(SuperTabItemColorTableConvertor))]
|
||||
public class SuperTabItemColorTable : ICloneable, IDisposable
|
||||
{
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
/// Event raised when the SuperTabItemColorTable is changed
|
||||
/// </summary>
|
||||
[Description("Event raised when the SuperTabItemColorTable is changed")]
|
||||
public event EventHandler<EventArgs> ColorTableChanged;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private variables
|
||||
|
||||
private SuperTabColorStates _Default;
|
||||
private SuperTabColorStates _Left;
|
||||
private SuperTabColorStates _Bottom;
|
||||
private SuperTabColorStates _Right;
|
||||
|
||||
#endregion
|
||||
|
||||
public SuperTabItemColorTable()
|
||||
{
|
||||
_Default = new SuperTabColorStates();
|
||||
_Default.ColorTableChanged += SctColorTableChanged;
|
||||
|
||||
_Left = new SuperTabColorStates();
|
||||
_Left.ColorTableChanged += SctColorTableChanged;
|
||||
|
||||
_Bottom = new SuperTabColorStates();
|
||||
_Bottom.ColorTableChanged += SctColorTableChanged;
|
||||
|
||||
_Right = new SuperTabColorStates();
|
||||
_Right.ColorTableChanged += SctColorTableChanged;
|
||||
}
|
||||
|
||||
#region Public properties
|
||||
|
||||
#region Default
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Default tab color settings
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the Default tab color settings.")]
|
||||
public SuperTabColorStates Default
|
||||
{
|
||||
get { return (_Default); }
|
||||
set { SetNewColorTable(ref _Default, value); }
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeDefault()
|
||||
{
|
||||
return (_Default.IsEmpty == false);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetDefault()
|
||||
{
|
||||
Default = new SuperTabColorStates();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Left
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Left Aligned tab color settings
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the Left Aligned tab color settings.")]
|
||||
public SuperTabColorStates Left
|
||||
{
|
||||
get { return (_Left); }
|
||||
set { SetNewColorTable(ref _Left, value); }
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeLeft()
|
||||
{
|
||||
return (_Left.IsEmpty == false);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetLeft()
|
||||
{
|
||||
Left = new SuperTabColorStates();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Bottom
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Bottom Aligned tab color settings
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the Bottom Aligned tab color settings.")]
|
||||
public SuperTabColorStates Bottom
|
||||
{
|
||||
get { return (_Bottom); }
|
||||
set { SetNewColorTable(ref _Bottom, value); }
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeBottom()
|
||||
{
|
||||
return (_Bottom.IsEmpty == false);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetBottom()
|
||||
{
|
||||
Bottom = new SuperTabColorStates();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Right
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Right Aligned tab color settings
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the Right Aligned tab color settings.")]
|
||||
public SuperTabColorStates Right
|
||||
{
|
||||
get { return (_Right); }
|
||||
set { SetNewColorTable(ref _Right, value); }
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeRight()
|
||||
{
|
||||
return (_Right.IsEmpty == false);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetRight()
|
||||
{
|
||||
Right = new SuperTabColorStates();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IsEmpty
|
||||
|
||||
[Browsable(false)]
|
||||
public bool IsEmpty
|
||||
{
|
||||
get
|
||||
{
|
||||
return (_Default.IsEmpty == true && _Left.IsEmpty == true &&
|
||||
_Bottom.IsEmpty == true && _Right.IsEmpty == true);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region SetNewColorTable
|
||||
|
||||
private void SetNewColorTable(
|
||||
ref SuperTabColorStates sct, SuperTabColorStates newSct)
|
||||
{
|
||||
if (sct != null)
|
||||
sct.ColorTableChanged -= SctColorTableChanged;
|
||||
|
||||
sct = newSct;
|
||||
|
||||
if (sct != null)
|
||||
sct.ColorTableChanged += SctColorTableChanged;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region SctColorTableChanged
|
||||
|
||||
void SctColorTableChanged(object sender, EventArgs e)
|
||||
{
|
||||
OnColorTableChanged();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region OnColorTableChanged
|
||||
|
||||
private void OnColorTableChanged()
|
||||
{
|
||||
if (ColorTableChanged != null)
|
||||
ColorTableChanged(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ICloneable Members
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
SuperTabItemColorTable sct = new SuperTabItemColorTable();
|
||||
|
||||
sct.Default = (SuperTabColorStates) Default.Clone();
|
||||
sct.Left = (SuperTabColorStates) Left.Clone();
|
||||
sct.Bottom = (SuperTabColorStates) Bottom.Clone();
|
||||
sct.Right = (SuperTabColorStates) Right.Clone();
|
||||
|
||||
return (sct);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposable Members
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Default = null;
|
||||
Left = null;
|
||||
Bottom = null;
|
||||
Right = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#region SuperTabColorStates
|
||||
|
||||
[TypeConverter(typeof(SuperTabItemColorTableConvertor))]
|
||||
public class SuperTabColorStates
|
||||
{
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
/// Event raised when the SuperTabColorStates is changed
|
||||
/// </summary>
|
||||
[Description("Event raised when the SuperTabColorStates is changed")]
|
||||
public event EventHandler<EventArgs> ColorTableChanged;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private data
|
||||
|
||||
private SuperTabItemStateColorTable _Normal;
|
||||
private SuperTabItemStateColorTable _Selected;
|
||||
private SuperTabItemStateColorTable _MouseOver;
|
||||
private SuperTabItemStateColorTable _SelectedMouseOver;
|
||||
|
||||
private SuperTabItemStateColorTable _Disabled;
|
||||
|
||||
#endregion
|
||||
|
||||
public SuperTabColorStates()
|
||||
{
|
||||
_Normal = new SuperTabItemStateColorTable();
|
||||
_Normal.ColorTableChanged += SctColorTableChanged;
|
||||
|
||||
_Selected = new SuperTabItemStateColorTable();
|
||||
_Selected.ColorTableChanged += SctColorTableChanged;
|
||||
|
||||
_MouseOver = new SuperTabItemStateColorTable();
|
||||
_MouseOver.ColorTableChanged += SctColorTableChanged;
|
||||
|
||||
_SelectedMouseOver = new SuperTabItemStateColorTable();
|
||||
_SelectedMouseOver.ColorTableChanged += SctColorTableChanged;
|
||||
|
||||
_Disabled = new SuperTabItemStateColorTable();
|
||||
_Disabled.ColorTableChanged += SctColorTableChanged;
|
||||
}
|
||||
|
||||
#region Public properties
|
||||
|
||||
#region Normal
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tab colors when the tab is not selected, and the mouse is not over it
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the tab colors when the tab is not selected, and the mouse is not over it.")]
|
||||
public SuperTabItemStateColorTable Normal
|
||||
{
|
||||
get { return (_Normal); }
|
||||
set { SetNewColorTable(ref _Normal, value); }
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeNormal()
|
||||
{
|
||||
return (_Normal.IsEmpty == false);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetNormal()
|
||||
{
|
||||
Normal = new SuperTabItemStateColorTable();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Selected
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tab colors when the tab is selected, but the mouse is not over the it
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the tab colors when the tab is selected, but the mouse is not over the it.")]
|
||||
public SuperTabItemStateColorTable Selected
|
||||
{
|
||||
get { return (_Selected); }
|
||||
set { SetNewColorTable(ref _Selected, value); }
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeSelected()
|
||||
{
|
||||
return (_Selected.IsEmpty == false);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetSelected()
|
||||
{
|
||||
Selected = new SuperTabItemStateColorTable();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region MouseOver
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tab colors when the tab is not selected, but the mouse is over it
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the tab colors when the tab is not selected, but the mouse is over it.")]
|
||||
public SuperTabItemStateColorTable MouseOver
|
||||
{
|
||||
get { return (_MouseOver); }
|
||||
set { SetNewColorTable(ref _MouseOver, value); }
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeMouseOver()
|
||||
{
|
||||
return (_MouseOver.IsEmpty == false);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetMouseOver()
|
||||
{
|
||||
MouseOver = new SuperTabItemStateColorTable();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region SelectedMouseOver
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tab colors when the tab is selected, and the mouse is over it
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the tab colors when the tab is selected, and the mouse is over it.")]
|
||||
public SuperTabItemStateColorTable SelectedMouseOver
|
||||
{
|
||||
get { return (_SelectedMouseOver); }
|
||||
set { SetNewColorTable(ref _SelectedMouseOver, value); }
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeSelectedMouseOver()
|
||||
{
|
||||
return (_SelectedMouseOver.IsEmpty == false);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetSelectedMouseOver()
|
||||
{
|
||||
SelectedMouseOver = new SuperTabItemStateColorTable();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Disabled
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tab colors when the tab
|
||||
/// is disabled, is not selected, and the mouse is not over it
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the tab colors when the tab is disabled, is not selected, and the mouse is not over it.")]
|
||||
public SuperTabItemStateColorTable Disabled
|
||||
{
|
||||
get { return (_Disabled); }
|
||||
set { SetNewColorTable(ref _Disabled, value); }
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeDisabled()
|
||||
{
|
||||
return (_Disabled.IsEmpty == false);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetDisabled()
|
||||
{
|
||||
Disabled = new SuperTabItemStateColorTable();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IsEmpty
|
||||
|
||||
[Browsable(false)]
|
||||
public bool IsEmpty
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Normal.IsEmpty == false)
|
||||
return (false);
|
||||
|
||||
if (_Selected.IsEmpty == false)
|
||||
return (false);
|
||||
|
||||
if (_MouseOver.IsEmpty == false)
|
||||
return (false);
|
||||
|
||||
if (_SelectedMouseOver.IsEmpty == false)
|
||||
return (false);
|
||||
|
||||
if (_Disabled.IsEmpty == false)
|
||||
return (false);
|
||||
|
||||
return (true);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region SetNewColorTable
|
||||
|
||||
private void SetNewColorTable(
|
||||
ref SuperTabItemStateColorTable sct, SuperTabItemStateColorTable newSct)
|
||||
{
|
||||
if (sct != null)
|
||||
sct.ColorTableChanged -= SctColorTableChanged;
|
||||
|
||||
sct = newSct;
|
||||
|
||||
if (sct != null)
|
||||
sct.ColorTableChanged += SctColorTableChanged;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region SctColorTableChanged
|
||||
|
||||
void SctColorTableChanged(object sender, EventArgs e)
|
||||
{
|
||||
OnColorTableChanged();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region OnColorTableChanged
|
||||
|
||||
private void OnColorTableChanged()
|
||||
{
|
||||
if (ColorTableChanged != null)
|
||||
ColorTableChanged(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ICloneable Members
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
SuperTabColorStates sct = new SuperTabColorStates();
|
||||
|
||||
sct.Normal = (SuperTabItemStateColorTable)Normal.Clone();
|
||||
sct.Selected = (SuperTabItemStateColorTable)Selected.Clone();
|
||||
sct.MouseOver = (SuperTabItemStateColorTable)MouseOver.Clone();
|
||||
sct.SelectedMouseOver = (SuperTabItemStateColorTable)SelectedMouseOver.Clone();
|
||||
sct.Disabled = (SuperTabItemStateColorTable)Disabled.Clone();
|
||||
|
||||
return (sct);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposable Members
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Normal = null;
|
||||
MouseOver = null;
|
||||
SelectedMouseOver = null;
|
||||
Selected = null;
|
||||
Disabled = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#region SuperTabItemColorTableConvertor
|
||||
|
||||
public class SuperTabItemColorTableConvertor : ExpandableObjectConverter
|
||||
{
|
||||
public override object ConvertTo(
|
||||
ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
return (String.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,380 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the colors for the SuperTabItem states
|
||||
/// </summary>
|
||||
[TypeConverter(typeof(SuperTabItemStateColorTableConvertor))]
|
||||
public class SuperTabItemStateColorTable : ICloneable
|
||||
{
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
/// Event raised when the SuperTabItemStateColorTable is changed
|
||||
/// </summary>
|
||||
[Description("Event raised when the SuperTabItemStateColorTable is changed")]
|
||||
public event EventHandler<EventArgs> ColorTableChanged;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private variables
|
||||
|
||||
private Color _Text = Color.Empty;
|
||||
private Color _InnerBorder = Color.Empty;
|
||||
private Color _OuterBorder = Color.Empty;
|
||||
private Color _CloseMarker = Color.Empty;
|
||||
private Color _SelectionMarker = Color.Empty;
|
||||
|
||||
private SuperTabLinearGradientColorTable _Background;
|
||||
|
||||
#endregion
|
||||
|
||||
public SuperTabItemStateColorTable()
|
||||
{
|
||||
_Background = new SuperTabLinearGradientColorTable();
|
||||
_Background.ColorTableChanged += Background_ColorTableChanged;
|
||||
}
|
||||
|
||||
#region Public properties
|
||||
|
||||
#region Background
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background colors.
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the background colors.")]
|
||||
public SuperTabLinearGradientColorTable Background
|
||||
{
|
||||
get { return (_Background); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_Background.Equals(value) == false)
|
||||
{
|
||||
if (_Background != null)
|
||||
_Background.ColorTableChanged -= Background_ColorTableChanged;
|
||||
|
||||
_Background = value;
|
||||
|
||||
if (_Background != null)
|
||||
_Background.ColorTableChanged += Background_ColorTableChanged;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeBackground()
|
||||
{
|
||||
return (_Background.IsEmpty == false);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetBackground()
|
||||
{
|
||||
Background = new SuperTabLinearGradientColorTable();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region OuterBorder
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the outer border color.
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the outer border color.")]
|
||||
public Color OuterBorder
|
||||
{
|
||||
get { return (_OuterBorder); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_OuterBorder != value)
|
||||
{
|
||||
_OuterBorder = value;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeOuterBorder()
|
||||
{
|
||||
return (_OuterBorder != Color.Empty);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetOuterBorder()
|
||||
{
|
||||
OuterBorder = Color.Empty;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region InnerBorder
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the inner border color.
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the inner border color.")]
|
||||
public Color InnerBorder
|
||||
{
|
||||
get { return (_InnerBorder); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_InnerBorder != value)
|
||||
{
|
||||
_InnerBorder = value;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeInnerBorder()
|
||||
{
|
||||
return (_InnerBorder != Color.Empty);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetInnerBorder()
|
||||
{
|
||||
InnerBorder = Color.Empty;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Text
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the text color.
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the Text color.")]
|
||||
public Color Text
|
||||
{
|
||||
get { return (_Text); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_Text != value)
|
||||
{
|
||||
_Text = value;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeText()
|
||||
{
|
||||
return (_Text.IsEmpty == false);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetText()
|
||||
{
|
||||
Text = Color.Empty;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region CloseMarker
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Close Marker color.
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the Close Marker color.")]
|
||||
public Color CloseMarker
|
||||
{
|
||||
get { return (_CloseMarker); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_CloseMarker != value)
|
||||
{
|
||||
_CloseMarker = value;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeCloseMarker()
|
||||
{
|
||||
return (_CloseMarker != Color.Empty);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetCloseMarker()
|
||||
{
|
||||
CloseMarker = Color.Empty;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region SelectionMarker
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Selection Marker color.
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the Selection Marker color.")]
|
||||
public Color SelectionMarker
|
||||
{
|
||||
get { return (_SelectionMarker); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_SelectionMarker != value)
|
||||
{
|
||||
_SelectionMarker = value;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeSelectionMarker()
|
||||
{
|
||||
return (_SelectionMarker != Color.Empty);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetSelectionMarker()
|
||||
{
|
||||
SelectionMarker = Color.Empty;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IsEmpty
|
||||
|
||||
[Browsable(false)]
|
||||
public bool IsEmpty
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Background.IsEmpty == false)
|
||||
return (false);
|
||||
|
||||
if (_OuterBorder != Color.Empty)
|
||||
return (false);
|
||||
|
||||
if (_InnerBorder != Color.Empty)
|
||||
return (false);
|
||||
|
||||
if (_Text != Color.Empty)
|
||||
return (false);
|
||||
|
||||
if (_CloseMarker != Color.Empty)
|
||||
return (false);
|
||||
|
||||
if (_SelectionMarker != Color.Empty)
|
||||
return (false);
|
||||
|
||||
return (true);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region Background_ColorTableChanged
|
||||
|
||||
void Background_ColorTableChanged(object sender, EventArgs e)
|
||||
{
|
||||
OnColorTableChanged();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region OnColorTableChanged
|
||||
|
||||
private void OnColorTableChanged()
|
||||
{
|
||||
if (ColorTableChanged != null)
|
||||
ColorTableChanged(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ICloneable Members
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
SuperTabItemStateColorTable sct = new SuperTabItemStateColorTable();
|
||||
|
||||
sct.Background = (SuperTabLinearGradientColorTable)Background.Clone();
|
||||
|
||||
sct.Text = Text;
|
||||
sct.OuterBorder = OuterBorder;
|
||||
sct.InnerBorder = InnerBorder;
|
||||
sct.CloseMarker = CloseMarker;
|
||||
sct.SelectionMarker = SelectionMarker;
|
||||
|
||||
return (sct);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#region SuperTabItemStateColorTableConvertor
|
||||
|
||||
public class SuperTabItemStateColorTableConvertor : ExpandableObjectConverter
|
||||
{
|
||||
public override object ConvertTo(
|
||||
ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
if (destinationType == typeof(string))
|
||||
{
|
||||
SuperTabItemStateColorTable sct = value as SuperTabItemStateColorTable;
|
||||
|
||||
if (sct != null)
|
||||
{
|
||||
ColorConverter cvt = new ColorConverter();
|
||||
|
||||
if (sct.Background.Colors != null)
|
||||
return (cvt.ConvertToString(sct.Background.Colors[0]));
|
||||
|
||||
if (sct.InnerBorder.IsEmpty == false)
|
||||
return (cvt.ConvertToString(sct.InnerBorder));
|
||||
|
||||
if (sct.OuterBorder.IsEmpty == false)
|
||||
return (cvt.ConvertToString(sct.OuterBorder));
|
||||
|
||||
if (sct.Text.IsEmpty == false)
|
||||
return (cvt.ConvertToString(sct.Text));
|
||||
|
||||
return (String.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
return (base.ConvertTo(context, culture, value, destinationType));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,339 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Globalization;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
[TypeConverter(typeof(SuperTabLinearGradientColorTableConvertor))]
|
||||
public class SuperTabLinearGradientColorTable
|
||||
{
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
/// Event raised when the SuperTabLinearGradientColorTable is changed
|
||||
/// </summary>
|
||||
[Description("Event raised when the SuperTabLinearGradientColorTable is changed")]
|
||||
public event EventHandler<EventArgs> ColorTableChanged;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private variables
|
||||
|
||||
private Color[] _Colors;
|
||||
private float[] _Positions;
|
||||
private int _GradientAngle = 90;
|
||||
private bool? _AdaptiveGradient;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public SuperTabLinearGradientColorTable()
|
||||
{
|
||||
}
|
||||
|
||||
public SuperTabLinearGradientColorTable(Color color)
|
||||
{
|
||||
_Colors = new Color[1];
|
||||
|
||||
_Colors[0] = color;
|
||||
}
|
||||
|
||||
public SuperTabLinearGradientColorTable(Color start, Color end)
|
||||
{
|
||||
_Colors = new Color[2];
|
||||
|
||||
_Colors[0] = start;
|
||||
_Colors[1] = end;
|
||||
}
|
||||
|
||||
public SuperTabLinearGradientColorTable(Color start, Color end, int gradient)
|
||||
{
|
||||
_Colors = new Color[2];
|
||||
|
||||
_Colors[0] = start;
|
||||
_Colors[1] = end;
|
||||
_GradientAngle = gradient;
|
||||
}
|
||||
|
||||
public SuperTabLinearGradientColorTable(Color[] colors, float[] positions)
|
||||
{
|
||||
_Colors = colors;
|
||||
_Positions = positions;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public properties
|
||||
|
||||
#region Colors
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Gradient Colors
|
||||
/// </summary>
|
||||
[Browsable(true), DefaultValue(null)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the Gradient Colors.")]
|
||||
public Color[] Colors
|
||||
{
|
||||
get { return (_Colors); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_Colors != value)
|
||||
{
|
||||
_Colors = value;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Positions
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Gradient Color Positions
|
||||
/// </summary>
|
||||
[Browsable(true), DefaultValue(null)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the Gradient Color Positions.")]
|
||||
public float[] Positions
|
||||
{
|
||||
get { return (_Positions); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_Positions != value)
|
||||
{
|
||||
_Positions = value;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region GradientAngle
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Gradient angle
|
||||
/// </summary>
|
||||
[Browsable(true), DefaultValue(90)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the Gradient angle.")]
|
||||
public int GradientAngle
|
||||
{
|
||||
get { return (_GradientAngle); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_GradientAngle != value)
|
||||
{
|
||||
_GradientAngle = value;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region AdaptiveGradient
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether the Gradient will adapt to changes in the TabAlignment
|
||||
/// </summary>
|
||||
[Browsable(true), DefaultValue(null)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates whether the Gradient will adapt to changes in the TabAlignment.")]
|
||||
public bool? AdaptiveGradient
|
||||
{
|
||||
get { return (_AdaptiveGradient); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_AdaptiveGradient != value)
|
||||
{
|
||||
_AdaptiveGradient = value;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IsEmpty
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether color definition is empty
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public bool IsEmpty
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((_Colors == null || _Colors.Length == 0) &&
|
||||
(_Positions == null || _Positions.Length == 0) &&
|
||||
_GradientAngle == 90 && _AdaptiveGradient.HasValue == false);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region OnColorTableChanged
|
||||
|
||||
protected void OnColorTableChanged()
|
||||
{
|
||||
if (ColorTableChanged != null)
|
||||
ColorTableChanged(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region GetBrush
|
||||
|
||||
public Brush GetBrush(Rectangle r)
|
||||
{
|
||||
return (GetBrush(r, _GradientAngle));
|
||||
}
|
||||
|
||||
public Brush GetBrush(Rectangle r, int angle)
|
||||
{
|
||||
if (_Colors != null && _Colors.Length > 0)
|
||||
{
|
||||
if (_Colors.Length == 1)
|
||||
return (new SolidBrush(Colors[0]));
|
||||
|
||||
LinearGradientBrush lbr =
|
||||
new LinearGradientBrush(r, Color.White, Color.White, angle);
|
||||
|
||||
lbr.InterpolationColors = GetColorBlend();
|
||||
|
||||
return (lbr);
|
||||
}
|
||||
|
||||
return (null);
|
||||
}
|
||||
|
||||
#region GetColorBlend
|
||||
|
||||
private ColorBlend GetColorBlend()
|
||||
{
|
||||
ColorBlend cb = new ColorBlend(_Colors.Length);
|
||||
float[] cp = _Positions;
|
||||
|
||||
if (cp == null || cp.Length != _Colors.Length)
|
||||
{
|
||||
cp = new float[_Colors.Length];
|
||||
|
||||
float f = 1 / _Colors.Length;
|
||||
|
||||
for (int i = 0; i < cp.Length; i++)
|
||||
cp[i] = i * f;
|
||||
|
||||
cp[_Colors.Length - 1] = 1;
|
||||
}
|
||||
|
||||
for (int i = 0; i < _Colors.Length; i++)
|
||||
cb.Colors[i] = _Colors[i];
|
||||
|
||||
cb.Positions = cp;
|
||||
|
||||
return (cb);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region GetColorBlendCollection
|
||||
|
||||
public BackgroundColorBlendCollection GetColorBlendCollection()
|
||||
{
|
||||
BackgroundColorBlendCollection cbc = new BackgroundColorBlendCollection();
|
||||
|
||||
float[] cp = _Positions;
|
||||
|
||||
if (cp == null || cp.Length != _Colors.Length)
|
||||
{
|
||||
cp = new float[_Colors.Length];
|
||||
|
||||
float f = 1 / _Colors.Length;
|
||||
|
||||
for (int i = 0; i < cp.Length; i++)
|
||||
cp[i] = i * f;
|
||||
|
||||
cp[_Colors.Length - 1] = 1;
|
||||
}
|
||||
|
||||
for (int i = 0; i < _Colors.Length; i++)
|
||||
cbc.Add(new BackgroundColorBlend(_Colors[i], cp[i]));
|
||||
|
||||
return (cbc);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ICloneable Members
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
SuperTabLinearGradientColorTable gct = new SuperTabLinearGradientColorTable();
|
||||
|
||||
gct.Colors = Colors;
|
||||
gct.Positions = Positions;
|
||||
gct.GradientAngle = GradientAngle;
|
||||
gct.AdaptiveGradient = AdaptiveGradient;
|
||||
|
||||
return (gct);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#region SuperTabLinearGradientColorTableConvertor
|
||||
|
||||
public class SuperTabLinearGradientColorTableConvertor : ExpandableObjectConverter
|
||||
{
|
||||
public override object ConvertTo(
|
||||
ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
if (destinationType == typeof(string))
|
||||
{
|
||||
SuperTabLinearGradientColorTable lct =
|
||||
value as SuperTabLinearGradientColorTable;
|
||||
|
||||
if (lct != null)
|
||||
{
|
||||
ColorConverter cvt = new ColorConverter();
|
||||
|
||||
if (lct.Colors != null)
|
||||
{
|
||||
if (lct.Colors[0] != Color.Empty)
|
||||
return (cvt.ConvertToString(lct.Colors[0]));
|
||||
|
||||
if (lct.Colors.Length > 1 && lct.Colors[1] != Color.Empty)
|
||||
return (cvt.ConvertToString(lct.Colors[1]));
|
||||
}
|
||||
|
||||
if (lct.GradientAngle != 90)
|
||||
return (lct.GradientAngle.ToString());
|
||||
|
||||
return (String.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
return (base.ConvertTo(context, culture, value, destinationType));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,485 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the colors for the SuperTabPanel
|
||||
/// </summary>
|
||||
[TypeConverter(typeof(SuperTabPanelColorTableConvertor))]
|
||||
public class SuperTabPanelColorTable : ICloneable
|
||||
{
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
/// Event raised when the SuperTabPanelColorTable is changed
|
||||
/// </summary>
|
||||
[Description("Event raised when the SuperTabPanelColorTable is changed")]
|
||||
public event EventHandler<EventArgs> ColorTableChanged;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private variables
|
||||
|
||||
private SuperTabPanelItemColorTable _Default;
|
||||
private SuperTabPanelItemColorTable _Left;
|
||||
private SuperTabPanelItemColorTable _Bottom;
|
||||
private SuperTabPanelItemColorTable _Right;
|
||||
|
||||
#endregion
|
||||
|
||||
public SuperTabPanelColorTable()
|
||||
{
|
||||
_Default = new SuperTabPanelItemColorTable();
|
||||
_Default.ColorTableChanged += PctColorTableChanged;
|
||||
|
||||
_Left = new SuperTabPanelItemColorTable();
|
||||
_Left.ColorTableChanged += PctColorTableChanged;
|
||||
|
||||
_Bottom = new SuperTabPanelItemColorTable();
|
||||
_Bottom.ColorTableChanged += PctColorTableChanged;
|
||||
|
||||
_Right = new SuperTabPanelItemColorTable();
|
||||
_Right.ColorTableChanged += PctColorTableChanged;
|
||||
}
|
||||
|
||||
#region Public properties
|
||||
|
||||
#region Default
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Default tab panel color settings
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the Default tab panel color settings.")]
|
||||
public SuperTabPanelItemColorTable Default
|
||||
{
|
||||
get { return (_Default); }
|
||||
set { SetNewColorTable(ref _Default, value); }
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeDefault()
|
||||
{
|
||||
return (_Default.IsEmpty == false);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetDefault()
|
||||
{
|
||||
Default = new SuperTabPanelItemColorTable();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Left
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Left Aligned tab panel color settings
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the Left Aligned tab panel color settings.")]
|
||||
public SuperTabPanelItemColorTable Left
|
||||
{
|
||||
get { return (_Left); }
|
||||
set { SetNewColorTable(ref _Left, value); }
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeLeft()
|
||||
{
|
||||
return (_Left.IsEmpty == false);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetLeft()
|
||||
{
|
||||
Left = new SuperTabPanelItemColorTable();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Bottom
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Bottom Aligned tab panel color settings
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the Bottom Aligned tab panel color settings.")]
|
||||
public SuperTabPanelItemColorTable Bottom
|
||||
{
|
||||
get { return (_Bottom); }
|
||||
set { SetNewColorTable(ref _Bottom, value); }
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeBottom()
|
||||
{
|
||||
return (_Bottom.IsEmpty == false);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetBottom()
|
||||
{
|
||||
Bottom = new SuperTabPanelItemColorTable();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Right
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Right Aligned tab panel color settings
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
[Description("Indicates the Right Aligned tab panel color settings.")]
|
||||
public SuperTabPanelItemColorTable Right
|
||||
{
|
||||
get { return (_Right); }
|
||||
set { SetNewColorTable(ref _Right, value); }
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeRight()
|
||||
{
|
||||
return (_Right.IsEmpty == false);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetRight()
|
||||
{
|
||||
Right = new SuperTabPanelItemColorTable();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IsEmpty
|
||||
|
||||
[Browsable(false)]
|
||||
public bool IsEmpty
|
||||
{
|
||||
get
|
||||
{
|
||||
return (_Default.IsEmpty == true && _Left.IsEmpty == true &&
|
||||
_Bottom.IsEmpty == true && _Right.IsEmpty == true);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region SetNewColorTable
|
||||
|
||||
private void SetNewColorTable(
|
||||
ref SuperTabPanelItemColorTable sct, SuperTabPanelItemColorTable newSct)
|
||||
{
|
||||
if (sct != null)
|
||||
sct.ColorTableChanged -= PctColorTableChanged;
|
||||
|
||||
sct = newSct;
|
||||
|
||||
if (sct != null)
|
||||
sct.ColorTableChanged += PctColorTableChanged;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region PctColorTableChanged
|
||||
|
||||
void PctColorTableChanged(object sender, EventArgs e)
|
||||
{
|
||||
OnColorTableChanged();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region OnColorTableChanged
|
||||
|
||||
private void OnColorTableChanged()
|
||||
{
|
||||
if (ColorTableChanged != null)
|
||||
ColorTableChanged(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ICloneable Members
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
SuperTabPanelColorTable pct = new SuperTabPanelColorTable();
|
||||
|
||||
pct.Default = (SuperTabPanelItemColorTable)Default.Clone();
|
||||
pct.Left = (SuperTabPanelItemColorTable)Left.Clone();
|
||||
pct.Bottom = (SuperTabPanelItemColorTable)Bottom.Clone();
|
||||
pct.Right = (SuperTabPanelItemColorTable)Right.Clone();
|
||||
|
||||
return (pct);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#region SuperTabPaneColorTableConvertor
|
||||
|
||||
public class SuperTabPanelColorTableConvertor : ExpandableObjectConverter
|
||||
{
|
||||
public override object ConvertTo(
|
||||
ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
return (String.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region SuperTabPanelItemColorTable
|
||||
|
||||
[TypeConverter(typeof(SuperTabPanelItemColorTableConvertor))]
|
||||
public class SuperTabPanelItemColorTable : ICloneable
|
||||
{
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
/// Event raised when the SuperTabPanelItemColorTable is changed
|
||||
/// </summary>
|
||||
[Description("Event raised when the SuperTabPanelItemColorTable is changed")]
|
||||
public event EventHandler<EventArgs> ColorTableChanged;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private variables
|
||||
|
||||
private Color _OuterBorder = Color.Empty;
|
||||
private Color _InnerBorder = Color.Empty;
|
||||
private SuperTabLinearGradientColorTable _Background;
|
||||
|
||||
#endregion
|
||||
|
||||
public SuperTabPanelItemColorTable()
|
||||
{
|
||||
_Background = new SuperTabLinearGradientColorTable();
|
||||
_Background.ColorTableChanged += Background_ColorTableChanged;
|
||||
}
|
||||
|
||||
#region Public properties
|
||||
|
||||
#region Background
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background colors.
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
public SuperTabLinearGradientColorTable Background
|
||||
{
|
||||
get { return (_Background); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_Background.Equals(value) == false)
|
||||
{
|
||||
if (_Background != null)
|
||||
_Background.ColorTableChanged -= Background_ColorTableChanged;
|
||||
|
||||
_Background = value;
|
||||
|
||||
if (_Background != null)
|
||||
_Background.ColorTableChanged += Background_ColorTableChanged;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeBackground()
|
||||
{
|
||||
return (_Background.IsEmpty == false);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetBackground()
|
||||
{
|
||||
Background = new SuperTabLinearGradientColorTable();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region OuterBorder
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the outer border.
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
public Color OuterBorder
|
||||
{
|
||||
get { return (_OuterBorder); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_OuterBorder != value)
|
||||
{
|
||||
_OuterBorder = value;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeOuterBorder()
|
||||
{
|
||||
return (_OuterBorder != Color.Empty);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetOuterBorder()
|
||||
{
|
||||
_OuterBorder = Color.Empty;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region InnerBorder
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the colors for the inner border.
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[NotifyParentProperty(true)]
|
||||
public Color InnerBorder
|
||||
{
|
||||
get { return (_InnerBorder); }
|
||||
|
||||
set
|
||||
{
|
||||
if (_InnerBorder != value)
|
||||
{
|
||||
_InnerBorder = value;
|
||||
|
||||
OnColorTableChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeInnerBorder()
|
||||
{
|
||||
return (_InnerBorder != Color.Empty);
|
||||
}
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public void ResetInnerBorder()
|
||||
{
|
||||
_InnerBorder = Color.Empty;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IsEmpty
|
||||
|
||||
[Browsable(false)]
|
||||
public bool IsEmpty
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Background.IsEmpty == false)
|
||||
return (false);
|
||||
|
||||
if (_OuterBorder != Color.Empty)
|
||||
return (false);
|
||||
|
||||
if (_InnerBorder != Color.Empty)
|
||||
return (false);
|
||||
|
||||
return (true);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region Background_ColorTableChanged
|
||||
|
||||
void Background_ColorTableChanged(object sender, EventArgs e)
|
||||
{
|
||||
OnColorTableChanged();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region OnColorTableChanged
|
||||
|
||||
private void OnColorTableChanged()
|
||||
{
|
||||
if (ColorTableChanged != null)
|
||||
ColorTableChanged(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ICloneable Members
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
SuperTabPanelItemColorTable sct = new SuperTabPanelItemColorTable();
|
||||
|
||||
sct.Background = (SuperTabLinearGradientColorTable)Background.Clone();
|
||||
|
||||
sct.OuterBorder = OuterBorder;
|
||||
sct.InnerBorder = InnerBorder;
|
||||
|
||||
return (sct);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#region SuperTabPanelItemColorTableConvertor
|
||||
|
||||
public class SuperTabPanelItemColorTableConvertor : ExpandableObjectConverter
|
||||
{
|
||||
public override object ConvertTo(
|
||||
ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
if (destinationType == typeof(string))
|
||||
{
|
||||
SuperTabPanelItemColorTable sct = value as SuperTabPanelItemColorTable;
|
||||
|
||||
if (sct != null)
|
||||
{
|
||||
ColorConverter cvt = new ColorConverter();
|
||||
|
||||
if (sct.Background.Colors != null)
|
||||
return (cvt.ConvertToString(sct.Background.Colors[0]));
|
||||
|
||||
if (sct.InnerBorder.IsEmpty == false)
|
||||
return (cvt.ConvertToString(sct.InnerBorder));
|
||||
|
||||
if (sct.OuterBorder.IsEmpty == false)
|
||||
return (cvt.ConvertToString(sct.OuterBorder));
|
||||
|
||||
return (String.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
return (base.ConvertTo(context, culture, value, destinationType));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines color table for the SwitchButton control.
|
||||
/// </summary>
|
||||
public class SwitchButtonColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or set the text/caption color.
|
||||
/// </summary>
|
||||
public Color TextColor = ColorScheme.GetColor(0x1E395B);
|
||||
/// <summary>
|
||||
/// Gets or sets the OFF text color.
|
||||
/// </summary>
|
||||
public Color OffTextColor = ColorScheme.GetColor(0x66788E);
|
||||
/// <summary>
|
||||
/// Gets or sets the ON text color.
|
||||
/// </summary>
|
||||
public Color OnTextColor = ColorScheme.GetColor(0x66788E);
|
||||
/// <summary>
|
||||
/// Gets or sets the button border color.
|
||||
/// </summary>
|
||||
public Color BorderColor = ColorScheme.GetColor(0xB1C0D6);
|
||||
/// <summary>
|
||||
/// Gets or sets background color of OFF switch part.
|
||||
/// </summary>
|
||||
public Color OffBackColor = ColorScheme.GetColor(0xEFF6FD);
|
||||
/// <summary>
|
||||
/// Gets or sets background color of ON switch part.
|
||||
/// </summary>
|
||||
public Color OnBackColor = ColorScheme.GetColor(0x92D050);
|
||||
/// <summary>
|
||||
/// Gets or sets the switch border color.
|
||||
/// </summary>
|
||||
public Color SwitchBorderColor = ColorScheme.GetColor(0x95A8C4);
|
||||
/// <summary>
|
||||
/// Gets or sets the switch background color.
|
||||
/// </summary>
|
||||
public Color SwitchBackColor = ColorScheme.GetColor(0xDBE7F4);
|
||||
/// <summary>
|
||||
/// Gets or sets the switch background color when in ON state, i.e. Value=true. When set to Color.Empty SwitchBackColor is always used.
|
||||
/// </summary>
|
||||
public Color SwitchOnBackColor = Color.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets default disabled color scheme for the switch button.
|
||||
/// </summary>
|
||||
public static SwitchButtonColorTable Disabled
|
||||
{
|
||||
get
|
||||
{
|
||||
SwitchButtonColorTable disabled = new SwitchButtonColorTable();
|
||||
disabled.BorderColor = ColorScheme.GetColor(0xD0D0D0);
|
||||
disabled.OffBackColor = ColorScheme.GetColor(0xE6E6E6);
|
||||
disabled.OffTextColor = ColorScheme.GetColor(0xD0D0D0);
|
||||
disabled.OnBackColor = ColorScheme.GetColor(0xE6E6E6);
|
||||
disabled.OnTextColor = ColorScheme.GetColor(0xD0D0D0);
|
||||
disabled.SwitchBackColor = ColorScheme.GetColor(0xE6E6E6);
|
||||
disabled.SwitchBorderColor = ColorScheme.GetColor(0xD0D0D0);
|
||||
disabled.TextColor = ColorScheme.GetColor(0x87929F);
|
||||
|
||||
return disabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SwitchButtonColors
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets default Switch Button color table.
|
||||
/// </summary>
|
||||
public SwitchButtonColorTable Default = new SwitchButtonColorTable();
|
||||
/// <summary>
|
||||
/// Gets or sets the disabled Switch Button color table.
|
||||
/// </summary>
|
||||
public SwitchButtonColorTable Disabled = SwitchButtonColorTable.Disabled;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DevComponents.DotNetBar.Rendering
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents color table for Windows 7 style.
|
||||
/// </summary>
|
||||
public class Windows7ColorTable : Office2007ColorTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the Office2010ColorTable class.
|
||||
/// </summary>
|
||||
public Windows7ColorTable()
|
||||
{
|
||||
Windows7BlueFactory.InitializeBlueColorTable(this, ColorFactory.Empty);
|
||||
}
|
||||
|
||||
public Windows7ColorTable(eWindows7ColorScheme color)
|
||||
{
|
||||
Windows7BlueFactory.InitializeBlueColorTable(this, ColorFactory.Empty);
|
||||
}
|
||||
|
||||
public Windows7ColorTable(eWindows7ColorScheme color, Color blendColor)
|
||||
{
|
||||
Windows7BlueFactory.InitializeBlueColorTable(this, blendColor.IsEmpty ? ColorFactory.Empty : new ColorBlendFactory(blendColor));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the color scheme type for the Office2010ColorTable.
|
||||
/// </summary>
|
||||
public enum eWindows7ColorScheme
|
||||
{
|
||||
/// <summary>
|
||||
/// Blue color scheme.
|
||||
/// </summary>
|
||||
Blue
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user