Below you can see a subroutine I use to select files out of a list view
based on some search string.
This works in that it goes through the items in the listview, finds the ones
that fit the criteria, selects them with the $ListView->Select() function
and when it's all done it counts how many items are selected (with
ListView->SelectCount) and displays the output.
The only problem is that you can't SEE which items it has selected. They are
selected, but not highlighted.
Any ideas?
Thanks,
Tim Thomas
----------------------------------------------------------------------------
--------------------
sub SelectORIG_Click {SelectFiles("orig");}
sub SelectSM_Click {SelectFiles('-sm');}
sub SelectMD_Click {SelectFiles('-md');}
sub SelectLG_Click {SelectFiles('-lg');}
sub SelectFiles
{
my ($criteria)=@_;
for $i(0..$ListView->Count()-1)
{
my %data=$ListView->ItemInfo($i);
if ($criteria ne "orig")
{
if ($data{-text}=~/$criteria/)
{
$ListView->Select($i);
#Win32::MsgBox("Selected item
$i($data{-text})", 0, "DEBUG");
}
}
elsif (!($data{-text}=~/-/) and ($data{-text} ne
".") and ($data{-text} ne ".."))
{
$ListView->Select($i);
#Win32::MsgBox("Selected item
$i($data{-text})", 0, "DEBUG");
}
}
my $count=$ListView->SelectCount();
Win32::MsgBox("There are $count items selected", 0, "DEBUG");
}
----------------------------------------------------------------------------
---------------------
Tim Thomas
Unix Systems Administrator
Lockheed Martin EIS · Denver Data Center
303-430-2281
mailto:[EMAIL PROTECTED]
----------------------------------------------------------------------------
---------------------