Class TabPanelRenderer
A default ITabPanelRenderer implementation.
Inherited Members
Namespace: Syncfusion.Windows.Forms.Tools
Assembly: Syncfusion.Tools.Windows.dll
Syntax
public abstract class TabPanelRenderer : ITabPanelRenderer, ITabPanelDefaultProperties
Remarks
The SingleLineTabPanelRenderer and MultilineTabPanelRenderer renderers derive from this class.
Constructors
TabPanelRenderer()
Creates a new instance of the TabPanelRenderer class.
Declaration
public TabPanelRenderer()
Fields
bringSelectedTabToFront
Initialize the bringSelectedTabToFront.
Declaration
protected bool bringSelectedTabToFront
Field Value
Type |
---|
System.Boolean |
currentHotTrackTab
Initialize the current hot track tab item.
Declaration
protected int currentHotTrackTab
Field Value
Type |
---|
System.Int32 |
currentTooltipTab
Initialize the current tooltip tab item.
Declaration
protected int currentTooltipTab
Field Value
Type |
---|
System.Int32 |
tabRenderers
Initialize the tab renderers.
Declaration
protected ArrayList tabRenderers
Field Value
Type |
---|
System.Collections.ArrayList |
tdbounds
Initialize the bounds of the tab panel renderer.
Declaration
protected RectangleF tdbounds
Field Value
Type |
---|
System.Drawing.RectangleF |
Properties
Bounds
Gets or sets the bounds. See Bounds.
Declaration
public RectangleF Bounds { get; set; }
Property Value
Type |
---|
System.Drawing.RectangleF |
CanScrollLeft
Indicates whether scrolling to the left is allowed for the current layout. See CanScrollLeft.
Declaration
public virtual bool CanScrollLeft { get; }
Property Value
Type |
---|
System.Boolean |
CanScrollRight
Indicates whether scrolling to the right is allowed for the current layout. See CanScrollRight.
Declaration
public virtual bool CanScrollRight { get; }
Property Value
Type |
---|
System.Boolean |
DragIgnoreRect
The rectangular region where drop should not be performed during drag and drop.
Declaration
protected RectangleF DragIgnoreRect { get; }
Property Value
Type |
---|
System.Drawing.RectangleF |
Remarks
This region is in transformed co-ordinates.
ForceDrawImage
Gets or sets whether tab panel forced to draw image.
Declaration
public bool ForceDrawImage { get; set; }
Property Value
Type |
---|
System.Boolean |
IsMirrored
Gets the IsMirrored
Declaration
public virtual bool IsMirrored { get; }
Property Value
Type |
---|
System.Boolean |
Moving
Indicates whether the user is moving tabs using a drag-and-drop.
Declaration
protected virtual bool Moving { get; set; }
Property Value
Type |
---|
System.Boolean |
NeedLayout
Indicates whether the layout is required.
Declaration
public bool NeedLayout { get; }
Property Value
Type |
---|
System.Boolean |
NeedMouseMove
See NeedMouseMove.
Declaration
public bool NeedMouseMove { get; }
Property Value
Type |
---|
System.Boolean |
Renderers
Gets the Tab Renderers.
Declaration
public ArrayList Renderers { get; }
Property Value
Type |
---|
System.Collections.ArrayList |
ScrollingSupported
See ScrollingSupported.
Declaration
public virtual bool ScrollingSupported { get; }
Property Value
Type |
---|
System.Boolean |
SelectedIndexOnDragStart
Returns the selected tab index when drag and drop started.
Declaration
protected int SelectedIndexOnDragStart { get; }
Property Value
Type |
---|
System.Int32 |
ShouldShowSuperToolTips
Returns whether tooltips should be shown or not.
Declaration
protected bool ShouldShowSuperToolTips { get; }
Property Value
Type |
---|
System.Boolean |
ShouldShowToolTips
Returns whether tooltips should be shown or not.
Declaration
protected bool ShouldShowToolTips { get; }
Property Value
Type |
---|
System.Boolean |
SuperToolTip
Gets the SuperToolTip info.
Declaration
protected ToolTipInfo SuperToolTip { get; }
Property Value
Type |
---|
ToolTipInfo |
TabPanelBackColor
Returns the backcolor of TabPanel.
Declaration
public virtual Color TabPanelBackColor { get; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The tab panel backcolor. |
TabPanelData
Gets or sets TabPanelData. See TabPanelData.
Declaration
public ITabPanelData TabPanelData { get; set; }
Property Value
Type |
---|
ITabPanelData |
tabRenderersList
Retrieve the appropriate tab renderers based on the IsVisualStyleBasedTheme property
Declaration
protected ArrayList tabRenderersList { get; }
Property Value
Type |
---|
System.Collections.ArrayList |
ToolTipText
Returns the ToolTip text
Declaration
protected string ToolTipText { get; }
Property Value
Type |
---|
System.String |
Methods
ApplyDrawingTransform(RectangleF, Boolean)
Transforms the RectangleF in client co-ordinates to rotated drawing co-ordinates.
Declaration
public virtual RectangleF ApplyDrawingTransform(RectangleF rect, bool apply)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | rect | The RectangleF to transform. |
System.Boolean | apply | Indicates whether to transform to drawing co-ordinates or to transform to client co-ordinates. |
Returns
Type | Description |
---|---|
System.Drawing.RectangleF | The transformed System.Drawing.RectangleF. |
Remarks
The TabPanelRenderer class performs the drawing of the tabs in a transformed space to accommodate the top, bottom, left and right alignment of the tabs. The transform is such that irrespective of the tab alignment the TabPanelRenderer can use the same code to draw the tabs.
CancelTabDrag()
Cancels the current tab drag-and-drop.
Declaration
public virtual void CancelTabDrag()
ComputeTabPositions(Graphics)
Declaration
public abstract void ComputeTabPositions(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g |
CreateNewRenderer(String, ITabData)
Creates a new ITabRenderer given a tab style name.
Declaration
protected ITabRenderer CreateNewRenderer(string tabStyle, ITabData tabData)
Parameters
Type | Name | Description |
---|---|---|
System.String | tabStyle | The tab style name. |
ITabData | tabData | The ITabData containing the data for the renderer. Can be null. |
Returns
Type | Description |
---|---|
ITabRenderer | The new ITabRenderer. |
DefaultActiveTabColor()
Returns the default Active Tab Color.
Declaration
public virtual Color DefaultActiveTabColor()
Returns
Type | Description |
---|---|
System.Drawing.Color | The Color instance. |
DefaultActiveTabFont()
Returns the default active tab font.
Declaration
public virtual Font DefaultActiveTabFont()
Returns
Type | Description |
---|---|
System.Drawing.Font | The Font instance. |
DefaultFixedSingleBorderColor()
Returns the default single border color.
Declaration
public virtual Color DefaultFixedSingleBorderColor()
Returns
Type | Description |
---|---|
System.Drawing.Color | The Color instance. |
DefaultInactiveTabColor()
Returns the default Inactive Tab Color.
Declaration
public virtual Color DefaultInactiveTabColor()
Returns
Type | Description |
---|---|
System.Drawing.Color | The Color instance. |
DefaultInactiveTabFont()
Returns the default inactive tab font.
Declaration
public virtual Font DefaultInactiveTabFont()
Returns
Type | Description |
---|---|
System.Drawing.Font | The Font instance. |
DefaultTabForeColor()
Returns the default tab forecolor.
Declaration
public virtual Color DefaultTabForeColor()
Returns
Type | Description |
---|---|
System.Drawing.Color | The Color instance. |
DefaultTabPanelBackgroundColor()
Returns the default tab panel background color.
Declaration
public virtual Color DefaultTabPanelBackgroundColor()
Returns
Type | Description |
---|---|
System.Drawing.Color | The Color instance. |
DefaultTabPanelFont()
Returns the default tab panel font.
Declaration
public virtual Font DefaultTabPanelFont()
Returns
Type | Description |
---|---|
System.Drawing.Font | The Font instance. |
Detach()
Called when a ITabPanelData instance is detached from this renderer.
Declaration
public virtual void Detach()
DrawItemCallback(DrawTabEventArgs)
Calls the OnDrawItem(DrawTabEventArgs) method.
Declaration
public bool DrawItemCallback(DrawTabEventArgs eventArgs)
Parameters
Type | Name | Description |
---|---|---|
DrawTabEventArgs | eventArgs |
Returns
Type |
---|
System.Boolean |
GetHiddenTabsCount()
Returns the Hidden tabs count.
Declaration
protected int GetHiddenTabsCount()
Returns
Type | Description |
---|---|
System.Int32 | The count of the hidden tab items. |
GetIsMirroredForVerticalAlignment()
Returns whether the TabControl is mirrored for vertical alignment.
Declaration
protected bool GetIsMirroredForVerticalAlignment()
Returns
Type |
---|
System.Boolean |
GetLargestHeight(Graphics)
Returns the largest height for any tab.
Declaration
public virtual float GetLargestHeight(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | A Graphics object. |
Returns
Type | Description |
---|---|
System.Single | The largest height. |
GetMousePosition()
Gets the mouse position
Declaration
public Point GetMousePosition()
Returns
Type |
---|
System.Drawing.Point |
GetMousePosition(Point)
Gets the mouse position.
Declaration
public Point GetMousePosition(Point mousePosition)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | mousePosition | The mouse point. |
Returns
Type |
---|
System.Drawing.Point |
GetPreferredSize(Graphics, ref SizeF)
Declaration
public abstract void GetPreferredSize(Graphics g, ref SizeF preferredSize)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | |
System.Drawing.SizeF | preferredSize |
GetTabBounds(Int32)
See GetTabBounds(Int32).
Declaration
public virtual Rectangle GetTabBounds(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Returns
Type |
---|
System.Drawing.Rectangle |
HitTestTabs(PointF, Boolean)
Returns the tab index at the specified location.
Declaration
public int HitTestTabs(PointF mousePosition, bool inTransformedCoOrds)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF | mousePosition | The location where hit test is to be performed. |
System.Boolean | inTransformedCoOrds | Indicates whether the above location is in absolute or transformed co-ordinates. |
Returns
Type | Description |
---|---|
System.Int32 | The hit tab index; -1 if no tab was found. |
InvalidateTabs(Int32, Int32)
Invalidates the union of the tab regions specified by their indices.
Declaration
protected virtual void InvalidateTabs(int tab1, int tab2)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tab1 | The beginning tab index. |
System.Int32 | tab2 | The ending tab index. |
IsBackgroundSolid()
Indicates whether the background will be a solid color.
Declaration
public virtual bool IsBackgroundSolid()
Returns
Type | Description |
---|---|
System.Boolean | True if solid; false otherwise. |
IsMovingTab()
Indicates whether a tab is currently being moved.
Declaration
public virtual bool IsMovingTab()
Returns
Type | Description |
---|---|
System.Boolean | True if moving; false otherwise. |
Layout(Graphics, Boolean)
Declaration
public virtual void Layout(Graphics g, bool fromPaint)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | A System.Drawing.Graphics instance. |
System.Boolean | fromPaint |
MoveTabs(Int32, Int32, Int32)
Moves tabs in groups from one position to other.
Declaration
protected virtual void MoveTabs(int nTabsToMoveFrom, int nCount, int nMoveToIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nTabsToMoveFrom | The beginning position of the group. |
System.Int32 | nCount | The number of tabs to move. |
System.Int32 | nMoveToIndex | The destination position. |
OnBoundsAffected()
Called when a property is changed that requires recalculating the preferred size and layout.
Declaration
protected virtual void OnBoundsAffected()
OnDragMoveTabs(MouseEventArgs)
Called as the tab is dragged.
Declaration
protected virtual void OnDragMoveTabs(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e |
Remarks
OnGotFocus(EventArgs)
Called by the tab control when focused.
Declaration
public virtual void OnGotFocus(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | The EventArgs instance. |
OnLostFocus(EventArgs)
Called by the tab control when it has lost focus.
Declaration
public virtual void OnLostFocus(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | The EventArgs instance. |
OnMouseDown(MouseEventArgs)
Called by the tab control when a mouse down occurs.
Declaration
public virtual void OnMouseDown(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e | The System.Windows.Forms.MouseEventArgs instance. |
OnMouseEnter(EventArgs)
Called by the tab control when mouse enter the bounds of the controls.
Declaration
public virtual void OnMouseEnter(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | The System.EventArgs instance containing the event data. |
OnMouseHover(EventArgs)
Called by the tab control when mouse hovers on the control.
Declaration
public virtual void OnMouseHover(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | The System.EventArgs instance containing the event data. |
OnMouseLeave(EventArgs)
Called by the tab control when mouse leave had occurred.
Declaration
public virtual void OnMouseLeave(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | The System.Windows.Forms.MouseEventArgs instance. |
OnMouseMove(MouseEventArgs)
Called by the tab control when mouse move has occurred.
Declaration
public virtual void OnMouseMove(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e | The System.Windows.Forms.MouseEventArgs instance. |
OnMouseUp(MouseEventArgs)
Called by the tab control when a mouse up occurs.
Declaration
public virtual void OnMouseUp(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e | The System.Windows.Forms.MouseEventArgs instance. |
OnPaint(Graphics, Rectangle)
Draws the tabs.
Declaration
public virtual void OnPaint(Graphics g, Rectangle clipRect)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | The System.Drawing.Graphics object. |
System.Drawing.Rectangle | clipRect | The rectangle that should be clipped from the drawing region. |
OnPaintPanelBackground(Graphics, Color, Rectangle)
Paints the tab panel background.
Declaration
public virtual void OnPaintPanelBackground(Graphics g, Color backColor, Rectangle rect)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | The System.Drawing.Graphics instance. |
System.Drawing.Color | backColor | The background System.Drawing.Color. |
System.Drawing.Rectangle | rect | The rectangle that should be used for the painting region. |
OnSelectionChanged(Int32, Int32)
Called when the associated ITabControl's selected index is changed.
Declaration
protected virtual void OnSelectionChanged(int previousIndex, int currentIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | previousIndex | The previously selected tab index. |
System.Int32 | currentIndex | The newly selected tab index. |
OnTabsCollectionChanged()
Called when the tabs collection is changed.
Declaration
protected virtual void OnTabsCollectionChanged()
OnTabStyleChanged()
Called when the associated ITabControl's TabStyle is changed.
Declaration
protected virtual void OnTabStyleChanged()
RemoveTabRenderers()
Removes the ITabRenderers.
Declaration
protected virtual void RemoveTabRenderers()
ResetHotTracking()
Resets hot tracking state, if any.
Declaration
protected void ResetHotTracking()
Scroll(ScrollIncrement, ScrollDirection)
Declaration
public virtual void Scroll(ScrollIncrement increment, ScrollDirection direction)
Parameters
Type | Name | Description |
---|---|---|
ScrollIncrement | increment | The ScrollIncrement indicates the increment |
ScrollDirection | direction | The scroll direction. |
SetNeedLayout(Boolean)
Sets the tab positions that needs to be recalculated.
Declaration
protected void SetNeedLayout(bool needLayout)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | needLayout |
ShouldDrawVisible(ITabData)
Indicates whether the TabData visible or not.
Declaration
protected virtual bool ShouldDrawVisible(ITabData tabData)
Parameters
Type | Name | Description |
---|---|---|
ITabData | tabData |
Returns
Type |
---|
System.Boolean |
ShowSuperTooltip(ToolTipInfo)
Shows or hides super tooltip.
Declaration
protected void ShowSuperTooltip(ToolTipInfo info)
Parameters
Type | Name | Description |
---|---|---|
ToolTipInfo | info | The super tooltip info. |
ShowToolTip(String)
Shows or Hides Tooltip window.
Declaration
protected void ShowToolTip(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | Text to show in toolTip. If text is null or empty string, toolTip is hidden. |
StartShowingToolTip(Int32)
Start showing tooltips
Declaration
protected void StartShowingToolTip(int interval)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | interval |
StopShowingToolTip()
Stops showing tooltips
Declaration
protected void StopShowingToolTip()
Tab_BoundsAffected(Object, EventArgs)
The event handler that gets called when a ITabData's bounds are affected.
Declaration
protected virtual void Tab_BoundsAffected(object sender, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The ITabData. |
System.EventArgs | e | An EventArgs instance containing information regarding this event. |
Tab_PropertyChanged(Object, EventArgs)
The event handler that gets called when a ITabData's property is changed.
Declaration
protected virtual void Tab_PropertyChanged(object sender, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The ITabData. |
System.EventArgs | e | An EventArgs instance containing information regarding this event. |
TabPanel_PropertyChanged(ITabPanelData, TabPanelPropertyChangedEventArgs)
The event handler that gets called when the corresponding ITabPanelData's property is changed.
Declaration
protected virtual void TabPanel_PropertyChanged(ITabPanelData sender, TabPanelPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
ITabPanelData | sender | The ITabPanelData. |
TabPanelPropertyChangedEventArgs | e | A TabPanelPropertyChangedEventArgs containing information regarding this event. |
ValidateScrollOffset(Boolean, Boolean)
Declaration
public virtual void ValidateScrollOffset(bool makeSelectedTabVisible, bool invalidate)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | makeSelectedTabVisible | Indicates to make selected tab visible. |
System.Boolean | invalidate | Invalidate the scrolling. |