back to gui 

wxListBox

generated from ../src/mod_gui/control/listbox.cpp

A listbox is used to select one or more of a list of strings. The strings are displayed in a scrolling box, with the selected string(s) marked in reverse video. A listbox can be single selection (if an item is selected, the previous selection is removed) or multiple selection (clicking an item toggles the item on or off independently of other selections).

Constants

Style

Name Description
SINGLE
MULTIPLE
EXTENDED
HSCROLL
ALWAYS_SB
NEEDED_SB
SORT

Constructor

wxListBox

wxListBox()
 
wxListBox(Parent, 
          Id, 
          Position = wxDefaultPosition, 
          Size = wxDefaultSize, 
          Items = null, 
          Style = 0, 
          Validator = null)
 
Name Type Default Description
Parent wxWindow The parent of the wxListBox. null is not Allowed.
Id Integer The windows identifier. -1 can be used when you don't need a unique id.
Position wxPoint wxDefaultPosition The position of the listbox.
Size wxSize wxDefaultSize The size of the listbox.
Items Array null The items for the listbox.
Style Integer 0 The style of listbox. You can use the style.
Validator wxValidator null

Creates a new wxListBox object

Properties

Name Type Description
selections read only Array An array with all the indexes of the selected items

Methods

create

create(Parent, 
       Id, 
       Position = wxDefaultPosition, 
       Size = wxDefaultSize, 
       Items = null, 
       Style = 0, 
       Validator = null) : Boolean
 
Name Type Default Description
Parent wxWindow The parent of the wxListBox. null is not Allowed.
Id Integer The windows identifier. -1 can be used when you don't need a unique id.
Position wxPoint wxDefaultPosition The position of the listbox.
Size wxSize wxDefaultSize The size of the listbox.
Items Array null The items for the listbox.
Style Integer 0 The style of listbox. You can use the style.
Validator wxValidator null

Creates a wxListBox

insertItems

insertItems(Items, 
            Index)
 
Name Type Default Description
Items Array
Index Integer Position before which to insert the items: for example, if pos is 0 (= the default) the items will be inserted in the beginning of the listbox

Inserts all the items

setFirstItem

setFirstItem(Idx)
 
Name Type Default Description
Idx Integer The zero-based item index
setFirstItem(Str)
 
Name Type Default Description
Str String The string that should be visible

Set the specified item to be the first visible item. Windows only.

Events

onListBox Called when an item is selected. The type of the argument that your handler receives is wxCommandEvent.
onDoubleClicked Called when the listbox is double clicked. The type of the argument that your handler receives is wxCommandEvent.


SourceForge.net Logo Support This Project

Table of Contents

Prototype

wxControlWithItems

Constructor

wxListBox

Properties

selections

Methods

create
insertItems
setFirstItem

Events

onListBox
onDoubleClicked


Design downloaded from Zeroweb.org: Free website templates, layouts, and tools.