summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl0/lib/Tk/DragDrop/Win32Site.pm
diff options
context:
space:
mode:
authorSiep Kroonenberg <siepo@cybercomm.nl>2011-02-17 12:20:49 +0000
committerSiep Kroonenberg <siepo@cybercomm.nl>2011-02-17 12:20:49 +0000
commit316ee97c621496b0fe3267f57cce81bee44ca1e6 (patch)
treecb2cab1192b4f58a7971af19b213e980bceda4b4 /Master/tlpkg/tlperl0/lib/Tk/DragDrop/Win32Site.pm
parentcd0f87b5d39480d85ad9bd4ee37f520f75bed560 (diff)
Moving old tlperl prior to committing new one
git-svn-id: svn://tug.org/texlive/trunk@21422 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl0/lib/Tk/DragDrop/Win32Site.pm')
-rwxr-xr-xMaster/tlpkg/tlperl0/lib/Tk/DragDrop/Win32Site.pm50
1 files changed, 50 insertions, 0 deletions
diff --git a/Master/tlpkg/tlperl0/lib/Tk/DragDrop/Win32Site.pm b/Master/tlpkg/tlperl0/lib/Tk/DragDrop/Win32Site.pm
new file mode 100755
index 00000000000..f45d06bc92b
--- /dev/null
+++ b/Master/tlpkg/tlperl0/lib/Tk/DragDrop/Win32Site.pm
@@ -0,0 +1,50 @@
+package Tk::DragDrop::Win32Site;
+
+use vars qw($VERSION);
+$VERSION = sprintf '4.%03d', q$Revision: #8 $ =~ /\D(\d+)\s*$/;
+
+use Tk qw($XS_VERSION);
+require DynaLoader;
+require Tk::DropSite;
+
+use base qw(Tk::DropSite DynaLoader);
+
+bootstrap Tk::DragDrop::Win32Site;
+
+use strict;
+
+Tk::DropSite->Type('Win32');
+
+sub WM_DROPFILES () {563}
+
+sub InitSite
+{
+ my ($class,$site) = @_;
+ my $w = $site->widget;
+ $w->BindClientMessage(WM_DROPFILES,[\&Win32Drop,$site]);
+ DragAcceptFiles($w,1);
+}
+
+sub Win32Drop
+{
+ # print join(',',@_),"\n";
+ my ($w,$site,$msg,$wParam,$lParam) = @_;
+ my ($x,$y,@files) = DropInfo($wParam);
+ my $cb = $site->{'-dropcommand'};
+ $site->Apply(-entercommand => $x, $y, 1);
+ if ($cb)
+ {
+ foreach my $file (@files)
+ {
+ # print "$file @ $x,$y\n";
+ $w->clipboardClear;
+ $w->clipboardAppend('--',$file);
+ $cb->Call('CLIPBOARD',Win32Drop => ['STRING'],$x,$y);
+ }
+ }
+ $site->Apply(-entercommand => $x, $y, 0);
+ return 0;
+}
+
+1;
+__END__