HSP sun HSP Programming Guide

HSP Guide [11]

Combobox

The combo box displays the list that consists of the item of two or more lines and selects one item. The button has adhered at the right of the object, and when it is pushed, the list does the down of the drop. "combox" instruction is used. Delimit the displayed character of each item by "\n".

	pos 150,100	// position
	objsize 100	// size

//	put combobox
	combox cb,100,"Sun\nRain\nCloud"

	button "Check",*kakunin
	stop

*kakunin
	mes "Item IDF"+cb+""
	stop

Item ID that has been selected is substituted for the variable specified for the first parameter of "combox" instruction. It is necessary to note that item ID starts from 0. As for sun weather, item ID0 and cloudy weather become items ID2 in the sample above. If item ID is specified for this variable beforehand, it is a selection item at the combo box arrangement stage.

	cb=1

	pos 150,100
	objsize 100

//	put combobox
	combox cb,100,"Sun\nRain\nCloud"

Listbox

The list box displays the list that consists of the item of two or more lines and selects one item. The function is the same. only differ from the combo box the designThe explanation is omitted.

	pos 150,100	// position
	objsize 100	// size

//	put listbox
	listbox lb,100,"Sun\nRain\nCloud"

	button "Check",*kakunin
	stop

*kakunin
	mes "Item IDF"+lb+""
	stop

Combobox, Listbox, and objprm instruction

The entire another character string of contents displayed after the object is set up by "combox" instruction and "listbox" instruction is changed. Appearing "objrpm" instruction is used also in the previous button and the checkbox.

	combox cb,100,"Sun\nRain\nCloud"

	listbox lb,100,"Sun\nRain\nCloud"

	button "Change",*henko
	stop

*henko
	objprm 0,"abc\nxyz\n012\n;:@"

	objprm 1,"Tokyo\nKyoto\nOsaka"

	stop

< Prev | Next >

About

Welcome to HSP sun. Here is a site to introduces HSP, a free script language system.

Menu

Copyright(c) HSP sun [HSP]

inserted by FC2 system