Skip to content

MLISTBOX ​

MLISTBOX opens a box where the user can select multiple values of a list of values.

Syntax ​

leo-grammar
CC "AdoScript" MLISTBOX entries:strValue [ toksep:strValue ] 
						 [ selection:strValue ] [ title:strValue ] 
						 [ boxtext:strValue ] [ oktext:strValue ] 
						 [ w:intValue h:intValue ] [ extra:{ Extra } ].

Extra :		{ CheckBox }

CheckBox :	CHECKBOX cbText [ checked:intValue ] result-var:varName

cbText:	strValue

 # --> RESULT endbutton:strValue selection:strValue [ extraValues ]

Parameters ​

  • entries (strValue) - the possible values for selection. The values have to be separated by a character specified with toksep.
  • toksep (strValue, optional) - separator that is used for the entries tokenstring (space is the default)
  • selection (strValue, optional) - sets preselected values
  • title (strValue, optional) - the window title is set with title.
  • boxtext (strValue, optional) - the label of the listbox
  • oktext (strValue, optional) - the label of the "Ok" button (does not change the string used for the endbutton return value)
  • w (intValue, optional) - the width of the dialog (in pixel)
  • h (intValue, optional) - the height of the dialog (in pixel)
  • extra (strValue, optional) - inserts additional checkboxes in the mlistbox. For each check box, the keyword CHECKBOX followed by the label of the checkbox has to be specified. Set the argument checked to 1 if the checkbox should be checked when the dialog is started, set it to 0 if not. For each checkbox, the name of a result variable is specified. After closing the dialog, the result variables are set to 1 if the checkbox has been checked, to 0 if not.

Returns ​

  • endbutton (strValue) - contains the name of the button the user pressed to close the dialog.
  • selection (strValue) - contains a list of the selected values separated by the character specified with toksep.
  • extraValues (boolValue, optional) - in extra defined options are returned as variables with the name of the option (variable name is the name provided by the option) and the boolean value if it was checked or not

Details ​

See Also ​

LISTBOX

Examples ​

Example 1 ​

asc
CC "AdoScript" MLISTBOX entries:"First Entry;Second Entry;Third;Fourth" 
						toksep:";" 
						title:"Example!" 
						oktext:"Click me!" 
						boxtext:"Choose your entry:" 
						selection:"Second Entry;Third"
IF (endbutton = "ok") {
   CC "AdoScript" INFOBOX (selection)
}

Starts a MLISTBOX with the entries "First Entry", "Second Entry", "Third", "Fourth" and "Fifth Entry". As entries are separated by the character ";", toksep:";" defines this character as the separator. The second and third entries are preselected.

MLISTBOX

After the user selected some other entries and clicks the "Ok" button, the return value is displayed in an info box.

Example 2 ​

leo-grammar
CC "AdoScript" MLISTBOX entries:"First Entry;Second Entry;Third;Fourth;Fifth Entry" 
						toksep:";" 
						title:"Example!" 
						oktext:"Click me!" 
						boxtext:"Choose your entry:" 
						selection:"Second Entry;Third" 
						extra:{ CHECKBOX "Option 1" checked:1 result-var:option1 
								CHECKBOX "Option 2" result-var:option2}
IF (endbutton = "ok") {
   CC "AdoScript" INFOBOX (selection + "\nOption1="+STR option1+"\nOption2="+STR option2)
}

Versions and Changes ​

Available since ADOxx 1.3