From 9fc19ef8e2dcd8bcf6a1d034b95c1de2b88e485c Mon Sep 17 00:00:00 2001 From: Siep Kroonenberg Date: Thu, 17 Feb 2011 15:05:13 +0000 Subject: New tlperl part II git-svn-id: svn://tug.org/texlive/trunk@21424 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/tlperl/lib/Tk/TextList.pm | 982 +++++++++++++++++++++++++++++++++ 1 file changed, 982 insertions(+) create mode 100644 Master/tlpkg/tlperl/lib/Tk/TextList.pm (limited to 'Master/tlpkg/tlperl/lib/Tk/TextList.pm') diff --git a/Master/tlpkg/tlperl/lib/Tk/TextList.pm b/Master/tlpkg/tlperl/lib/Tk/TextList.pm new file mode 100644 index 00000000000..40c4c6ee7eb --- /dev/null +++ b/Master/tlpkg/tlperl/lib/Tk/TextList.pm @@ -0,0 +1,982 @@ +# Copyright (c) 1999 Greg London. All rights reserved. +# This program is free software; you can redistribute it and/or +# modify it under the same terms as Perl itself. + +# code for bindings taken from Listbox.pm + +# comments specifying method functionality taken from +# "Perl/Tk Pocket Reference" by Stephen Lidie. + +####################################################################### +# this module uses a text module as its base class to create a list box. +# this will allow list box functionality to also have all the functionality +# of the Text widget. +# +# note that most methods use an element number to indicate which +# element in the list to work on. +# the exception to this is the tag and mark methods which +# are dual natured. These methods may accept either the +# normal element number, or they will also take a element.char index, +# which would be useful for applying tags to part of a line in the list. +# +####################################################################### + +package Tk::TextList; + +use strict; +use vars qw($VERSION); +$VERSION = '4.006'; # $Id: //depot/Tkutf8/TextList/TextList.pm#5 $ + +use base qw(Tk::Derived Tk::ReindexedROText ); + +use Tk qw (Ev); + +Construct Tk::Widget 'TextList'; + +####################################################################### +# the following line causes Populate to get called +# @ISA = qw(Tk::Derived ... ); +####################################################################### +sub Populate +{ + my ($w,$args)=@_; + my $option=delete $args->{'-selectmode'}; + $w->SUPER::Populate($args); + $w->ConfigSpecs( -selectmode => ['PASSIVE','selectMode','SelectMode','browse'], + -takefocus => ['PASSIVE','takeFocus','TakeFocus',1], + -spacing3 => ['SELF', undef, undef, 3], + -insertwidth => ['SELF', undef, undef, 0], + ); + +} + +####################################################################### +####################################################################### +sub ClassInit +{ + my ($class,$mw) = @_; + + # Standard Motif bindings: + $mw->bind($class,'<1>',['BeginSelect',Ev('index',Ev('@'))]); + $mw->bind($class,'',['Motion',Ev('index',Ev('@'))]); + $mw->bind($class,'','ButtonRelease_1'); + + $mw->bind($class,'',['BeginExtend',Ev('index',Ev('@'))]); + $mw->bind($class,'',['BeginToggle',Ev('index',Ev('@'))]); + + $mw->bind($class,'',['AutoScan',Ev('x'),Ev('y')]); + $mw->bind($class,'','CancelRepeat'); + $mw->bind($class,'',['UpDown',-1]); + $mw->bind($class,'',['ExtendUpDown',-1]); + $mw->bind($class,'',['UpDown',1]); + $mw->bind($class,'',['ExtendUpDown',1]); + + $mw->XscrollBind($class); + $mw->PriorNextBind($class); + + $mw->bind($class,'','Cntrl_Home'); + + $mw->bind($class,'',['DataExtend',0]); + $mw->bind($class,'','Cntrl_End'); + + $mw->bind($class,'',['DataExtend','end']); + $class->clipboardOperations($mw,'Copy'); + $mw->bind($class,'',['BeginSelect',Ev('index','active')]); + $mw->bind($class,'