Skip to content

Latest commit

 

History

History
82 lines (64 loc) · 2.17 KB

File metadata and controls

82 lines (64 loc) · 2.17 KB

AddChoice

Description

Adds an item to the component's choices.

The valid components are created by CreatePullDownMenu, CreatePullDownMenuGroupBox, CreateListBox, CreateListBoxN.

PROCEDURE AddChoice(
				dialogID    : LONGINT;
				componentID : LONGINT;
				choiceText  : STRING;
				itemIndex   : INTEGER);
def vs.AddChoice(dialogID, componentID, choiceText, itemIndex):
    return None

Parameters

Name Type Description
dialogID LONGINT the dialog identifier given by CreateLayout or CreateResizableLayout
componentID LONGINT The identifier for the component that contains the choices.
choiceText STRING The text for the item that is about to be added.
itemIndex INTEGER The index after which the new item is to be added.

Remarks

For components created by CreateEnhancedPullDownMenu, InsertEnhancedPullDownMenuItem should be used.

Examples

DialogLayoutPulldownMenu

BEGIN
	CASE item OF
		SetupDialogC: BEGIN
			AddChoice(dialogID,  6,  GetPlugInString (3011),  0);
			FOR i := 1 TO gNumSymFolders DO
				AddChoice(dialogID,  6,  gFolderN [i],  i);

BEGIN
	CASE item OF
		SetupDialogC: BEGIN
			AddChoice(dialogID1,  6,  GetPlugInString (3011),  0);
			FOR i := 1 TO gNumSymFolders DO
				AddChoice(dialogID1,  6,  gFolderN [i],  i);

BEGIN
	value := fieldN [i];
	AddChoice(dialogID,  fieldID,  value,  i-i);
END;
import vs

# Adds an item to the component's choices.
dialogID = 1
componentID = 2
choiceText = 'Example text'
itemIndex = 1

vs.AddChoice(dialogID, componentID, choiceText, itemIndex)
newObj = vs.LNewObj()  # handle to the newly created object

See Also

For further information, please check out: CreatePullDownMenu

CreatePullDownMenuGroupBox

CreateListBox

CreateListBoxN

Version

Availability: from Vectorworks 2010

Category