The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Win32::AutoItX::Control::ListView - OO interface for ListView32 controls

SYNOPSIS

    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";

DESCRIPTION

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".

METHODS

new

    $listview = Win32::AutoItX::Control::ListView->new($control)

creates a ListView object.

selected

    $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.

find

    $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

    $count = $listview->count()

returns the number of list items.

selected_count

    $selected_count = $listview->selected_count()

returns the number of items that are selected.

subitem_count

    $subitem_count = $listview->subitem_count()

returns the number of subitems.

text

    $text = $listview->text($item, $subitem)

returns the text of a given item/subitem.

is_selected

    $boolean = $listview->is_selected($item)

returns 1 if the item is selected, otherwise returns 0.

select

    $listview->select($index)
    $listview->select($from_index, $to_index)

selects one or more items.

deselect

    $listview->deselect($index)
    $listview->deselect($from_index, $to_index)

deselects one or more items.

select_all

    $listview->select_all()

selects all items.

clear_select

    $listview->clear_select()

clears the selection of all items.

invert_select

    $listview->invert_select()

inverts the current selection.

change_view

    $listview->change_view($view)

changes the current view. Valid views are "list", "details", "smallicons", "largeicons".

Win32::AutoItX::Control methods

This module also provides most of Win32::AutoItX::Control methods.

SEE ALSO

Win32::AutoItX::Control
Win32::AutoItX
AutoItX Help

AUTHOR

Mikhail Telnov <Mikhail.Telnov@gmail.com>

COPYRIGHT

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.