=head2 Package Win32::GUI::ListView

L<Back to the Packages|guipacks/>

=over

=item *

L<Constructor>

=over

=item *

L<new Win32::GUI::ListView(PARENT, %OPTIONS)|/new_Win32_GUI_ListView_PARENT_>

=back

=item *

L<Methods>

=over

=item *

L<Add(ITEM, ITEM .. ITEM)|/Add_ITEM_ITEM_ITEM_>

=item *

L<Arrange([FLAG])|/Arrange_FLAG_>

=item *

L<ChangeItem(%OPTIONS)|/ChangeItem_OPTIONS_>

=item *

L<Clear()|/Clear_>

=item *

L<ColumnWidth(COLUMN, [WIDTH])|/ColumnWidth_COLUMN_WIDTH_>

=item *

L<Count()|/Count_>

=item *

L<DeleteColumn(INDEX)|/DeleteColumn_INDEX_>

=item *

L<DeleteItem(INDEX)|/DeleteItem_INDEX_>

=item *

L<EditLabel(INDEX)|/EditLabel_INDEX_>

=item *

L<EnsureVisible(INDEX, [FLAG])|/EnsureVisible_INDEX_FLAG_>

=item *

L<GetFirstVisible()|/GetFirstVisible_>

=item *

L<GetItem(INDEX, [SUBINDEX])|/GetItem_INDEX_SUBINDEX_>

=item *

L<GetStringWidth(STRING)|/GetStringWidth_STRING_>

=item *

L<HitTest(X, Y)|/HitTest_X_Y_>

=item *

L<InsertColumn(%OPTIONS)|/InsertColumn_OPTIONS_>

=item *

L<InsertItem(%OPTIONS)|/InsertItem_OPTIONS_>

=item *

L<ItemCheck(INDEX)|/ItemCheck_INDEX_>

=item *

L<ItemInfo(INDEX, [SUBINDEX])|/ItemInfo_INDEX_SUBINDEX_>

=item *

L<ItemPosition(INDEX, [X, Y])|/ItemPosition_INDEX_X_Y_>

=item *

L<MoveItem(INDEX, X, Y)|/MoveItem_INDEX_X_Y_>

=item *

L<Select(INDEX)|/Select_INDEX_>

=item *

L<SelectCount()|/SelectCount_>

=item *

L<SelectedItems()|/SelectedItems_>

=item *

L<SetImageList(IMAGELIST, [TYPE])|/SetImageList_IMAGELIST_TYPE_>

=item *

L<SetItem(%OPTIONS)|/SetItem_OPTIONS_>

=item *

L<TextBkColor([COLOR])|/TextBkColor_COLOR_>

=item *

L<TextColor([COLOR])|/TextColor_COLOR_>

=item *

L<View([MODE])|/View_MODE_>

=item *

L<VisibleCount()|/VisibleCount_>

=back

=item *

L<Events>

=over

=item *

L<ColumnClick(ITEM)|/ColumnClick_ITEM_>

=item *

L<ItemClick(ITEM)|/ItemClick_ITEM_>

=item *

L<KeyDown(KEY)|/KeyDown_KEY_>

=back

=back

=head3 Constructor

=over 4

=for html <A NAME="new_Win32_GUI_ListView_PARENT_">

=item new Win32::GUI::ListView(PARENT, %OPTIONS)

Creates a new ListView object;
can also be called as PARENT->AddListView(%OPTIONS).

=for html <P>

=back

=head3 Methods

=over 4

=for html <A NAME="Add_ITEM_ITEM_ITEM_">

=item Add(ITEM, ITEM .. ITEM)

Inserts one or more items in the control; each item must be passed as
an hash reference. See  L<InsertItem()|/InsertItem_OPTIONS_> for a list of the available
key/values of these hashes.

=for html <P>

=for html <A NAME="Arrange_FLAG_">

=item Arrange([FLAG])

Arranges items in the ListView; the optional FLAG parameter can be one
of the following values:

  0 uses the current alignment style (this is the default)
  1 align items along the left edge of the window
  2 align items along the top edge of the window
  5 snaps icons to the nearest grid position

=for html <P>

=for html <A NAME="ChangeItem_OPTIONS_">

=item ChangeItem(%OPTIONS)

[TBD]



=for html <P>

=for html <A NAME="Clear_">

=item Clear()

Deletes all items from the ListView.

=for html <P>

=for html <A NAME="ColumnWidth_COLUMN_WIDTH_">

=item ColumnWidth(COLUMN, [WIDTH])

Gets or sets the width of the specified COLUMN; WIDTH can be the desired
width in pixels or one of the following special values:

  -1 automatically size the column
  -2 automatically size the column to fit the header text

=for html <P>

=for html <A NAME="Count_">

=item Count()

Returns the number of items in the ListView.

=for html <P>

=for html <A NAME="DeleteColumn_INDEX_">

=item DeleteColumn(INDEX)

[TBD]



=for html <P>

=for html <A NAME="DeleteItem_INDEX_">

=item DeleteItem(INDEX)

Removes the zero-based INDEX item from the ListView.

=for html <P>

=for html <A NAME="EditLabel_INDEX_">

=item EditLabel(INDEX)

[TBD]



=for html <P>

=for html <A NAME="EnsureVisible_INDEX_FLAG_">

=item EnsureVisible(INDEX, [FLAG])

[TBD]



=for html <P>

=for html <A NAME="GetFirstVisible_">

=item GetFirstVisible()

Returns the index of the first visible item in the ListView.

=for html <P>

=for html <A NAME="GetItem_INDEX_SUBINDEX_">

=item GetItem(INDEX, [SUBINDEX])

See  L<ItemInfo()|/ItemInfo_INDEX_SUBINDEX_>.

=for html <P>

=for html <A NAME="GetStringWidth_STRING_">

=item GetStringWidth(STRING)

Returns the width, in pixels, needed to display the specified STRING
in the ListView area.

=for html <P>

=for html <A NAME="HitTest_X_Y_">

=item HitTest(X, Y)

Checks if the specified point in the ListView area is occupied by an
item; it returns the index of the found item or zero if none was found.
If called in an array context, it returns an additional value containing
more info about the position of the specified point.

=for html <P>

=for html <A NAME="InsertColumn_OPTIONS_">

=item InsertColumn(%OPTIONS)

[TBD]



=for html <P>

=for html <A NAME="InsertItem_OPTIONS_">

=item InsertItem(%OPTIONS)

Inserts a new item in the control.
(@)OPT: -image => NUMBER
(@)OPT:   index of an image from the associated ImageList
(@)OPT: -indent => NUMBER
(@)OPT:   how much the item must be indented; one unit
(@)OPT:   is the width of an item image, so 2 is twice
(@)OPT:   the width of the image, and so on.
(@)OPT: -item => NUMBER
(@)OPT:   zero-based index for the new item; the default
(@)OPT:   is to add the item at the end of the list.
(@)OPT: -selected => 0/1, default 0
(@)OPT: -text => STRING
(@)OPT:   the text for the item

=for html <P>

=for html <A NAME="ItemCheck_INDEX_">

=item ItemCheck(INDEX)

Gets the check state of a ListView item (valid only if the
control was created with the -checkboxes => 1 option).

=for html <P>

=for html <A NAME="ItemInfo_INDEX_SUBINDEX_">

=item ItemInfo(INDEX, [SUBINDEX])

Returns an associative array of information about the given zero-based
INDEX item:

    -image
    -state
    -text

Optionally, a SUBINDEX (one-based index) can be given, to get the text
for the specified column.

=for html <P>

=for html <A NAME="ItemPosition_INDEX_X_Y_">

=item ItemPosition(INDEX, [X, Y])

Moves the specified zero-based INDEX item to the specified position,
or returns its current X and Y position if X and Y are not given.
See also  L<MoveItem()|/MoveItem_INDEX_X_Y_>

=for html <P>

=for html <A NAME="MoveItem_INDEX_X_Y_">

=item MoveItem(INDEX, X, Y)

Moves the specified zero-based INDEX item to the specified position,
if the ListView is in big or small icon view mode; X and Y coordinates
are relative to the ListView client area.

=for html <P>

=for html <A NAME="Select_INDEX_">

=item Select(INDEX)

[TBD]



=for html <P>

=for html <A NAME="SelectCount_">

=item SelectCount()

Returns the number of currently selected items.

=for html <P>

=for html <A NAME="SelectedItems_">

=item SelectedItems()

Retuns an array containing the zero-based indexes of selected items.

=for html <P>

=for html <A NAME="SetImageList_IMAGELIST_TYPE_">

=item SetImageList(IMAGELIST, [TYPE])

[TBD]



=for html <P>

=for html <A NAME="SetItem_OPTIONS_">

=item SetItem(%OPTIONS)

See  L<ChangeItem()|/ChangeItem_OPTIONS_>.

=for html <P>

=for html <A NAME="TextBkColor_COLOR_">

=item TextBkColor([COLOR])

Gets or sets the background color for the text in the ListView.

=for html <P>

=for html <A NAME="TextColor_COLOR_">

=item TextColor([COLOR])

Gets or sets the text color for the ListView.

=for html <P>

=for html <A NAME="View_MODE_">

=item View([MODE])

Gets or sets the viewing mode of the ListView control; the returned
or given MODE can have one of the following values:

  0  big icons
  1  details
  2  small icons
  3  list

=for html <P>

=for html <A NAME="VisibleCount_">

=item VisibleCount()

Returns the number of items that can be fully visible in a page of the
ListView control; if the current view state is big or small icons, the
function returns the total number of items in the control.

=for html <P>

=back

=head3 Events

=over 4

=for html <A NAME="ColumnClick_ITEM_">

=item ColumnClick(ITEM)

Sent when the user clicks on a column header in the
ListView; ITEM specifies the one-based index of the
selected column.

=for html <P>

=for html <A NAME="ItemClick_ITEM_">

=item ItemClick(ITEM)

Sent when the user selects an item in the ListView;
ITEM specifies the zero-based index of the selected item.

=for html <P>

=for html <A NAME="KeyDown_KEY_">

=item KeyDown(KEY)

Sent when the user presses a key while the ListView
control has focus; KEY is the ASCII code of the
key being pressed.

=for html <P>

=back

=cut
