New to Telerik UI for WinForms? Start a free 30-day trial

Supplies ruler geometry and applies marker changes to the active RadRichTextBox document.

Definition

Namespace:Telerik.WinControls.RichTextEditor.UI

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public class RadRichTextBoxRulerController : IDocumentRulerController

Inheritance: objectRadRichTextBoxRulerController

Implements: IDocumentRulerController

Constructors

Initializes a controller that tracks the editor's active paragraph and layout changes.

C#
public RadRichTextBoxRulerController(RadRichTextBox richTextBox)
Parameters:richTextBoxRadRichTextBox

The editor whose document is reflected by the ruler.

Methods

Adds a tab stop to the current paragraph.

C#
public void AddTabStop(TabStopInfo tabStop)
Parameters:tabStopTabStopInfo

The alignment and position of the new tab stop.

Implements: IDocumentRulerController.AddTabStop(TabStopInfo)

Moves an existing tab stop in the current paragraph.

C#
public void ChangeTabStopPosition(TabStopInfo tabStopInfo, double offset)
Parameters:tabStopInfoTabStopInfooffsetdouble

The new position of the tab stop.

Implements: IDocumentRulerController.ChangeTabStopPosition(TabStopInfo, double)

Gets the default tab-stop positions that fall within the specified paragraph width.

C#
public IEnumerable<double> GetDefaultTabStopsByWidth(double width)
Parameters:widthdouble

The paragraph width available to the ruler.

Returns:

IEnumerable<double>

The positions of default tab stops within that width.

Implements: IDocumentRulerController.GetDefaultTabStopsByWidth(double)

Gets the text flow direction, using the containing table's direction when the caret is inside a table.

C#
public FlowDirection GetFlowDirection()
Returns:

FlowDirection

The active text flow direction.

Implements: IDocumentRulerController.GetFlowDirection()

Gets the margin, table-column, or section-column separators for the current editing position.

C#
public IEnumerable<SeparatorInfo> GetHorizontalSeparators()
Returns:

IEnumerable<SeparatorInfo>

The horizontal separators to display.

Implements: IDocumentRulerController.GetHorizontalSeparators()

Gets the current paragraph's indent values and the separators that bound its text area.

C#
public void GetIndents(out FlowDirection textFlowDirection, out SeparatorInfo leftSeparator, out SeparatorInfo rightSeparator, out double firstLineIndent, out double hangingIndent, out double rightIndent, out double columnLeftOffset, out double columnRightOffset)
Parameters:textFlowDirectionFlowDirection

Receives the current paragraph's text direction.

leftSeparatorSeparatorInfo

Receives the separator on the paragraph's leading side, or null when no paragraph is active.

rightSeparatorSeparatorInfo

Receives the separator on the paragraph's trailing side, or null when no paragraph is active.

firstLineIndentdouble

Receives the first-line indent including the active column offset, or -1 when no paragraph is active.

hangingIndentdouble

Receives the left indent including the active column offset, or -1 when no paragraph is active.

rightIndentdouble

Receives the right indent including the active column offset, or -1 when no paragraph is active.

columnLeftOffsetdouble

Receives the left offset of the active section column, or 0 when not in a section column.

columnRightOffsetdouble

Receives the right offset of the active section column, or 0 when not in a section column.

Implements: IDocumentRulerController.GetIndents(out FlowDirection, out SeparatorInfo, out SeparatorInfo, out double, out double, out double, out double, out double)

Gets the flow direction used to lay out ruler markers for the current paragraph or table.

C#
public FlowDirection GetMarkersFlowDirection()
Returns:

FlowDirection

The marker flow direction.

Implements: IDocumentRulerController.GetMarkersFlowDirection()

Gets the current section's bounds in the editor view.

C#
public Rect GetPageSizeAndPosition()
Returns:

Rect

The section rectangle, or an empty rectangle when bounds are unavailable.

Implements: IDocumentRulerController.GetPageSizeAndPosition()

Gets the editor's horizontal and vertical scale factors for converting document geometry to ruler coordinates.

C#
public Size GetScaleFactor()
Returns:

Size

The scale factors, with horizontal and vertical values in the width and height components.

Implements: IDocumentRulerController.GetScaleFactor()

Gets the tab stops active for the current paragraph, including stops merged from its style.

C#
public IEnumerable<TabStopInfo> GetTabStops()
Returns:

IEnumerable<TabStopInfo>

The tab stops represented by ruler markers.

Implements: IDocumentRulerController.GetTabStops()

Gets the margin and, when editing inside a table, row separators for the current editing position.

C#
public IEnumerable<SeparatorInfo> GetVerticalSeparators()
Returns:

IEnumerable<SeparatorInfo>

The vertical separators to display.

Implements: IDocumentRulerController.GetVerticalSeparators()

Determines whether dragging a section-column separator would leave a valid equal-column spacing.

C#
public bool IsValidColumnSeparatorChange(SeparatorInfo separatorInfo, double currentPosition, double horizontalChange)
Parameters:separatorInfoSeparatorInfo

The section-column separator being dragged.

currentPositiondouble

The current separator position in document coordinates.

horizontalChangedouble

The proposed horizontal movement.

Returns:

bool

true when equal-column spacing remains above the minimum and below the calculated maximum; otherwise, false.

Implements: IDocumentRulerController.IsValidColumnSeparatorChange(SeparatorInfo, double, double)

Raises PageChanged after the ruler's section bounds or scale changes.

C#
protected virtual void OnPageChanged()

Raises SeparatorsChanged when ruler separator or marker data must be refreshed.

C#
protected virtual void OnSeparatorsChanged()

Removes a tab stop from the current paragraph.

C#
public void RemoveTabStop(TabStopInfo tabStop)
Parameters:tabStopTabStopInfo

The tab stop returned by GetTabStops().

Implements: IDocumentRulerController.RemoveTabStop(TabStopInfo)

Sets the first-line indent for the current paragraph.

C#
public void SetSeparatorFirstLineIndent(double indent)
Parameters:indentdouble

The first-line indent position shown by the ruler.

Implements: IDocumentRulerController.SetSeparatorFirstLineIndent(double)

Applies the supplied first-line and hanging-indent values to the current paragraph.

C#
public void SetSeparatorFirstLineIndentAndHangingIndent(double firstLineIndent, double hangingIndent)
Parameters:firstLineIndentdouble

The first-line indent value supplied by the ruler.

hangingIndentdouble

The hanging-indent value supplied by the ruler.

Implements: IDocumentRulerController.SetSeparatorFirstLineIndentAndHangingIndent(double, double)

The built-in controller currently applies hangingIndent and does not use firstLineIndent.

Sets the paragraph's left indent while preserving the previous first-line position.

C#
public void SetSeparatorHangingIndent(double indent)
Parameters:indentdouble

The hanging-indent position shown by the ruler.

Implements: IDocumentRulerController.SetSeparatorHangingIndent(double)

Applies a dragged separator value to the corresponding page margin, table size, or section-column spacing.

C#
public void SetSeparatorOffset(SeparatorInfo separator, double offset)
Parameters:separatorSeparatorInfo

The separator being moved.

offsetdouble

The new value interpreted according to Type. For section-column separators, the built-in controller instead reads Offset.

Implements: IDocumentRulerController.SetSeparatorOffset(SeparatorInfo, double)

Sets the paragraph's right indent, clamping negative values to zero.

C#
public void SetSeparatorRightIndent(double indent)
Parameters:indentdouble

The right-indent position shown by the ruler.

Implements: IDocumentRulerController.SetSeparatorRightIndent(double)

Events

Occurs when the current section bounds or scale changes and the ruler must update its geometry.

C#
public event EventHandler<EventArgs> PageChanged

Implements: IDocumentRulerController.PageChanged

Occurs when paragraph, table, or section formatting changes the ruler separators or markers.

C#
public event EventHandler<EventArgs> SeparatorsChanged

Implements: IDocumentRulerController.SeparatorsChanged