home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _d84111bf7ba0b521688e29e174b92b3e < prev    next >
Text File  |  2004-06-01  |  1KB  |  42 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 716 "..\blib\lib\Tk\Listbox.pm (autosplit into ..\blib\lib\auto\Tk\Listbox\UpDown.al)"
  7. # UpDown --
  8. #
  9. # Moves the location cursor (active element) up or down by one element,
  10. # and changes the selection if we're in browse or extended selection
  11. # mode.
  12. #
  13. # Arguments:
  14. # w - The listbox widget.
  15. # amount - +1 to move down one item, -1 to move back one item.
  16. sub UpDown
  17. {
  18.  my $w = shift;
  19.  my $amount = shift;
  20.  $w->activate($w->index('active')+$amount);
  21.  $w->see('active');
  22.  my $mode = $w->cget('-selectmode');
  23.  if ($mode eq 'browse')
  24.   {
  25.    $w->selectionClear(0,'end');
  26.    $w->selectionSet('active');
  27.    $w->eventGenerate("<<ListboxSelect>>");
  28.   }
  29.  elsif ($mode eq 'extended')
  30.   {
  31.    $w->selectionClear(0,'end');
  32.    $w->selectionSet('active');
  33.    $w->selectionAnchor('active');
  34.    $Prev = $w->index('active');
  35.    @Selection = ();
  36.    $w->eventGenerate("<<ListboxSelect>>");
  37.   }
  38. }
  39.  
  40. # end of Tk::Listbox::UpDown
  41. 1;
  42.