VS:vsoAppendWidget: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
mNo edit summary
(fix old link to vectorlab)
 
Line 26: Line 26:
</code>
</code>


See the [http://www.vectorlab.info/index.php?title=Events VectorLab article] on object events.
See [[VS:Object Events]].
</desc>
</desc>



Latest revision as of 17:52, 13 May 2021

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

Description

Adds a parameter to the Object info palette.

WidgetTypes:

	kFieldLongInt     = 1;
	kFieldBoolean     = 2;
	kFieldReal        = 3;
	kFieldText        = 4;
	kFieldCalculation = 5;
	kFieldHandle      = 6;
	kFieldCoordDisp   = 7; {dimension}
	kFieldPopUp       = 8;
	kFieldRadio       = 9;
	kFieldCoordLocX   = 10;	
	kFieldCoordLocY   = 11;

	kWidgetButton     = 12;
	kWidgetStaticText = 13;
	kWidgetDisclosure = 14; {not implemented?}

See VS:Object Events.

FUNCTION vsoAppendWidget(
widgetType :LONGINT;
mappingID :LONGINT;
text :STRING;
data :LONGINT) :BOOLEAN;
def vs.vsoAppendWidget(widgetType, mappingID, text, data):
    return BOOLEAN

Parameters

widgetType LONGINT
mappingID LONGINT
text STRING
data LONGINT

Remarks

This call should be used when a widget is to be added that does not have a corresponding parameter in the object's parameter list (i.e., buttons or static text).

mappingID: a unique number which will be supplied to GetEventInfo to identify which button was pressed.

text: the widget label. data: not implemented at this time.

Example

VectorScript

kOnInitPropertiesEventID: 
BEGIN
   resultStatus := SetObjPropVS(kObjectHasUIOverrideID, TRUE);
   resultStatus := vsoAppendParamWidget(1, 'Unused number', 0);
   resultStatus := vsoAppendParamWidget(2, 'Static Text Widget', 0);
   resultStatus := vsoAppendParamWidget(3, 'Enter junk here', 0);
   resultStatus := vsoAppendParamWidget(4, 'Previous static text', 0);
   resultStatus := vsoAppendWidget(kWidgetButton, 1,'Update Text', 0);
END;

Python


Version

Availability: from All Versions

This is drop-in function.