wxListView — wx v2.4.2

Search documentation of wx

# View Source wxListView (wx v2.4.2)

Functions for wxListView class

This class currently simply presents a simpler to use interface for the `wxListCtrl` - it can be thought of as a `façade` for that complicated class.

Using it is preferable to using `wxListCtrl` directly whenever possible because in the future some ports might implement `wxListView` but not the full set of `wxListCtrl` features.

Other than different interface, this class is identical to `wxListCtrl`. In particular, it uses the same events, same window styles and so on.

See: `setColumnImage/3`

This class is derived (and can use functions) from: `wxControl` `wxWindow` `wxEvtHandler`

wxWidgets docs: wxListView

# Summary

## Types

wxListView()

## Functions

clearColumnImage(This, Col)

Resets the column image - after calling this function, no image will be shown.

focus(This, Index)

Sets focus to the item with the given `index`.

getFirstSelected(This)

Returns the first selected item in a (presumably) multiple selection control.

getFocusedItem(This)

Returns the currently focused item or -1 if none.

getNextSelected(This, Item)

Used together with `getFirstSelected/1` to iterate over all selected items in the control.

isSelected(This, Index)

Returns true if the item with the given `index` is selected, false otherwise.

select(This, N)
select/3

Selects or unselects the given item.

setColumnImage(This, Col, Image)

Sets the column image for the specified column.

# Types

Link to this type

# wxListView()

View Source

    -type wxListView() :: wx:wx_object().

# Functions

Link to this function

# clearColumnImage(This, Col)

View Source

    -spec clearColumnImage(This, Col) -> ok when This :: wxListView(), Col :: integer().

Resets the column image - after calling this function, no image will be shown.

See: `setColumnImage/3`

Link to this function

# focus(This, Index)

View Source

    -spec focus(This, Index) -> ok when This :: wxListView(), Index :: integer().

Sets focus to the item with the given `index`.

Link to this function

# getFirstSelected(This)

View Source

    -spec getFirstSelected(This) -> integer() when This :: wxListView().

Returns the first selected item in a (presumably) multiple selection control.

Together with `getNextSelected/2` it can be used to iterate over all selected items in the control.

Return: The first selected item, if any, -1 otherwise.

Link to this function

# getFocusedItem(This)

View Source

    -spec getFocusedItem(This) -> integer() when This :: wxListView().

Returns the currently focused item or -1 if none.

See: `isSelected/2`, `focus/2`

Link to this function

# getNextSelected(This, Item)

View Source

    -spec getNextSelected(This, Item) -> integer() when This :: wxListView(), Item :: integer().

Used together with `getFirstSelected/1` to iterate over all selected items in the control.

Return: Returns the next selected item or -1 if there are no more of them.

Link to this function

# isSelected(This, Index)

View Source

    -spec isSelected(This, Index) -> boolean() when This :: wxListView(), Index :: integer().

Returns true if the item with the given `index` is selected, false otherwise.

See: `getFirstSelected/1`, `getNextSelected/2`

Link to this function

# select(This, N)

View Source

    -spec select(This, N) -> ok when This :: wxListView(), N :: integer().

Link to this function

# select/3

View Source

    -spec select(This, N, [Option]) -> ok
                    when This :: wxListView(), N :: integer(), Option :: {on, boolean()}.

Selects or unselects the given item.

Notice that this method inherits the unusual behaviour of `wxListCtrl:setItemState/4` which sends a wxEVT_LIST_ITEM_SELECTED event when it is used to select an item, contrary to the usual rule that only the user actions result in selection.

Link to this function

# setColumnImage(This, Col, Image)

View Source

    -spec setColumnImage(This, Col, Image) -> ok
                            when This :: wxListView(), Col :: integer(), Image :: integer().

Sets the column image for the specified column.

To use the column images, the control must have a valid image list with at least one image.