Text::Editor::Vip::Selection - Selection Range


Text-Editor-Vip documentation  | view source Contained in the Text-Editor-Vip distribution.

Index


NAME

Top

Text::Editor::Vip::Selection - Selection Range

SYNOPSIS

Top

  use Text::Editor::Vip::Selection
  $selection = new Text::Editor::Vip::Selection()

  $selection->IsEmpty() ;
  ...

DESCRIPTION

Top

This class handles the boundaries of a selection and provides helper sub to manipulate the selection.

MEMBER FUNCTIONS

Top

Setup

Setup a newly created object. This sub is private and shouldn't be used directely.

Clone

Returns a copy of the object.

IsEmpty

Returns 1 (one) if the selection boundaries are the same.

Retuns 0 (zero) if the object defined a non empty selection.

Set

Sets the selection boundaries. Four arguments are expected:

* A start line
* A start character
* An end line
* An end character

SetAnchor

Sets the selection anchor. Two arguments are expected:

* An anchor line
* An anchor character

GetAnchor

Returns the anchor position.

SetLine

This sub set the other boundary of a selection. The other booundary being set by SetAnchor.

Two arguments are expected:

* A line
* A character

GetLine

Returns the other boundarie of a selection.

GetBoundaries

Returns the boundaries of a selection as a list consisting of

* selection start line
* selection start character
* selection end line
* selection end character

the selection start line will always be lower or equal to the selection end line. The selection anchoring is handled automatically.

GetStartLine

Gets the selection start line.

GetStartCharacter

Gets the selection start character.

GetEndLine

Gets the selection end line.

GetEndCharacter

Gets the selection end character.

IsCharacterSelected

Given a line and character indexes, this sub returns 'true' if the given character is within the selection boundaries. It otherwise returns 'false'.

AUTHOR

Top

	Khemir Nadim ibn Hamouda
	CPAN ID: NKH
	mailto:nadim@khemir.net
	http:// no web site

COPYRIGHT

Top


Text-Editor-Vip documentation  | view source Contained in the Text-Editor-Vip distribution.