Win32::AutoItX::Control::ListView - OO interface for ListView32 controls
use Win32::AutoItX; my $a = Win32::AutoItX->new; my $pid = $a->Run('regedit.exe'); my $window = $a->get_window('Registry Editor'); $window->wait; $window->show; my $listview = $window->get_control('SysListView321')->listview(); for my $i (0 .. $listview->count - 1) { print "Item #$i Column 0 = ", $listview->text($i), "\n", "\tColumn 1 = ", $listview->text($i, 1), "\n", "\tColumn 2 = ", $listview->text($i, 2), "\n"; } $listview->select_all; my @selected = $listview->selected; print "Selected items = @selected\n";
Win32::AutoItX::Control::ListView provides an object-oriented interface for AutoItX methods to operate with ListView32 (SysListView32) controls.
All items/subitems are 0 based. This means that the first item/subitem in a list is 0, the second is 1, and so on.
In a "Details" view of a ListView32 control, the "item" can be thought of as the "row" and the "subitem" as the "column".
$listview = Win32::AutoItX::Control::ListView->new($control)
creates a ListView object.
$index = $listview->selected() @indexes = $listview->selected()
returns a string containing the item index of selected items. In the scalar context it returns the first select item only.
$index = $listview->find($string) $index = $listview->find($string, $subitem)
returns the item index of the string. Returns -1 if the string is not found.
$count = $listview->count()
returns the number of list items.
$selected_count = $listview->selected_count()
returns the number of items that are selected.
$subitem_count = $listview->subitem_count()
returns the number of subitems.
$text = $listview->text($item, $subitem)
returns the text of a given item/subitem.
$boolean = $listview->is_selected($item)
returns 1 if the item is selected, otherwise returns 0.
$listview->select($index) $listview->select($from_index, $to_index)
selects one or more items.
$listview->deselect($index) $listview->deselect($from_index, $to_index)
deselects one or more items.
$listview->select_all()
selects all items.
$listview->clear_select()
clears the selection of all items.
$listview->invert_select()
inverts the current selection.
$listview->change_view($view)
changes the current view. Valid views are "list", "details", "smallicons", "largeicons".
This module also provides most of Win32::AutoItX::Control methods.
Mikhail Telnov <Mikhail.Telnov@gmail.com>
This software is copyright (c) 2017 by Mikhail Telnov.
This library is free software; you may redistribute and/or modify it under the same terms as Perl itself.
To install Win32::AutoItX, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Win32::AutoItX
CPAN shell
perl -MCPAN -e shell install Win32::AutoItX
For more information on module installation, please visit the detailed CPAN module installation guide.