Interface IEditControl
The edit control root interface. Provides access to the selection, the Undo buffer and a number of properties that control the display and behaviour of the editor.
Namespace: SdlSdl.DesktopEditorEditorApi
Assembly: Sdl.DesktopEditor.EditorApi.dll
Syntax
public interface IEditControl : IControl, IDisposable
Properties
AcceptsReturn
When true
the control will insert a line break at the current selection when the Return
or Enter key is pressed. When false
the edit control will not process those keys.
Declaration
bool AcceptsReturn { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
The default value is false
.
When the control appears in a dialog you can use this property to determine if the Return key should execute the default dialog action or insert a linebreak in the edit control.
Note that disabling this will not totally prevent users from inserting line breaks in the edit control, as the could e.g. copy and paste one.AcceptsTab
When true
the control will insert a tab character at the current selection when the Tab
key is pressed. When false
the edit control will not process Tab.
Declaration
bool AcceptsTab { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
The default value is true
.
When the control appears in a dialog you may want to set this to false
to allow users
to use the tab key to navigate between controls in the dialog.
Note that disabling this will not totally prevent users from inserting tab spaces in the edit control, as the could e.g. copy and paste one.
ActiveRow
The currently active row in the edit control, or null
if none.
Declaration
IRowInfo ActiveRow { get; set; }
Property Value
Type | Description |
---|---|
IRowInfo |
Remarks
The active row is typically highlighted in some fashion, e.g using background color and/or border.
The active row can also be changed by setting the Active property explicitly on one of the rows in the edit control.
AddActiveRowToSelected
Gets or sets value indicating if active row will be automatically added to selected rows set.
Declaration
bool AddActiveRowToSelected { get; set; }
Property Value
Type | Description |
---|---|
bool |
AutoUpdate
When true
(default) the control automatically updates its content when changes are
made to the document.
Declaration
bool AutoUpdate { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
This is an advanced setting.
You can temporarily set this to false
to disable screen updating e.g. while executing
complex operations that involve multiple edit commands that are not wrapped into a single undo operation.
This will significantly improve the execution speed of the commands, but you must set this
property to true
afterwards, or the content in the editor may not correspond to what
is in the document (which could cause invalid operations if the user edits the content).
Another user for this setting is to avoid updating controls that are not in view.
Setting this from false
to true
will cause the control to update itself
to reflect all changes to the document since this setting was set to false
.
You can also explicitly force the control to update itself by calling Redraw().
ColumnsLeft
Custom columns located to the left of the main control content.
Declaration
ICustomColumn[] ColumnsLeft { get; }
Property Value
Type | Description |
---|---|
ICustomColumn |
ColumnsRight
Custom columns located to the right of the main control content.
Declaration
ICustomColumn[] ColumnsRight { get; }
Property Value
Type | Description |
---|---|
ICustomColumn |
ContentHeight
The height (vertical size) in pixels of the content currently shown in the edit control.
Declaration
long ContentHeight { get; }
Property Value
Type | Description |
---|---|
long |
Remarks
This can be used to determine scrollbar size/scale or to re-size the control to fit its content.
Document
Contains all the data shown and manipulated in the editor.
Declaration
IDocument Document { get; set; }
Property Value
Type | Description |
---|---|
IDocument |
Remarks
Assigning to this property will reset the edit control to display the content of the new document.
If the document is null
the edit control is empty, and
editing operations are not possible.
HideFileTags
When true
, segments containing file tags are hidden.
Declaration
bool HideFileTags { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
This setting is off by default.
HighlightActiveRow
Determines whether the currently active row should be highlighted with the HighlightedBackColor.
Default is true
.
Declaration
bool HighlightActiveRow { get; set; }
Property Value
Type | Description |
---|---|
bool |
HighlightedBackColor
The background color used as a base color for highlighted rows.
Declaration
Color HighlightedBackColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
Remarks
The actual color for a highlighted row also depends on whether the row is shaded.
HighlightedRows
All rows that have the Highlighted property set to true.
Declaration
IEnumerable<IRowInfo> HighlightedRows { get; }
Property Value
Type | Description |
---|---|
IEnumerableIRowInfo |
IsInitialUpdateCompleted
true
when the control has been fully initialized. This is set just
before the AfterInitialUpdate event is raised.
Declaration
bool IsInitialUpdateCompleted { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
When a different document is assigned to the control this property may
be false
until the control has been updated to reflect the new content.
IsOverwriteModeEnabled
Returns true
whenever overwriting is enabled in the editor. When the user changes the overwrite
mode, the OverwriteModeChanged event is fired. This is set to false
by default.
Declaration
bool IsOverwriteModeEnabled { get; }
Property Value
Type | Description |
---|---|
bool |
IsReadOnly
When true the content of the editor cannot be changed by user editing operations.
Declaration
bool IsReadOnly { get; set; }
Property Value
Type | Description |
---|---|
bool |
Rows
All rows that can be displayed in the edit control.
Declaration
IList<IRowInfo> Rows { get; }
Property Value
Type | Description |
---|---|
IListIRowInfo |
Remarks
Only rows that return true
for IsVisible() will be displayed
in the edit control. You can use the VisibleRows iterator to directly access them.
SelectedBackColor
The background color used as a base color for selected rows.
Declaration
Color SelectedBackColor { get; }
Property Value
Type | Description |
---|---|
Color |
Remarks
The actual color for a selected row also depends on whether the row is shaded.
SelectedRows
The rows that are currently selected in the edit control.
Declaration
IEnumerable<IRowInfo> SelectedRows { get; }
Property Value
Type | Description |
---|---|
IEnumerableIRowInfo |
Remarks
The selected rows are typically highlighted in some fashion, usually with a different color to the ActiveRow.
Operations which are required to work over multiple rows or segments should use this enumerator to find all the rows that have been selected. Note that the selected rows may not be sequentially ordered.
Selection
Controls the currently selected content, or if nothing is selected, the current location of the text cursor in the edit control.
Declaration
IContentSelection Selection { get; }
Property Value
Type | Description |
---|---|
IContentSelection |
ShowWhitespaceCharacters
When true
whitespace characters such as space, tab, non-breaking space
and different types of line breaks are visualized with special symbols in the editor.
Declaration
bool ShowWhitespaceCharacters { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
This setting is off by default.
SmartPasteAdjustingSpaces
When true
leading and trailing white spaces are inserted or removed at paste (like in MS Office).
Declaration
bool SmartPasteAdjustingSpaces { get; set; }
Property Value
Type | Description |
---|---|
bool |
TagPainter
The component used by the edit control to render placeholder tags, start/end tags and document and file boundary indicators.
Declaration
ITagPainter TagPainter { get; set; }
Property Value
Type | Description |
---|---|
ITagPainter |
Remarks
Setting this property causes the edit control to be re-formatted.
If this property is null
the control's built-in tag rendering
will be used. This will produce tags that look similar to tags in TagEditor.
TextMarks
All text marks in the control.
Declaration
IEnumerable<ITextMark> TextMarks { get; }
Property Value
Type | Description |
---|---|
IEnumerableITextMark |
Remarks
This is a read-only property.
Use AddTextMark(ContentRange, TextMarkLayer, ITextMarkPainter), RemoveTextMark(ITextMark), ClearTextMarks(), or NotifyTextMarkChanged(ITextMark) to change the text marks used in the control.
TopmostVisibleRowNumber
Row number for the current topmost visible row in the control window.
Declaration
long TopmostVisibleRowNumber { get; }
Property Value
Type | Description |
---|---|
long |
Remarks
This, together with the TopmostVisibleRowScrollOffset can be treated as a persistent scroll offset that is preserved when the window is resized or the layout is re-calculated due to some other reason.
You can explicitly scroll to a specific row number and offset by calling ScrollToRow(long, long) passing in values from these properties.
The event PersistentScrollInfoChanged is fired when this value changes.
TopmostVisibleRowScrollOffset
Part of the topmost visible row in the control window that appears above the visible area of the control.
Declaration
long TopmostVisibleRowScrollOffset { get; }
Property Value
Type | Description |
---|---|
long |
Remarks
This, together with the TopmostVisibleRowNumber can be treated as a persistent scroll offset that is preserved when the window is resized or the layout is re-calculated due to some other reason.
You can explicitly scroll to a specific row number and offset by calling ScrollToRow(long, long) passing in values from these properties.
The event PersistentScrollInfoChanged is fired when this value changes.
VerticalScrollOffset
The amount in pixels that the content currently showing in the edit control has been scrolled vertically.
Declaration
long VerticalScrollOffset { get; set; }
Property Value
Type | Description |
---|---|
long |
Remarks
A value of 0 means that the top of the edit control shows the top of the document content.
Setting this value scrolls the view vertically to the specified offset. The value set should not be greater than ContentHeight, or no content will be visible in the control.
This value can be used together with ContentHeight to determine the position of a scrollbar.
Note that the scroll offset position can change during background layout, if rows above the currently visible area are being re-formatted.
The TopmostVisibleRowNumber and TopmostVisibleRowScrollOffset properties returns scroll position information that does not change when the layout changes.
VisibleRows
All rows that are visible to the user (displayed on screen). This is tested using IsVisible(). Note: This property will only return the rows that are actually currently visible to the user.
Declaration
IEnumerable<IRowInfo> VisibleRows { get; }
Property Value
Type | Description |
---|---|
IEnumerableIRowInfo |
Methods
AddColumn(ICustomColumn, CustomColumnLocation)
Add a custom column to the left or right side of the edit control.
Declaration
void AddColumn(ICustomColumn column, CustomColumnLocation location)
Parameters
Type | Name | Description |
---|---|---|
ICustomColumn | column | The column implementation |
CustomColumnLocation | location | Side on which to add the column. |
Remarks
The column will be queried for its optimal width, and if that can be accommodated it will be used. If not an arbitrary width may be assigned to the column depending on the available space in the edit control.
If there are already custom columns on the same side in the edit control this column will be added as the outer-most column.
It is recommended to add all custom columns to the edit control before assigning the document, since adding a custom column requires the entire control to be re-formatted.
AddTextMark(ContentRange, TextMarkLayer, ITextMarkPainter)
Add a new mark for a content range in the edit control. The control is updated to show the mark.
Declaration
ITextMark AddTextMark(ContentRange range, TextMarkLayer layer, ITextMarkPainter painter)
Parameters
Type | Name | Description |
---|---|---|
ContentRange | range | The content range the mark spans. |
TextMarkLayer | layer | Indicates if it is a foreground or background mark. |
ITextMarkPainter | painter | Component that will be used to paint the mark. |
Returns
Type | Description |
---|---|
ITextMark | A reference to the added text mark. If you need to change properties for a mark you should explicitly call NotifyTextMarkChanged(ITextMark) to ensure that the updated mark properties are reflected in the control. |
Remarks
The mark will be attached to the positions in the range, i.e. to a specific node, and if applicable the offset for a specified number of characters into that node. If the content in the control is being modified the mark may no longer be in the correct location, or even refer to a valid location at all.
For this reason it is generally advisable to attach marks to content nodes that are embedded inside the text, e.g. location markers. That way the mark will continue to refer to the correct location even if content before or inside the marked area is modified.
The control is automatically updated to show the mark. If you are adding a lot
of marks you may want to set the AutoUpdate property to false
while the marks are being added in order to avoid updating the control for each mark.
AutoScrollToRowPosition(IRowInfo, IRowInfo)
Scrolls the rowToScroll to the position on screen that rowAtPosition currently is located at. Note: This will only scroll if rowAtPosition is past a certain threshold at the top or bottom of the document.
Declaration
void AutoScrollToRowPosition(IRowInfo rowAtPosition, IRowInfo rowToScroll)
Parameters
Type | Name | Description |
---|---|---|
IRowInfo | rowAtPosition | The row at the position we want to scroll to. |
IRowInfo | rowToScroll | The row that we want to scroll. |
BeginSelectedRowOperation()
Disables active row and row selection changes while an edit operation is completing. This method should be called before performing operations that need to operate over selected rows. After the operation has been completed, EndSelectedRowOperation() must be called to return the edit control to normal operation.
Declaration
void BeginSelectedRowOperation()
CanCopySelectionToClipboard()
Determines whether the selection can be copied to the clipboard.
Declaration
bool CanCopySelectionToClipboard()
Returns
Type | Description |
---|---|
bool | whether selection can be copied to clipboard |
CanCutSelectionToClipboard()
Determines whether the selection can be cut and copied to the clipboard.
Declaration
bool CanCutSelectionToClipboard()
Returns
Type | Description |
---|---|
bool | whether selection can be cut and copied to clipboard |
CanPasteClipboardToDocument()
Determines whether the clipboard contents can be pasted to the document.
Declaration
bool CanPasteClipboardToDocument()
Returns
Type | Description |
---|---|
bool | whether clipboard contents can be pasted to document |
ChangeFocusedRowSelection()
Inverts the selection of the currently focused row. If the currently focused row is selected then it will call SelectRow(IRowInfo), otherwise it will call ClearRowSelection(IRowInfo).
Declaration
void ChangeFocusedRowSelection()
Remarks
If there is currently no row in focus then start position is the row containing the cursor.
ChangeNextRowSelection()
Selects or unselects the next row in the edit control according to whether the focused row is selected or not. This method also updates the focused row accordingly.
Declaration
void ChangeNextRowSelection()
ChangePreviousRowSelection()
Selects or unselects the previous row in the edit control according to whether the focused row is selected or not. This method also updates the focused row accordingly.
Declaration
void ChangePreviousRowSelection()
ClearAllRowSelections()
Removes the selection for all the rows in the edit control.
Declaration
void ClearAllRowSelections()
ClearRowSelection(IRowInfo)
Removes the selection for a specific row in the edit control.
Declaration
void ClearRowSelection(IRowInfo row)
Parameters
Type | Name | Description |
---|---|---|
IRowInfo | row | The row to remove from the list of selected rows. |
ClearTextMarks()
Remove all text marks from the edit control.
Declaration
void ClearTextMarks()
CopySelection()
Copy the currently selected content into a standalone, changeable document fragment.
Declaration
IDocumentFragment CopySelection()
Returns
Type | Description |
---|---|
IDocumentFragment | A cloned changeable copy of the selected content in the editor. |
Remarks
If the selection is empty then this method returns a new empty document fragment.
If the currently selected content cannot be cloned into a standalone document fragment this function throws an EditException.
The normal way to modify the content of the editor through the API is to move the selection, call this method to get a document fragment that can be changed and then pass the changed document fragment to ReplaceSelection(IDocumentFragment).
See Also
CopySelectionToClipboard()
Copies the selection content to the clipboard.
Declaration
void CopySelectionToClipboard()
Remarks
May throw Sdl.DesktopEditor.EditorApi.EditExeption
if the selection cannot be copied (e.g. if it contains
non-framework nodes or non-cloneable nodes such as Paragraph Units or Files).
CreateTextIterator(Position)
Create an iterator that can be used to locate content without having to use the Selection.
Declaration
ITextIterator CreateTextIterator(Position startPosition)
Parameters
Type | Name | Description |
---|---|---|
Position | startPosition | The position to start the iteration. |
Returns
Type | Description |
---|---|
ITextIterator | A text iterator that can be used to locate document content. |
Remarks
When searching for content it is often not practical to use move the Selection in order to iterate over document content. The text iterator provides a better option, as it does not affect the current selection in the user interface, and is therefore also much faster.
CutSelectionToClipboard()
Cuts and copies the selection to the clipboard.
Declaration
void CutSelectionToClipboard()
DeleteSelection()
Delete the currently selected content in the edit control.
Declaration
void DeleteSelection()
Remarks
Throws an EditException if the selected content cannot be deleted.
EndSelectedRowOperation()
Restores normal row activation and selection changing after an edit operation has completed. This method should always be called after BeginSelectedRowOperation().
Declaration
void EndSelectedRowOperation()
FindRow(Position)
Finds the matching row for the provided position.
Declaration
IRowInfo FindRow(Position position)
Parameters
Type | Name | Description |
---|---|---|
Position | position | The position to locate the row at. |
Returns
Type | Description |
---|---|
IRowInfo | The row found at that position, |
FocusNextRow()
Moves the row focus on to the next row.
Declaration
void FocusNextRow()
Remarks
If there is currently no row in focus then start position is the row containing the cursor.
FocusPreviousRow()
Moves the row focus on to the previous row.
Declaration
void FocusPreviousRow()
Remarks
If there is currently no row in focus then start position is the row containing the cursor.
GetNearestLocation(Position)
Returns the location of the specified position in the edit control window, in client coordinates.
Declaration
Rectangle GetNearestLocation(Position position)
Parameters
Type | Name | Description |
---|---|---|
Position | position | The position to locate. |
Returns
Type | Description |
---|---|
Rectangle | A rectangle where the top left corner is the location in the control closest to the specified position, in client coordinates. The Width of the rectangle is 0 and the Height corresponds to the height of the line. |
Remarks
You can use this to determine where on the screen a position appears, e.g. in order to show a pop-up window in the correct location.
The rectangle is in client coordinates, i.e. relative to the hosting control. The rectangle will always have a Width of 0 and its Height will be the height of the line.
Note that a position can sometimes be mapped to multiple locations in the control. This can happen, for example, if a text string is word wrapped and the location refers to a character just where the line is wrapped. Both the location at the end of the line and at the start of the second line could then map to the same Position. In such cases the location returned will be the first location from the top of the document that the position can be mapped to.
It can also happen that the exact position is currently not shown in the edit control (e.g. if content is folded). In that case the "nearest" location is determined to be the location of the first available preceding Position (i.e. closest to the top of the document).
GetNearestPosition(Point)
Returns the position corresponding to a client coordinate location in the control.
Declaration
Position GetNearestPosition(Point location)
Parameters
Type | Name | Description |
---|---|---|
Point | location | A point relative to the top left corner of the control (i.e. in client coordinates.) |
Returns
Type | Description |
---|---|
Position | The "nearest" selection position to the specified point. |
Remarks
You can use this to do "hit-testing" to determine which content appears at a specific location, e.g. to determine which commands to show on a context menu.
This will return the Position corresponding to where the selection would be if the user clicked the mouse at the specified location inside the edit control.
GetNearestVisiblePosition(Position)
Returns a position that is adjusted to the nearest corresponding visible position if the passed-in position refers to content that currently cannot be displayed in the control, e.g. if it appears in folded rows or in a row that would otherwise be hidden.
Declaration
Position GetNearestVisiblePosition(Position position)
Parameters
Type | Name | Description |
---|---|---|
Position | position | A position that may be hidden. |
Returns
Type | Description |
---|---|
Position | A position that can safely be used in MoveTo(Position, bool) and similar operations. |
Remarks
Note that a position can sometimes be mapped to multiple locations in the control. This can happen, for example, if a text string is word wrapped and the location refers to a character just where the line is wrapped. Both the location at the end of the line and at the start of the second line could then map to the same Position. In such cases the location returned will be the first location from the top of the document that the position can be mapped to.
When the exact position is currently not shown in the edit control (e.g. if content is folded) the "nearest" location is determined to be the location of the first available preceding Position (i.e. closest to the top of the document).
GetVisibleRowsInRange(ContentRange)
Returns all the visible rows that the range spans starting from the first row.
Declaration
IEnumerable<IRowInfo> GetVisibleRowsInRange(ContentRange range)
Parameters
Type | Name | Description |
---|---|---|
ContentRange | range | The range to restrict the search to. |
Returns
Type | Description |
---|---|
IEnumerableIRowInfo | The rows located within the range provided. |
HasSelectedRows()
Test to discover whether rows have been selected in the edit control.
Declaration
bool HasSelectedRows()
Returns
Type | Description |
---|---|
bool |
|
IsRowVisible(int)
Checks whether the row matching the provided row number will be visible in the editor, that is, whether the user will actually see this row on screen. This takes into account whether the row has been manually hidden using folding, whether it has any content and whether that content is valid to display.
Declaration
bool IsRowVisible(int rowNumber)
Parameters
Type | Name | Description |
---|---|---|
int | rowNumber | The row number of the row to check. |
Returns
Type | Description |
---|---|
bool |
if the row will be displayed on screen. |
IsWordStart(Position)
Test to discover whether the position is at the start of a word.
Declaration
bool IsWordStart(Position position)
Parameters
Type | Name | Description |
---|---|---|
Position | position | The position to test. |
Returns
Type | Description |
---|---|
bool |
|
NotifyTextMarkChanged(ITextMark)
Call this method to notify the control that properties of a mark has changed. This will cause the control to be refreshed in order to show the updated properties.
Declaration
void NotifyTextMarkChanged(ITextMark mark)
Parameters
Type | Name | Description |
---|---|---|
ITextMark | mark | The properties representing the mark that has changed. |
PasteClipboardToDocument()
Pastes the clipboard contents to the document.
Declaration
void PasteClipboardToDocument()
Redo()
Redo the last undo operation and move the selection to the corresponding location.
Declaration
bool Redo()
Returns
Type | Description |
---|---|
bool |
|
RedoMultiple(long)
Redo a number of operations in one go. The selection will be moved to the location of the last of the redo operations.
Declaration
bool RedoMultiple(long count)
Parameters
Type | Name | Description |
---|---|---|
long | count | If this value is higher than the number of available redo operations, all of them are performed. |
Returns
Type | Description |
---|---|
bool |
|
Redraw()
Force a re-layout, re-draw and refresh of the content of the control. This is quite an expensive command - a less expensive alternative is to use Refresh() if the layout has not been changed.
Declaration
void Redraw()
Remarks
Call this method to update the control if the document content has changed as the result of external API operations, e.g. after loading a document from a file.
Refresh()
Refreshes the content of the control without re-drawing the layout etc.
Declaration
void Refresh()
Remarks
This is a less expensive command than Redraw() and should be used if the content of a cell has changed but the layout has not.
RemoveColumn(ICustomColumn)
Remove a custom column from the edit control.
Declaration
void RemoveColumn(ICustomColumn column)
Parameters
Type | Name | Description |
---|---|---|
ICustomColumn | column | The column to be removed. |
RemoveTextMark(ITextMark)
Remove the specified text mark from the control.
Declaration
void RemoveTextMark(ITextMark mark)
Parameters
Type | Name | Description |
---|---|---|
ITextMark | mark | The mark to be removed. If the mark is not part of this control this call has no effect. |
ReplaceSelection(IDocumentFragment)
Replace any currently selected content with the content of a document fragment.
Declaration
void ReplaceSelection(IDocumentFragment newContent)
Parameters
Type | Name | Description |
---|---|---|
IDocumentFragment | newContent | The new document content to be inserted. If this is |
Remarks
If the current selection cannot be replaced with the document content an EditException is thown.
See Also
ScrollIntoView(IRowInfo)
If possible, ensures that the view is scrolled as needed in order that the specified row is visible.
Declaration
void ScrollIntoView(IRowInfo row)
Parameters
Type | Name | Description |
---|---|---|
IRowInfo | row | The row to scroll into view. |
Remarks
If the row is already visible no action is taken.
ScrollIntoView(Position)
If possible ensures that the view is scrolled as needed in order for the specified position to be visible.
Declaration
void ScrollIntoView(Position position)
Parameters
Type | Name | Description |
---|---|---|
Position | position | The position to scroll into view. |
Remarks
If the the position is already visible no action is taken.
ScrollToCenter(IRowInfo)
If possible, scrolls the specified row in to the center of the screen.
Declaration
void ScrollToCenter(IRowInfo row)
Parameters
Type | Name | Description |
---|---|---|
IRowInfo | row | The row to scroll into the center of the screen. |
ScrollToRow(long, long)
Scroll the control so that the specified vertical offset of the specified row number appears at the very top of the control window.
Declaration
void ScrollToRow(long topRowNumber, long offset)
Parameters
Type | Name | Description |
---|---|---|
long | topRowNumber | The row to scroll to the top of the control window. |
long | offset | The offset within the row to scroll to the top of the control window. |
SelectRow(IRowInfo)
Selects the row in the edit control. This will typically be highlighted in some way and used for multiple row or segment operations.
Declaration
void SelectRow(IRowInfo row)
Parameters
Type | Name | Description |
---|---|---|
IRowInfo | row | The row to select. |
SelectRow(IRowInfo, bool, bool)
Selects the row in the edit control. This will typically be highlighted in some way and used for multiple row or segment operations.
Declaration
void SelectRow(IRowInfo row, bool isRangeOperation, bool isLastInRange)
Parameters
Type | Name | Description |
---|---|---|
IRowInfo | row | The row to select. |
bool | isRangeOperation |
|
bool | isLastInRange |
|
SelectRowRange(IRowInfo, IRowInfo)
Selects all the rows in the range defined by the fromRow and uptoRow inclusive. The fromRow does not have to be before the uptoRow, this will be taken in to account. Rows in this range will be marked as selected regardless of their previous selection state.
Declaration
void SelectRowRange(IRowInfo fromRow, IRowInfo uptoRow)
Parameters
Type | Name | Description |
---|---|---|
IRowInfo | fromRow | The start of the range to select |
IRowInfo | uptoRow | The end of the range to select |
SetRowsHighlighted(IList<int>, bool)
Sets the highlighted status of the rows in the list according to the highlight parameter.
Declaration
void SetRowsHighlighted(IList<int> rowNumbers, bool highlight)
Parameters
Type | Name | Description |
---|---|---|
IListint | rowNumbers | The rows to highlight. |
bool | highlight |
|
SetRowsVisibility(Predicate<IRowInfo>)
Sets the visibility of all the rows in the edit control according to the delegate.
Declaration
void SetRowsVisibility(Predicate<IRowInfo> rowDelegate)
Parameters
Type | Name | Description |
---|---|---|
PredicateIRowInfo | rowDelegate | The delegate that evaluates the row and determines whether or not it should be visible or hidden. |
Undo()
Undo the last operation that changed document content and move the selection to that location.
Declaration
bool Undo()
Returns
Type | Description |
---|---|
bool |
|
UndoMultiple(long)
Undo a number of operations in one go. The selection will be moved to the location of the last of the undo operations.
Declaration
bool UndoMultiple(long count)
Parameters
Type | Name | Description |
---|---|---|
long | count | If this value is higher than the number of available undo operations, all of them are performed. |
Returns
Type | Description |
---|---|
bool |
|
Events
ActiveRowChanged
Raised when the active row has changed in the edit control.
Declaration
event EventHandler<ActiveRowChangedEventArgs> ActiveRowChanged
Event Type
Type | Description |
---|---|
EventHandlerActiveRowChangedEventArgs |
AfterInitialUpdate
Raised when the visible area of the control has been fully laid out and painted for the first time. This event will also be raised if a different document is assigned to the control (after the initial update resulting from that).
Declaration
event EventHandler<AfterInitialUpdateEventArgs> AfterInitialUpdate
Event Type
Type | Description |
---|---|
EventHandlerAfterInitialUpdateEventArgs |
AllSelectedRowsCleared
Raised whenever all the selected rows have been removed from the SelectedRows enumerator using ClearAllRowSelections().
Declaration
event EventHandler<RowsChangedEventArgs> AllSelectedRowsCleared
Event Type
Type | Description |
---|---|
EventHandlerRowsChangedEventArgs |
BeginSelectedRowOperationChanged
Raised when the editor is beginning to perform a selected row operation.
Declaration
event EventHandler<EditControlEventArgs> BeginSelectedRowOperationChanged
Event Type
Type | Description |
---|---|
EventHandlerEditControlEventArgs |
ContentHeightChanged
Fired when the height of the content displayed in the edit control changes.
Declaration
event EventHandler<ContentHeightChangedEventArgs> ContentHeightChanged
Event Type
Type | Description |
---|---|
EventHandlerContentHeightChangedEventArgs |
EndSelectedRowOperationChanged
Raised when the editor is finished performing a selected row operation.
Declaration
event EventHandler<EditControlEventArgs> EndSelectedRowOperationChanged
Event Type
Type | Description |
---|---|
EventHandlerEditControlEventArgs |
HighlightedRowChanged
Raised whenever a single row has been highlighted or the original background color has been restored.
Declaration
event EventHandler<RowChangedEventArgs> HighlightedRowChanged
Event Type
Type | Description |
---|---|
EventHandlerRowChangedEventArgs |
HighlightedRowsChanged
Raised when the set of highlighted rows in the edit control has changed as a result of SetRowsHighlighted(IList<int>, bool) being called. To catch individual row changes, use HighlightedRowChanged.
Declaration
event EventHandler<RowsChangedEventArgs> HighlightedRowsChanged
Event Type
Type | Description |
---|---|
EventHandlerRowsChangedEventArgs |
IMECompositionChanged
Raised when the IME composition is changed
Declaration
event EventHandler<EventArgs> IMECompositionChanged
Event Type
Type | Description |
---|---|
EventHandlerEventArgs |
IMEEndComposition
Raised when the IME composition is complete or cancelled
Declaration
event EventHandler<EventArgs> IMEEndComposition
Event Type
Type | Description |
---|---|
EventHandlerEventArgs |
IMEStartComposition
Raised when the IME composition is started
Declaration
event EventHandler<EventArgs> IMEStartComposition
Event Type
Type | Description |
---|---|
EventHandlerEventArgs |
MouseEnteringNode
Fired when the mouse is moved to an area that is covered by the visual representation of a content node in the document.
Declaration
event EventHandler<MouseEnteringNodeEventArgs> MouseEnteringNode
Event Type
Type | Description |
---|---|
EventHandlerMouseEnteringNodeEventArgs |
Remarks
A corresponding event MouseLeavingNode will be fired when the mouse pointer is moved outside of the area.
These events can be used when showing tooltips or implementing "hot" highlighting of nodes in the edit control.
MouseEnteringTextMarks
Fired when the mouse is moved into the area that is covered by the visual representation of a text mark or multiple text marks in the document.
Declaration
event EventHandler<MouseOverTextMarksChangedEventArgs> MouseEnteringTextMarks
Event Type
Type | Description |
---|---|
EventHandlerMouseOverTextMarksChangedEventArgs |
MouseLeavingNode
Fired when the mouse is moved out of the area that is covered by the visual representation of a content node in the document.
Declaration
event EventHandler<MouseLeavingNodeEventArgs> MouseLeavingNode
Event Type
Type | Description |
---|---|
EventHandlerMouseLeavingNodeEventArgs |
Remarks
A corresponding event MouseEnteringNode was fired when the mouse pointer was moved inside of the area.
These events can be used when showing tooltips or implementing "hot" highlighting of nodes in the edit control.
MouseLeavingTextMarks
Fired when the mouse is moved out of the area that is covered by the visual representation of a text mark or multiple text marks in the document.
Declaration
event EventHandler<MouseOverTextMarksChangedEventArgs> MouseLeavingTextMarks
Event Type
Type | Description |
---|---|
EventHandlerMouseOverTextMarksChangedEventArgs |
OverwriteModeChanged
This event is fired whenever the editor changes between "overwrite" and "insert" mode and should be used to notify the user of the current state as defined by IsOverwriteModeEnabled.
Declaration
event EventHandler<OverwriteModeChangedEventArgs> OverwriteModeChanged
Event Type
Type | Description |
---|---|
EventHandlerOverwriteModeChangedEventArgs |
PersistentScrollInfoChanged
Raised after the TopmostVisibleRowNumber and/or the TopmostVisibleRowScrollOffset values have changed.
Declaration
event EventHandler<PersistentScrollInfoChangedEventArgs> PersistentScrollInfoChanged
Event Type
Type | Description |
---|---|
EventHandlerPersistentScrollInfoChangedEventArgs |
RowBackColorChanged
Raised whenever the FundamentalBackColor or HighlightBackColor of a single row has been changed. This is not raised when a row's Highlighted property is changed.
Declaration
event EventHandler<RowChangedEventArgs> RowBackColorChanged
Event Type
Type | Description |
---|---|
EventHandlerRowChangedEventArgs |
RowStructureChanged
Raised when the row structure has changed. This can happen when segments are merged or split, or when a new document is assigned. All previous rows will no longer be valid at this time.
Declaration
event EventHandler<RowsChangedEventArgs> RowStructureChanged
Event Type
Type | Description |
---|---|
EventHandlerRowsChangedEventArgs |
SelectedRowChanged
Raised whenever a row has been added to or removed from the SelectedRows enumerator using SelectRow(IRowInfo) or ClearRowSelection(IRowInfo).
Declaration
event EventHandler<RowChangedEventArgs> SelectedRowChanged
Event Type
Type | Description |
---|---|
EventHandlerRowChangedEventArgs |
SelectionChanged
Fired when selection changes, either because of user actions or through the API.
Declaration
event EventHandler<SelectionChangedEventArgs> SelectionChanged
Event Type
Type | Description |
---|---|
EventHandlerSelectionChangedEventArgs |
SelectionWasDeleted
This event is raised for TQA mode when a selection is deleted in order to pop up the properties dialog
Declaration
event EventHandler<EventArgs> SelectionWasDeleted
Event Type
Type | Description |
---|---|
EventHandlerEventArgs |
SourceEditingModeEnded
This event is fired when the source editing mode is ended
Declaration
event EventHandler<SourceEditingModeEndedEventArgs> SourceEditingModeEnded
Event Type
Type | Description |
---|---|
EventHandlerSourceEditingModeEndedEventArgs |
VScroll
Our scroll event that needs to be handled when synchronized scrolling is enabled
Declaration
event EventHandler<VScrollEventArgs> VScroll
Event Type
Type | Description |
---|---|
EventHandlerVScrollEventArgs |