home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _97f1f2951fe83425a9fb049bf7e09244 < prev    next >
Text File  |  2004-06-01  |  1KB  |  43 lines

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