NAME

Win32::GUI::Listbox - Create and manipulate listbox controls

DESCRIPTION

[TBD]

METHODS

Common methods apply to most windows, controls and resources.

new

new(PARENT, %OPTIONS)

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

Class specific %OPTIONS are:

-multisel => 0/1/2 (default 0)
    specifies the selection type:
        0 single selection
        1 multiple selection
        2 multiple selection ehnanced (with Shift, Control, etc.)
-sort     => 0/1 (default 0)
    items are sorted alphabetically.
-multicolumn => 0/1 (default 0)
-nointegralheight => 0/1 (default 0)
-noredraw => 0/1 (default 0)
-notify => 0/1 (default 0)
-usetabstop => 0/1 (default 0)
-disablenoscroll => 0/1 (default 0)

See also the common options.

Add

Add(STRING, STRING .. STRING)

Add multiple string.

AddFile

AddFile(STRING)

Add the specified filename to a list box that contains a directory listing.

AddString

AddString(STRING)

Add a string to a Listbox.

Count

Count()

See GetCount()

DeleteString

DeleteString(index)

Removes the zero-based INDEX item from the Listbox.

Dir

Dir(string,flag)

Add a list of filenames to a Listbox.

FindString

FindString(STRING, [INDEX])

Find the first string in a list box that contains the specified prefix.

FindStringExact

FindStringExact(STRING, [INDEX])

Find the first Listbox string that matches the specified string.

FirstVisibleItem

FirstVisibleItem([INDEX])

Set or Get first visible item.

GetAnchorIndex

GetAnchorIndex()

Retrieve the index of the anchor item.

GetCaretIndex

GetCaretIndex()

Determine the index of the item that has the focus rectangle in a multiple-selection Listbox.

GetCount

GetCount()

Returns the number of items in the Listbox.

GetCurSel

GetCurSel()

Retrieve the index of the currently selected item, if any, in a single-selection Listbox.

GetHorizontalExtent

GetHorizontalExtent()

Retrieve from a list box the width, in pixels, by which the Listbox can be scrolled horizontally (the scrollable width) if the list box has a horizontal scroll bar.

GetItemHeight

GetItemHeight(index)

Retrieve the height of items in a Listbox.

GetItemRect

GetItemRect(index)

Retrieve the dimensions of the rectangle that bounds a Listbox item as it is currently displayed in the Listbox.

GetLocale

GetLocale()

Retrieve the current locale of the Listbox.

GetSel

GetSel(index)

Retrieve the selection state of an item.

GetSelCount

GetSelCount()

Retrieve the total number of selected items in a multiple-selection Listbox.

GetSelItems

GetSelItems()

Returns an array containing the zero-based indexes of the selected items in a multiple selection Listbox.

GetString

GetString(INDEX)

See GetText()

GetText

GetText(INDEX)

Returns the string at the specified zero-based INDEX in the Listbox.

GetTextLen

GetTextLen()

Retrieve the length of a string in a Listbox.

GetTopIndex

GetTopIndex()

Retrieve the index of the first visible item in a Listbox.

InsertItem

InsertItem(STRING, [INDEX])

See InsertString()

InsertString

InsertString(STRING, [INDEX])

Inserts an item at the specified zero-based INDEX in the Listbox, or adds it at the end if INDEX is not specified.

Item

Item(INDEX)

Return an Listbox::Item.

ItemFromPoint

ItemFromPoint(X, Y)

Retrieve the zero-based index of the item nearest the specified point in a Listbox.

ItemHeight

ItemHeight([HEIGHT])

Gets or sets the items height in a Listbox.

List

List()

Return a list of Listbox::Item.

RemoveItem

RemoveItem(index)

See DeleteString()

ResetContent

ResetContent()

Remove all items from a Listbox.

Select

Select(INDEX)

See SetCurSel()

SelectCount

SelectCount()

See GetSelCount()

SelectedItem

SelectedItem()

See GetCurSel()

SelectedItems

SelectedItems()

See GetSelItems()

SelectString

SelectString(STRING, [INDEX])

Search in a Listbox for an item that begins with the characters in a specified string. If a matching item is found, the item is selected.

SelItemRange

SelItemRange(FIRST,LAST,[FLAG=TRUE])

Select one or more consecutive items in a multiple-selection Listbox.

SelItemRangeEx

SelItemRangeEx(FIRST,LAST)

Select one or more consecutive items in a multiple-selection Listbox.

SetAnchorIndex

SetAnchorIndex(index)

Set the anchor item that is, the item from which a multiple selection starts. A multiple selection spans all items from the anchor item to the caret item.

SetCaretIndex

SetCaretIndex(index)

Set the focus rectangle to the item at the specified index in a multiple-selection Listbox. If the item is not visible, it is scrolled into view.

SetColumnWidth

SetColumnWidth(Width)

Set the width, in pixels, of all columns in a multi-column Listbox.

SetCount

SetCount(Count)

Set the count of items in a Listbox.

SetCurSel

SetCurSel(INDEX)

Selects the zero-based INDEX item in the Listbox. Can only be used with single selection listboxes. For multiple-selection listboxes see SetSel().

SetHorizontalExtent

SetHorizontalExtent(cxExtent)

Set the width, in pixels, by which a Listbox can be scrolled horizontally.

SetItemHeight

SetItemHeight(Height)

Set the height, in pixels, of items in a Listbox.

SetLocal

SetLocal(local)

Set the current locale of the Listbox.

SetSel

SetSel(index,[FLAG=TRUE])

Select a string in a multiple-selection Listbox.

SetTabStops

SetTabStops(...)

Set the tab-stop positions in a Listbox.

SetTopIndex

SetTopIndex(index)

Ensure that a particular item in a Listbox is visible.

EVENTS

Common events apply to most windows and controls.

Click

Click()

DEPRECATED use SelChange event.

DblClick

DblClick()

Sent when the user double clicks on the control.

GotFocus

GotFocus()

Sent when the control is activated.

LostFocus

LostFocus()

Sent when the control is deactivated.

SelCancel

SelCancel()

Sent when the user cancels the selection in a Listbox.

SelChange

SelChange()

[TBD]

VERSION

Documentation for Win32::GUI v1.14 created 01 Jun 2017

This document is autogenerated by the build process. Edits made here will be lost. Edit docs/per_package.tpl instead.

SUPPORT

Homepage: http://perl-win32-gui.sourceforge.net/.

For further support join the users mailing list from the website at http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users. There is a searchable list archive at http://sourceforge.net/p/perl-win32-gui/mailman/perl-win32-gui-users/.

COPYRIGHT and LICENCE

Copyright (c) 1997..2017 Aldo Calpini. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.