VS:CreateClassPullDownMenu: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
(add example for adding localized strings) |
||
Line 71: | Line 71: | ||
</code> | </code> | ||
</sample> | </sample> | ||
----------------------------------------------------------------------------------------------------------- | |||
<remark> | |||
([[User:Orso.b.schmid|Orso]] 2016.02.22): Add the localized string "<Object Class>" below "New...": | |||
<code lang="vs"> | |||
GetResourceString(objClassString, 2103, 148); { fetches the localized "<Object Class>" string } | |||
IF InsertPropClassOrLayerItem(dialogID, c_classPullDownMenu_Index, objClassString, '') THEN | |||
{ do something, eventually }; | |||
</code> | |||
</remark> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<seeAlso> | <seeAlso> | ||
VS Functions: | VS Functions: | ||
[[VS:CreateImageControl]] | [[VS:CreateImageControl]], | ||
[[VS:InsertPropClassOrLayerItem]] | |||
</seeAlso> | </seeAlso> | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<version> | <version> | ||
Availability: from | Availability: from VectorWorks 13.0 | ||
</version> | </version> |
Revision as of 07:12, 22 February 2016
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Creates a Layout Manager class pull down menu control.
PROCEDURE CreateClassPullDownMenu(
nDialogID :LONGINT;
nComponentID :LONGINT;
nWidthInChars :INTEGER);
def vs.CreateClassPullDownMenu(nDialogID, nComponentID, nWidthInChars): return None
Parameters
nDialogID LONGINT nComponentID LONGINT nWidthInChars INTEGER
Remarks
(Orso 2016.02.22): Add the localized string "<Object Class>" below "New...":
GetResourceString(objClassString, 2103, 148); { fetches the localized "<Object Class>" string } IF InsertPropClassOrLayerItem(dialogID, c_classPullDownMenu_Index, objClassString, '') THEN { do something, eventually };
Example
VectorScript
PROCEDURE Example; VAR dialog1 :INTEGER; result :INTEGER; PROCEDURE Dialog_Handler(VAR item :LONGINT; data :LONGINT); BEGIN END; BEGIN dialog1 := CreateLayout('Example Dialog', FALSE, 'OK', 'Cancel'); CreateClassPullDownMenu(dialog1, 4, 24); SetFirstLayoutItem(dialog1, 4); result := RunLayoutDialog(dialog1, Dialog_Handler); END; RUN(Example);
Python
def Dialog_Handler(item , data ): pass def Example(): dialog1 = vs.CreateLayout('Example Dialog', False, 'OK', 'Cancel') vs.CreateClassPullDownMenu(dialog1, 4, 24) vs.SetFirstLayoutItem(dialog1, 4) result = vs.RunLayoutDialog(dialog1, Dialog_Handler) Example()
Version
Availability: from VectorWorks 13.0
See Also
VS Functions:
VS:CreateImageControl, VS:InsertPropClassOrLayerItem
VS Functions:
[[VS:CreateImageControl]],
[[VS:InsertPropClassOrLayerItem]]