VS:SelChoice

From Vectorworks Developer
Revision as of 14:37, 12 August 2013 by Root (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Procedure SelChoice makes a specified list value the selected value for the choice item. To make no item selected, supply -1 as the choice parameter.

PROCEDURE SelChoice(
item :INTEGER;
choice :INTEGER;
select :BOOLEAN);
def vs.SelChoice(item, choice, select):
    return None

Parameters

item INTEGER Item ID of dialog control.
choice INTEGER Position (0-based) in list of item to be set as selected.
select BOOLEAN Selection status of list item.

Remarks

Note: deprecated from VW 15+, use SelectChoice.

Make a current combo box value the selected value for that combo box.

Example

VectorScript

PROCEDURE Example;
VAR
dialog1 :INTEGER;
result  :INTEGER;
PROCEDURE Dialog_Handler(VAR item :LONGINT; data :LONGINT);
BEGIN
IF item = SetUpDialogC THEN BEGIN
InsertChoice(4, 0, 'One');
InsertChoice(4, 1, 'Two');
InsertChoice(4, 2, 'Three');
SelChoice(4, 1, TRUE);
END;
END;
BEGIN
dialog1 := CreateLayout('Example Dialog', FALSE, 'OK', '');
CreatePullDownMenu(dialog1, 4, 16);
SetFirstLayoutItem(dialog1, 4);
result := RunLayoutDialog(dialog1, Dialog_Handler);
END;
RUN(Example);

Python


Version

Availability: from VectorWorks 8.0. Deprecated from VW 15+.