VS:InsertImagePopupObjectItem: Difference between revisions
m (1 revision) |
m (1 revision) |
(No difference)
|
Latest revision as of 14:34, 12 August 2013
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Inserts the specified object into the image popup.
Note: the image popup only supports the following object types: gradients, hatches, images, record formats, render backgrounds, symbol folders, symbols, textures, vectorscript palettes, vectorscripts, worksheets.
FUNCTION InsertImagePopupObjectItem(
dialogID :LONGINT;
componentID :LONGINT;
objectName :STRING) : INTEGER;
def vs.InsertImagePopupObjectItem(dialogID, componentID, objectName): return INTEGER
Parameters
dialogID LONGINT Index to the dialog layout that contains the image popup component. componentID LONGINT Index to a specific image popup component. objectName STRING Name of the object to insert.
Return Value
Returns an image popup index to the object inserted.
Remarks
Functionality description needs more.
Inserts the specified object into the image popup.
The object specified by ObjectName must be the name of a previewable object. Passing it the name of an object in the document does not work. Symbol Definitions, Gradients, Hatches, Image Resources, Textures, and RedSymbols(?) are valid things to pass to this function. The return value is the index to the item in the pop-up. This index value can change as items are added and removed from the list and should not be counted on to be a good reference to a particular resource.
Items are inserted and maintained in alphabetic order this may cause items to be inserted into the existing list, changing the indices of previous items.
If an Item fails to be inserted in the popup the function returns zero as the pop-up index value.
Example
VectorScript
PROCEDURE dialog1_Main; VAR dialog1 :INTEGER; int :INTEGER; str :STRING; PROCEDURE dialog1_Handler(VAR item :LONGINT; data :LONGINT); BEGIN CASE item OF SetupDialogC: BEGIN str := GetSDName(FSymDef); int := InsertImagePopupObjectItem(dialog1, 4, str); SetImagePopupSelectedItem(dialog1, 4, int); END; END; END; BEGIN dialog1 := CreateLayout('Image Pop-Up', FALSE, 'OK', ''); CreateControl(dialog1, 4, 10, '', 0); SetFirstLayoutItem(dialog1, 4); int := RunLayoutDialog(dialog1, dialog1_Handler); END; RUN(dialog1_Main);
Python
Version
Availability: from VectorWorks10.0
See Also
VS Functions:
VS:GetNumImagePopupItems | VS:GetImagePopupObject | VS:GetImagePopupObjectItemIndex | VS:SetImagePopupSelectedItem | VS:GetImagePopupSelectedItem | VS:RemoveImagePopupItem | VS:RemoveAllImagePopupItems
[[VS:GetNumImagePopupItems]] | [[VS:GetImagePopupObject]] | [[VS:GetImagePopupObjectItemIndex]] | [[VS:SetImagePopupSelectedItem]] | [[VS:GetImagePopupSelectedItem]] | [[VS:RemoveImagePopupItem]]
| [[VS:RemoveAllImagePopupItems]]