Difference between revisions of "VS:InsertImagePopupResource"
From Vectorworks Developer
m (1 revision) |
|||
Line 6: | Line 6: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<desc> | <desc> | ||
− | Inserts the indicated item of the specified resource list into the indicated image popup and returns the image popup index of the inserted item.</desc> | + | Inserts the indicated item of the specified resource list into the indicated image popup and returns the image popup index of the inserted item. |
+ | [MaKro] Inserts at end of popup list (appends). Index is 1-based and only for resource list. | ||
+ | </desc> | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
Line 55: | Line 57: | ||
==== Python ==== | ==== Python ==== | ||
<code lang="py"> | <code lang="py"> | ||
− | + | for idx in range(cnt_reslist): | |
+ | # append image to popup, 1-based index in resource list | ||
+ | vs.InsertImagePopupResource(id_dlg, id_popup, id_reslist, idx + 1) | ||
</code> | </code> | ||
</sample> | </sample> |
Revision as of 04:38, 7 October 2019
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Inserts the indicated item of the specified resource list into the indicated image popup and returns the image popup index of the inserted item.[MaKro] Inserts at end of popup list (appends). Index is 1-based and only for resource list.
FUNCTION InsertImagePopupResource(
dialogID :LONGINT;
componentID :LONGINT;
listID :LONGINT;
index :LONGINT) : LONGINT;
def vs.InsertImagePopupResource(dialogID, componentID, listID, index): return LONGINT
Parameters
dialogID LONGINT index to the dialog layout that contains the image popup component. componentID LONGINT index to a specific image popup component. listID LONGINT an ID for a resource list created by the BuildResourceList function. index LONGINT an index into the list.
Example
VectorScript
{ Add all items in the resource list to the image popup. } FOR index:=1 TO numItems DO index := InsertImagePopupResource(dialogID, kImagePopupID, listID, index);
Python
for idx in range(cnt_reslist): # append image to popup, 1-based index in resource list vs.InsertImagePopupResource(id_dlg, id_popup, id_reslist, idx + 1)