blob: 3974c2e145ce6e2cbc0095bbb8f386649f10e454 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# NOTE: Derived from ..\blib\lib\Tk\Listbox.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Tk::Listbox;
#line 754 "..\blib\lib\Tk\Listbox.pm (autosplit into ..\blib\lib\auto\Tk\Listbox\Cancel.al)"
# Cancel
#
# This procedure is invoked to cancel an extended selection in
# progress. If there is an extended selection in progress, it
# restores all of the items between the active one and the anchor
# to their previous selection state.
#
# Arguments:
# w - The listbox widget.
sub Cancel
{
my $w = shift;
if ($w->cget('-selectmode') ne 'extended' || !defined $Prev)
{
return;
}
$first = $w->index('anchor');
$last = $Prev;
if ($first > $last)
{
$tmp = $first;
$first = $last;
$last = $tmp
}
$w->selectionClear($first,$last);
while ($first <= $last)
{
if (Tk::lsearch(\@Selection,$first) >= 0)
{
$w->selectionSet($first)
}
$first += 1
}
}
# end of Tk::Listbox::Cancel
1;
|