Ellié Computing Home Page
My Shopping Cart

Your shopping cart is empty

Display Cart

Call us at +1 586 62 ELLIE / +1 586 62 35543 Office Closed
sales@elliecomputing.com - Contact us


BinaryDocument.View object

 

 

Prototype for BinaryDocument.View objects. Is a kind of View object.

Syntax

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;

Parameters

none.

Property Of

none.

Implemented In

ECMerge 2.4

Description

BinaryDocument.View objects let you navigate by byte position, obtain the selection or set it.

Properties

none specific.

Methods

clone_selection
navigate
set_selection

Examples

Example 1.

Set the selection on current view to the whole content.

current_frame.coordinator.current_view.set_selection (new BinaryDocument.Selection (current_frame.coordinator.document.content.left);

See Also 

  View object, DocumentFrame  object

 

Method clone_selection

Syntax

function clone_selection ( )
returns a BinaryDocument.Selection object.

Parameters

none.

Method Of

BinaryDocument.View object

Implemented In

ECMerge 2.4

Description

Returns a new selection object which contains the same bytes as those selected in the view.

Examples

Example 1.

Retrieves the selection of the current view:

current_frame.coordinator.current_view.clone_selection();

See Also 

  BinaryDocument.View object, BinaryDocument.Selection object

Method navigate

Syntax

function navigate (position)

Parameters

position. Integer. Byte position in the given view

Method Of

BinaryDocument.View object

Implemented In

ECMerge 2.4

Description

Set the cursor position to the given position, and ensures that it is visible in the view.

Examples

Example 1.

Navigate to the start of 100 th byte of the file:

var current_doc = current_frame.coordinator.document;
current_frame.coordinator.current_view.navigate (100);

See Also 

  BinaryDocument.View object

Method set_selection

Syntax

function set_selection (selection)

Parameters

selection. BinaryDocument.Selection object. Selection to set on the view

Method Of

BinaryDocument.View object

Implemented In

ECMerge 2.4

Description

Selects in the view exactly the same characters as those included in selection.

Examples

Example 1.

Builds a selection containing all the binary file, then set it on the view (actually selecting all bytes):

var current_doc = current_frame.coordinator.document;
var side = current_frame.coordinator.current_view.role;
var sel = new BinaryDocument.Selection (current_doc.content[side], LinearRange(0, current_doc.content[side].length));

current_frame.coordinator.current_view.set_selection (sel);

See Also 

  BinaryDocument.View object, BinaryDocument.Selection object