home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _6b2cfefdd38a6e5e3fb9372de4cf1358 < prev    next >
Encoding:
Text File  |  2004-06-01  |  970 b   |  37 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 748 "..\blib\lib\Tk\Listbox.pm (autosplit into ..\blib\lib\auto\Tk\Listbox\ExtendUpDown.al)"
  7. # ExtendUpDown --
  8. #
  9. # Does nothing unless we're in extended selection mode; in this
  10. # case it moves the location cursor (active element) up or down by
  11. # one element, and extends the selection to that point.
  12. #
  13. # Arguments:
  14. # w - The listbox widget.
  15. # amount - +1 to move down one item, -1 to move back one item.
  16. sub ExtendUpDown
  17. {
  18.  my $w = shift;
  19.  my $amount = shift;
  20.  if ($w->cget('-selectmode') ne 'extended')
  21.   {
  22.    return;
  23.   }
  24.  my $active = $w->index('active');
  25.  if (!@Selection)
  26.   {
  27.    $w->selectionSet($active);
  28.    @Selection = $w->curselection;
  29.   }
  30.  $w->activate($active + $amount);
  31.  $w->see('active');
  32.  $w->Motion($w->index('active'))
  33. }
  34.  
  35. # end of Tk::Listbox::ExtendUpDown
  36. 1;
  37.