Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | # NOTE: Derived from ../blib/lib/Tk/Scale.pm. |
2 | # Changes made here will be lost when autosplit is run again. | |
3 | # See AutoSplit.pm. | |
4 | package Tk::Scale; | |
5 | ||
6 | #line 138 "../blib/lib/Tk/Scale.pm (autosplit into ../blib/lib/auto/Tk/Scale/ButtonDown.al)" | |
7 | # ButtonDown -- | |
8 | # This procedure is invoked when a button is pressed in a scale. It | |
9 | # takes different actions depending on where the button was pressed. | |
10 | # | |
11 | # Arguments: | |
12 | # w - The scale widget. | |
13 | # x, y - Mouse coordinates of button press. | |
14 | sub ButtonDown | |
15 | { | |
16 | my $w = shift; | |
17 | my $x = shift; | |
18 | my $y = shift; | |
19 | $Tk::dragging = 0; | |
20 | $el = $w->identify($x,$y); | |
21 | return unless ($el); | |
22 | if ($el eq 'trough1') | |
23 | { | |
24 | $w->Increment('up','little','initial') | |
25 | } | |
26 | elsif ($el eq 'trough2') | |
27 | { | |
28 | $w->Increment('down','little','initial') | |
29 | } | |
30 | elsif ($el eq 'slider') | |
31 | { | |
32 | $Tk::dragging = 1; | |
33 | my @coords = $w->coords(); | |
34 | $Tk::deltaX = $x-$coords[0]; | |
35 | $Tk::deltaY = $y-$coords[1]; | |
36 | } | |
37 | } | |
38 | ||
39 | # end of Tk::Scale::ButtonDown | |
40 | 1; |