Tk-TextHighlight

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

	Rewrote the rules editor, put it in a separate module.
	Numerous small changes and additions
	
22 April 2003
	Update to version 0.3.1
	Added slant option to rules editor.
	Corrected couple of mistakes in the documentation.

17 April 2003
	Update to version 0.3.0
	Modified clipboard handling.
	Added support for Pod and Xresources files
	Modified plugin protocol
	Modified highlighting algorithm
	Added '-updatecall' option.
	Fixed bug in rules editor.
	
03 March 2003
	Update to version 0.2.0.
	Updated documentation.
	Renamed a number of methods so they make sense.

README  view on Meta::CPAN

        key so that it's not passed down to the underlying *Text* widgets.
        This is so we can have consistant behavior regardless of which one
        us chosen/loaded.

    beginUndoBlock
        Used in application programs when wishing to group together a series
        of edits that, in the event of a call to Undo() should be undone
        together as a group. This method should be called before the first
        insertion or deletion. See also endUndoBlock.

    clipboardCopy
        Copies any selected text to the system's CLIPBOARD paste-buffer.

        Default bindings: Control-c.

    clipboardCut
        Default bindings: Control-x.

        Deletes the selected text from the widget and puts it in the
        system's CLIPBOARD paste-buffer.

    clipboardPaste
        Pastes the content of the system's CLIPBOARD paste-buffer at the
        current cursor position and selects it.

        Default bindings: Control-v.

    delete(*index1, ?index2?*)
        Delete a range of characters from the text. If both index1 and
        index2 are specified, then delete all the characters starting with
        the one given by index1 and stopping just before index2 (i.e. the
        character at index2 is not deleted). If index2 doesn't specify a

lib/Tk/TextHighlight.pm  view on Meta::CPAN

	$w->bind($class,	'<Control-P>', sub {} );          #ADDED SELECT BETWEEN BRACES (INCLUSIVE).
	$w->bind($class,	'<Key-Return>', sub {} )  unless ($TEXTWIDGET =~ /SuperText/);
	$w->bind($class,	'<Key-BackSpace>', 'Backspace' ); #MAKE CONSISTANT BETWEEN ALL SUPPORTED TEXT WIDGETS.
	$w->bind($class,	'<Key-space>', 'Space' );         #MAKE CONSISTANT BETWEEN ALL SUPPORTED TEXT WIDGETS.
	$w->bind($class,	'<Alt-Tab>', 'insertTabChar' );   #ADDED TO ALLOW INSERTION OF TABS!
	$w->bind($class,	'<Tab>', 'insertTab' );           #ADDED TO ALLOW INSERTION OF TABS OR SPACES!
	$w->bind($class,	'<ButtonRelease-2>', '');         #CHECK READONLY STATUS BEFORE PASTING SELECTION!
	return $class;
}

sub clipboardCopy {
	my $cw = shift;
	my @ranges = $cw->tagRanges('sel');
	if (@ranges) {
		$cw->SUPER::clipboardCopy(@_);
	}
}

sub beginUndoBlock
{
	my $cw = shift;

	if ($TEXTWIDGET =~ /SuperText/)   #GROUP CHANGES FOR UNDO (DIFFERENT FN NAMES USED).
	{
		$cw->_BeginUndoBlock;

lib/Tk/TextHighlight.pm  view on Meta::CPAN

	my $rostatus = $cw->{READONLY};
	$cw->{READONLY} = 0;
	$cw->delete('0.0','end');
	$cw->{READONLY} = $rostatus;
	$cw->ResetUndo;
	#WARNING, DOESN'T SEEM TO EXECUTE ANYTHING AFTER THE ResetUndo?!:
}

#FUNCTIONS NOT USED IN THE READ-ONLY VERSION:

sub clipboardCut {
	my $cw = shift;
	return  if ($cw->{READONLY});

	my @ranges = $cw->tagRanges('sel');
	$cw->SUPER::clipboardCut(@_)  if (@ranges);
}

sub clipboardPaste {
	my $cw = shift;
	return  if ($cw->{READONLY});

	my @ranges = $cw->tagRanges('sel');
	if (@ranges) {
		$cw->tagRemove('sel', '1.0', 'end');
		return;
	}
	$cw->SUPER::clipboardPaste(@_);
}

sub delete {
	my $cw = shift;
	return  if ($cw->{READONLY});

	my $begin = $_[0];
	$begin = (defined $begin) ? $cw->linenumber($begin)
			: $cw->linenumber('insert');
	my $end = $_[1];

lib/Tk/TextHighlight.pm  view on Meta::CPAN

it's not passed down to the underlying *Text* widgets.  This is so we can have 
consistant behavior regardless of which one us chosen/loaded.

=item B<beginUndoBlock>

Used in application programs when wishing to group together a series of edits 
that, in the event of a call to B<Undo()> should be undone together as a 
group.  This method should be called before the first insertion or deletion.  
See also B<endUndoBlock>.

=item B<clipboardCopy>

Copies any selected text to the system's CLIPBOARD paste-buffer.

Default bindings:  B<Control-c>.

=item B<clipboardCut>

Default bindings:  B<Control-x>.

Deletes the selected text from the widget and puts it in the system's 
CLIPBOARD paste-buffer.

=item B<clipboardPaste>

Pastes the content of the system's CLIPBOARD paste-buffer at the current 
cursor position and selects it.

Default bindings:  B<Control-v>.

=item B<delete(I<index1, ?index2?>)>

Delete a range of characters from the text. If both index1 and index2 are 
specified, then delete all the characters starting with the one given by 



( run in 1.711 second using v1.01-cache-2.11-cpan-84e82930d8c )