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

  1. # NOTE: Derived from ..\blib\lib\Tk\Scrollbar.pm.
  2. # Changes made here will be lost when autosplit is run again.
  3. # See AutoSplit.pm.
  4. package Tk::Scrollbar;
  5.  
  6. #line 262 "..\blib\lib\Tk\Scrollbar.pm (autosplit into ..\blib\lib\auto\Tk\Scrollbar\Drag.al)"
  7. # tkScrollDrag --
  8. # This procedure is called for each mouse motion even when the slider
  9. # is being dragged.  It notifies the associated widget if we're not
  10. # jump scrolling, and it just updates the scrollbar if we are jump
  11. # scrolling.
  12. #
  13. # Arguments:
  14. # w -        The scrollbar widget.
  15. # x, y -    The current mouse position.
  16.  
  17. sub Drag
  18. {
  19.  my($w,$x,$y) = @_;
  20.  return if !defined $initPos;
  21.  my $delta = $w->delta($x-$pressX, $y-$pressY);
  22.  if ($w->cget('-jump'))
  23.   {
  24.    if (@initValues == 2)
  25.     {
  26.      $w->set($initValues[0]+$delta, $initValues[1]+$delta);
  27.     }
  28.    else
  29.     {
  30.      $delta = sprintf "%d", $delta * $initValues[0]; # round()
  31.      $initValues[2] += $delta;
  32.      $initValues[3] += $delta;
  33.      $w->set(@initValues[2,3]);
  34.     }
  35.   }
  36.  else
  37.   {
  38.    $w->ScrlToPos($initPos+$delta);
  39.   }
  40. }
  41.  
  42. # end of Tk::Scrollbar::Drag
  43. 1;
  44.