Prototype for TextDocument.View objects. Is a kind of View object.
You cannot create View object directly. Views are created as necessary when DocumentFrame objects are created for a document.
var my_doc;
var doc_frame = add_frame (my_doc);
var left_view = doc_frame.coordinator.views.left;
none.
none.
ECMerge 2.1
TextDocument.View objects let you navigate by character position, obtain the selection or set it.
none specific.
clone_selection
navigate
set_selection
Set the selection on current view to the whole content.
current_frame.coordinator.current_view.set_selection (new TextDocument.Selection (current_frame.coordinator.document.content.left);
View object, DocumentFrame object
function clone_selection ( )
returns a
TextDocument.Selection
object.
none.
TextDocument.View object
ECMerge 2.1
Returns a new selection object which contains the same characters as those selected in the view.
Retrieves the selection of the current view:
current_frame.coordinator.current_view.clone_selection();
TextDocument.View object, TextDocument.Selection object
function navigate (position)
position. Integer. Character position in the given view
TextDocument.View object
ECMerge 2.1
Set the cursor position to the given position, and ensures that it is visible in the view.
Navigate to the start of 10 th line:
var current_doc = current_frame.coordinator.document;
current_doc.root.children.fill ();
current_frame.coordinator.current_view.navigate (
current_doc.content[current_frame.coordinator.current_view.role].position_from_line
(10) );
TextDocument.View object
function set_selection (selection)
selection. TextDocument.Selection object. Selection to set on the view
TextDocument.View object
ECMerge 2.1
Selects in the view exactly the same characters as those included in selection.
Builds a selection containing all the text of the , then set it on the view (actually selecting all items):
var current_doc = current_frame.coordinator.document;
var side = current_frame.coordinator.current_view.role;
var sel = new TextDocument.Selection
(current_doc.content[side], LinearRange(0,
current_doc.content[side].length));
current_frame.coordinator.current_view.set_selection
(sel);
TextDocument.View object, TextDocument.Selection object