blob: 40d6b0f8d1b4062ab36116feeced0561bf4fde36 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# 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 247 "..\blib\lib\Tk\Scrollbar.pm (autosplit into ..\blib\lib\auto\Tk\Scrollbar\Drag.al)"
# tkScrollDrag --
# This procedure is called for each mouse motion even when the slider
# is being dragged. It notifies the associated widget if we're not
# jump scrolling, and it just updates the scrollbar if we are jump
# scrolling.
#
# Arguments:
# w - The scrollbar widget.
# x, y - The current mouse position.
sub Drag
{my $w = shift;
my $e = $w->XEvent;
return unless (defined $initMouse);
my $f = $w->fraction($e->x,$e->y);
my $delta = $f - $initMouse;
if ($w->cget('-jump'))
{
if (@initValues == 2)
{
$w->set($initValues[0]+$delta,$initValues[1]+$delta);
}
else
{
$delta = int($delta * $initValues[0]);
$initValues[2] += $delta;
$initValues[3] += $delta;
$w->set(@initValues);
}
}
else
{
$w->ScrlToPos($initPos+$delta);
}
}
# end of Tk::Scrollbar::Drag
1;
|