ListControl

Help Contents GUI programming ListControls ListControl
ListControls ListControlDestroy

ListControl parent name onItemSelected onItemActivated onColClick
(ListControl parent name)
(ListControl parent name onItemSelected onItemActivated onColClick style pos size)


outputs a new ListControl lc and shows it on the parent (a Frame or a Graph, main Graph if []).

name is its label text.

onItemSelected is a Logo instructionlist which will be run when the user selects a list item.

onItemActivated is a Logo instructionlist which will be run when the user activates a list item, using either the [Enter] or [Space] key double-clicking with the mouse.

onColClick is a Logo instructionlist which will be run when the user left-clicks a column label with the mouse.



style is the window style and can be a combination of the following constants:

wxLC_LIST Multicolumn list view, with optional small icons. Columns are computed automatically, i.e. you don't set columns as in wxLC_REPORT. In other words, the list wraps, unlike a wxListBox.

wxLC_REPORT Single or multicolumn report view, with optional header.

wxLC_VIRTUAL Don't use this, it wont work! (The application provides items text on demand. May only be used with wxLC_REPORT.)

wxLC_ICON Large icon view, with optional labels.

wxLC_SMALL_ICON Small icon view, with optional labels.

wxLC_ALIGN_TOP Icons align to the top. Win32 default, Win32 only.

wxLC_ALIGN_LEFT Icons align to the left.

wxLC_AUTOARRANGE Icons arrange themselves. Win32 only.

wxLC_EDIT_LABELS Labels are editable: the application will be notified when editing starts.

wxLC_NO_HEADER No header in report mode.

wxLC_SINGLE_SEL Single selection (default is multiple).

wxLC_SORT_ASCENDING Don't use this, it wont work! (Sort in ascending order (must still supply a comparison callback in SortItems.))

wxLC_SORT_DESCENDING Don't use this, it wont work! (Sort in descending order (must still supply a comparison callback in SortItems.))

wxLC_HRULES Draws light horizontal rules between rows in report mode.

wxLC_VRULES Draws light vertical rules between columns in report mode.



pos is the position of the ChoiceBox (a list of two integer numbers, x and y),

size is the size of the ChoiceBox (a list of two integer numbers, width and height).

Example:

lc=(ListControl [][MyListControl]
	[	row=ListControlRow
		(pr word [row=] row
			word [column=] ListControlColumn
			ListControlText
			[Selected])
		id=Int (ListControlGetItem lc row 0)
	]
	[	(pr word [row=] ListControlRow
			word [column=] ListControlColumn
			ListControlText
			[Activated])
	]
	[	c=ListControlColumn
		(pr word [column=] c
			[Columnclick])
		ListControlSort lc c
	] wxLC_REPORT [10 20][400 300])

foreach [[[ID] 40][[First Name] 80][[Name] 120][[Logo] 120]] [
	(ListControlInsertColumn lc # (?).1 (?).2)
]

data=[
	[1 Brian Harvey UCBLogo]
	[2 George Mills MSWLogo]
	[3 Pavel Boytchev Elica]
	[4 Lionel Laske Liogo]
	[5 Andreas Micheler aUCBLogo]
]
ListControlSet lc data

Examples:

References:

ListControls ListControlDestroy