Each time an item is selected, it will run 
sub ListView_ItemClick
What you probably want is to keep an array of the items (filenames) that are
selected and then if/when a button (which isn't in your code) is _Click 'd
then do a foreach on your list and move each file then undef the list.

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: 29 August 2001 14:20
> To: perl-win32-gui-users@lists.sourceforge.net
> Subject: [perl-win32-gui-users] How to get items that are checked in a
> list view.
> 
> 
> Hello,
> 
> I do get items in a list view that are checked to put in an 
> array/hash/what
> ever.  My code list the contents of a directory and puts them 
> in a list
> view what I want is that after someone selects the files they want by
> checking the box next to it.  They click on a button and it copies the
> selected file to a new location.  Any ideas?
> 
> Thanks,
> 
> Joe
> 
> Here is my code:
> 
> use Win32::GUI;
> 
> $Window = new GUI::Window(
>     -name   => "Window",
>     -text   => "WEB Deploy v1.0.0",
>     -width  => 800,
>     -height => 400,
>     -left   => 100,
>     -top    => 100,
> );
> 
> $Window->AddListView(
>     -name      => "ListView",
>     -text      => "hello world!",
>     -left      => 10,
>     -top       => 10,
>     -width     => 780,
>     -height    => 180,
>     -style     => WS_CHILD | WS_VISIBLE | 1,
>     -fullrowselect => 1,
>     -gridlines => 1,
>     -checkboxes => 1,
> #    -hottrack   => 1,
> );
> 
> $width = $Window->ListView->ScaleWidth;
> 
> $Window->ListView->InsertColumn(
>     -index => 0,
>     -width => $width/4,
>     -text  => "File",
> );
> $Window->ListView->InsertColumn(
>     -index   => 1,
>     -subitem => 1,
>     -width   => $width/1.33,
>     -text    => "Path",
> );
> 
> sub InsertListItem {
>     my($name, $description) = @_;
>     my $item = $Window->ListView->InsertItem(
>         -item  => $Window->ListView->Count(),
>         -text  => $name,
>         # -index => $Window->ListView->Count(),
>     );
>     $Window->ListView->SetItem(
>         -item    => $item,
>         -subitem => 1,
>         -text    => $description,
>     );
> }
> 
> $whereami = `chdir`;
> chomp($whereami);
> 
> $dir = "L:\\Inetpub\\Timesheet";
> push @dir,$dir;
> chomp($dir);
> 
> while ($dirs=pop @dir){
>   chomp($dirs);
>   chdir $dirs;
>   while (<*>) {
>     next if ($_ eq ".");
>     next if ($_ eq "..");
>     if (-d $_) {
>       next if (-l $_);
>       print "\t Dir-> ",$_,"\n" if $DEBUG;
>       push @dir,$dirs."/".$_;
>     } else {
>      InsertListItem($_, $dirs);
>         print "\t File-> ",$_," => $size\n" if $DEBUG;
>     }
>   }
>   exit if $DEBUG;
>   chdir $whereami;
> }
> 
> # $Window->ListView->TextColor(hex("0000FF"));
> 
> $Window->Show();
> 
> $Window->Dialog();
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> 

Reply via email to