home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _56ffdaeb06ca34c25c79f8f6bf2adeae < prev    next >
Encoding:
Text File  |  2004-06-01  |  1.3 KB  |  50 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 676 "..\blib\lib\Tk\Listbox.pm (autosplit into ..\blib\lib\auto\Tk\Listbox\AutoScan.al)"
  7. # AutoScan --
  8. # This procedure is invoked when the mouse leaves an entry window
  9. # with button 1 down. It scrolls the window up, down, left, or
  10. # right, depending on where the mouse left the window, and reschedules
  11. # itself as an "after" command so that the window continues to scroll until
  12. # the mouse moves back into the window or the mouse button is released.
  13. #
  14. # Arguments:
  15. # w - The entry window.
  16. # x - The x-coordinate of the mouse when it left the window.
  17. # y - The y-coordinate of the mouse when it left the window.
  18. sub AutoScan
  19. {
  20.  my $w = shift;
  21.  return if !Tk::Exists($w);
  22.  my $x = shift;
  23.  my $y = shift;
  24.  if ($y >= $w->height)
  25.   {
  26.    $w->yview('scroll',1,'units')
  27.   }
  28.  elsif ($y < 0)
  29.   {
  30.    $w->yview('scroll',-1,'units')
  31.   }
  32.  elsif ($x >= $w->width)
  33.   {
  34.    $w->xview('scroll',2,'units')
  35.   }
  36.  elsif ($x < 0)
  37.   {
  38.    $w->xview('scroll',-2,'units')
  39.   }
  40.  else
  41.   {
  42.    return;
  43.   }
  44.  $w->Motion($w->index("@" . $x . ',' . $y));
  45.  $w->RepeatId($w->after(50,'AutoScan',$w,$x,$y));
  46. }
  47.  
  48. # end of Tk::Listbox::AutoScan
  49. 1;
  50.