Commit | Line | Data |
---|---|---|
86530b38 AT |
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 247 "../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 | {my $w = shift; | |
19 | my $e = $w->XEvent; | |
20 | return unless (defined $initMouse); | |
21 | my $f = $w->fraction($e->x,$e->y); | |
22 | my $delta = $f - $initMouse; | |
23 | if ($w->cget('-jump')) | |
24 | { | |
25 | if (@initValues == 2) | |
26 | { | |
27 | $w->set($initValues[0]+$delta,$initValues[1]+$delta); | |
28 | } | |
29 | else | |
30 | { | |
31 | $delta = int($delta * $initValues[0]); | |
32 | $initValues[2] += $delta; | |
33 | $initValues[3] += $delta; | |
34 | $w->set(@initValues); | |
35 | } | |
36 | } | |
37 | else | |
38 | { | |
39 | $w->ScrlToPos($initPos+$delta); | |
40 | } | |
41 | } | |
42 | ||
43 | # end of Tk::Scrollbar::Drag | |
44 | 1; |