diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/auto/Tk/Scrollbar/StartDrag.al')
-rwxr-xr-x | Master/tlpkg/tlperl/lib/auto/Tk/Scrollbar/StartDrag.al | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Master/tlpkg/tlperl/lib/auto/Tk/Scrollbar/StartDrag.al b/Master/tlpkg/tlperl/lib/auto/Tk/Scrollbar/StartDrag.al new file mode 100755 index 00000000000..32edbfdef24 --- /dev/null +++ b/Master/tlpkg/tlperl/lib/auto/Tk/Scrollbar/StartDrag.al @@ -0,0 +1,38 @@ +# NOTE: Derived from ..\blib\lib\Tk\Scrollbar.pm. +# Changes made here will be lost when autosplit is run again. +# See AutoSplit.pm. +package Tk::Scrollbar; + +#line 232 "..\blib\lib\Tk\Scrollbar.pm (autosplit into ..\blib\lib\auto\Tk\Scrollbar\StartDrag.al)" +# tkScrollStartDrag -- +# This procedure is called to initiate a drag of the slider. It just +# remembers the starting position of the slider. +# +# Arguments: +# w - The scrollbar widget. +# x, y - The mouse position at the start of the drag operation. + +sub StartDrag +{ + my($w,$x,$y) = @_; + return unless (defined ($w->cget('-command'))); + $pressX = $x; + $pressY = $y; + @initValues = $w->get; + my $iv0 = $initValues[0]; + if (@initValues == 2) + { + $initPos = $iv0; + } + elsif ($iv0 == 0) + { + $initPos = 0; + } + else + { + $initPos = $initValues[2]/$initValues[0]; + } +} + +# end of Tk::Scrollbar::StartDrag +1; |