Detailed Description

The rather unusual text selection API.

Public Member Functions

void removeRange (Range r)
 Removes a range from the selection. More...
 
void selectAllChildren (Node node)
 Adds a range which selects all the kids of the given node. More...
 
void removeAllRanges ()
 Removes all ranges from the selection. More...
 
void addRange (Range r)
 Adds a range to the selection. More...
 
Range getRangeAt (int index)
 A range object representing one of the ranges currently selected. More...
 
override string ToString ()
 The currently selected text. More...
 
void collapseToStart ()
 Collapses the selection to the start of the range. More...
 
void collapseToEnd ()
 Collapses the selection to the end of the range. More...
 
void collapse (bool toStart)
 Collapses the selection to the start or end of the range. More...
 
void deleteFromDocument ()
 Deletes the selection's content from the document. More...
 
bool containsNode (Node n)
 Indicates if a certain node is part of the selection. More...
 

Public Attributes

List< RangeRanges =new List<Range>()
 <suummary>All ranges (oddly, it's required to be exactly 1, but addRange exists) More...
 

Package Functions

void UpdateSelection (bool select, Range r)
 Selects/ Deselects a whole range. More...
 

Properties

Node focusNode [get]
 Returns the Node in which the selection ends. More...
 
int rangeCount [get]
 Returns the number of ranges in the selection More...
 
Node anchorNode [get]
 Returns the Node in which the selection starts. More...
 
int anchorOffset [get]
 Returns a number representing the offset of the selection's anchor within the anchorNode. If anchorNode is a text node, this is the number of characters within anchorNode preceding the anchor. If anchorNode is an element, this is the number of child nodes of the anchorNode preceding the anchor. More...
 
int focusOffset [get]
 Returns a number representing the offset of the selection's anchor within the focusNode. If focusNode is a text node, this is the number of characters within focusNode preceding the focus. If focusNode is an element, this is the number of child nodes of the focusNode preceding the focus. More...
 
bool isCollapsed [get]
 Returns a Boolean indicating whether the selection's start and end points are at the same position. More...
 

Member Function Documentation

void PowerUI.Selection.addRange ( Range  r)
inline

Adds a range to the selection.

void PowerUI.Selection.collapse ( bool  toStart)
inline

Collapses the selection to the start or end of the range.

void PowerUI.Selection.collapseToEnd ( )
inline

Collapses the selection to the end of the range.

void PowerUI.Selection.collapseToStart ( )
inline

Collapses the selection to the start of the range.

bool PowerUI.Selection.containsNode ( Node  n)
inline

Indicates if a certain node is part of the selection.

void PowerUI.Selection.deleteFromDocument ( )
inline

Deletes the selection's content from the document.

Range PowerUI.Selection.getRangeAt ( int  index)
inline

A range object representing one of the ranges currently selected.

void PowerUI.Selection.removeAllRanges ( )
inline

Removes all ranges from the selection.

void PowerUI.Selection.removeRange ( Range  r)
inline

Removes a range from the selection.

void PowerUI.Selection.selectAllChildren ( Node  node)
inline

Adds a range which selects all the kids of the given node.

override string PowerUI.Selection.ToString ( )
inline

The currently selected text.

void PowerUI.Selection.UpdateSelection ( bool  select,
Range  r 
)
inlinepackage

Selects/ Deselects a whole range.

Member Data Documentation

List<Range> PowerUI.Selection.Ranges =new List<Range>()

<suummary>All ranges (oddly, it's required to be exactly 1, but addRange exists)

Property Documentation

Node PowerUI.Selection.anchorNode
get

Returns the Node in which the selection starts.

int PowerUI.Selection.anchorOffset
get

Returns a number representing the offset of the selection's anchor within the anchorNode. If anchorNode is a text node, this is the number of characters within anchorNode preceding the anchor. If anchorNode is an element, this is the number of child nodes of the anchorNode preceding the anchor.

Node PowerUI.Selection.focusNode
get

Returns the Node in which the selection ends.

int PowerUI.Selection.focusOffset
get

Returns a number representing the offset of the selection's anchor within the focusNode. If focusNode is a text node, this is the number of characters within focusNode preceding the focus. If focusNode is an element, this is the number of child nodes of the focusNode preceding the focus.

bool PowerUI.Selection.isCollapsed
get

Returns a Boolean indicating whether the selection's start and end points are at the same position.

int PowerUI.Selection.rangeCount
get

Returns the number of ranges in the selection