Help Contents / GUI programming / ComboBoxes / ComboBox

ComboBox parent name text choices onSelect onChange onEnter
(ComboBox parent name text choices)
(ComboBox parent name text choices onSelect onChange onEnter style pos size)

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

name is its label text. 

text is the standard text shown in the edit control when the ComboBox is created. 

choices is a list of items from whom the user can select one. 

onSelect is a Logo instructionlist which will be run when the user selects a choice. 

onChange is a Logo instructionlist which will be run when the user changes the text in the edit control. 

onEnter is a Logo instructionlist which will be run when the user presses the [Enter] key. 



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

wxCB_SIMPLE  Creates a ComboBox with a permanently displayed list. Windows only. 

wxCB_DROPDOWN  Creates a ComboBox with a drop-down list. 

wxCB_READONLY  Same as wxCB_DROPDOWN but only the strings specified as the ComboBox choices can be selected, it is impossible to select (even from a program) a string which is not in the choices list. 

wxCB_SORT  Sorts the entries in the list alphabetically. 



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

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

Example: 

	cb=(ComboBox [][MyComboBox][Initial string] 
		[	[String 1] 
			[and a second string] 
			[and the last string] 
		] 
		[	(show "|MyComboBox| ComboBoxSelection) 
		] 
		[	(pr [change] ComboBoxValue) 
		] 
		[	v=ComboBoxValue 
			(pr [enter] v) 
			ComboBoxAppend cb v 
		] 
		wxCB_simple [-1 -1][300 200]) 


next: ComboBoxDestroy
