Shouldn't the subroutine name end with _Drag  in keeping with the Windows event 
model?
 
sub WindowName_Event
 
Examples:
sub Main_Terminate{return -1;}
sub Main_Minimize{return 1;}
 
...

 
________________________________

From: Jez White [mailto:[EMAIL PROTECTED]
Sent: Mon 1/10/2005 9:14 AM
To: Lloyd, Steve; Chris Wearn; perl-win32-gui-users
Subject: Re: [perl-win32-gui-users] Listview Control functionality - Drag n 
Drop - Email found in subject



Hi,

Yes it can be added - Chris and came to a little 'agreement' - he supplies
an perl example and I'll add the code:)

The only issue is how to add support dragging with the right mouse button.
How about something like this:

sub Drag_Hander {
  my ($item,$button)[EMAIL PROTECTED];
  if ($button==0) {
    print 'Left button dragging';
 }
else {
      print 'right button dragging';
}
}

In other words the second parameter is true (1) if it dragged by the right
mouse button.

Thoughs?

Cheers,

jez.
----- Original Message -----
From: "Lloyd, Steve" <[EMAIL PROTECTED]>
To: "Jez White" <[EMAIL PROTECTED]>; "Chris Wearn"
<[EMAIL PROTECTED]>; "perl-win32-gui-users"
<perl-win32-gui-users@lists.sourceforge.net>
Sent: Monday, January 10, 2005 3:33 PM
Subject: RE: [SPAM] - Re: [perl-win32-gui-users] Listview Control
functionality - Drag n Drop - Email found in subject


This seems like a very useful add on code  -  can this be added in so
that those who do not have a compiler can get this?


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Jez White
Sent: Saturday, January 08, 2005 3:03 AM
To: Chris Wearn; perl-win32-gui-users
Subject: [SPAM] - Re: [perl-win32-gui-users] Listview Control
functionality - Drag n Drop - Email found in subject


Hi Chris,

> There are quite a few other Methods that appear on the MSDN site:
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shell
> cc/platform/commctls/listview/listview_message_processing.asp
>
> What is required or is there anything that prevents these methods
> being implemented (barring time, hardwork and knowledge) ?

Ok - I'll put myself on a limb and say this is "doable":) Some of the
functionality you would need is missing, while others (handling the
dragging
of an image) is in place (I think)...

To get the Begin drag event add the code to the Listview.XS below (it
was
just a quick hack, but it works):

    else if Parse_Event("BeginDrag",      PERLWIN32GUI_NEM_CONTROL8)

between the lines:

    else if Parse_Event("EndLabelEdit",   PERLWIN32GUI_NEM_CONTROL7)
    else if Parse_Event("KeyDown",        PERLWIN32GUI_NEM_KEYDOWN)

Then add the following to the the ListViiew_onEvent function in the main

switch:

        case LVN_BEGINDRAG:
        /*
         * (@)EVENT:BeginDrag(ITEM)
         * some doco here...
         * (@)APPLIES_TO:ListView
         */
          PerlResult = DoEvent(NOTXSCALL perlud,
PERLWIN32GUI_NEM_CONTROL8,
"BeginDrag",
                       PERLWIN32GUI_ARGTYPE_LONG, (LONG)
lv_notify->iItem,-1);
        break;

We now have a new event handler called "BeginDrag" that can be called by
OEM
and NEM event models:

sub lvwChart_BeginDrag {
  my $item=shift;
  print "perl dragging $item \n";
}

So, now you know what item is being dragged, you'll need to use the
methods
in the imagelist control to make a dragable image. Once the user
releases
the mouse you'll know where the item was dragged to.

And that should be it:) I think.

Hope this helps somewhat.

Cheers,

jez.








-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE
limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and
FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users

This email, and any files or previous email messages included with it, may
contain confidential and/or privileged material. If you are not the intended
recipient please contact the sender and delete all copies.



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users



Reply via email to