AlHanson Posted April 26, 2021 Share Posted April 26, 2021 Struggling with making an OIP Popup object functional- the goal is to just have a text based popup with the a list of symbols from an external resource. I've gotten the popup widget inserted into the OIP, and I've successfully populated it with the names of the symbols from the library file and I have it linked to an existing parameter. However after this I'm not having any luck. The popup is there, defaulting to blank data. If I click on it, it'll pop open and show me the list of symbols but from here clicking on anything doesn't actually set the field and the popup just returns to an empty field. I'm monitoring the events and there doesn't seem to be anything of note happening on selection with kObjOnInitXProperties kParametricRecalculate and kObjOnWidgetPrep cycling as usual after modifying a parameter. What am I missing here? Quote Link to comment
Pat Stanford Posted April 26, 2021 Share Posted April 26, 2021 I think you will have to manually create a resource list and use that to populate your popup. See the BuildResourceList (and the other 3 or 4 similar options) in the Vectorscirpt Function Reference. Quote Link to comment
AlHanson Posted April 26, 2021 Author Share Posted April 26, 2021 Thanks Pat- that's already the approach I'm using here to build the list. I'm presumably doing this stage correctly as it's getting all the correct data but perhaps this also part of my problem if I'm doing something odd at this stage. Here's a bit more info to clarify: I'm using vs.BuildResourceListN on the Lighting Stands library file and getting all the names added correctly with vs.GetNameFromResourceList and vs.vsoWidgetPopupAdd. In the event script I'm inserting the Widget and this works correctly. if theEvent == kObjOnInitXProperties: #Mostly lifted from _c_'s event example ok = vs.SetObjPropVS(kObjXPropHasUIOverride, True) ok = vs.SetObjPropCharVS(kWidgetGroupMode, vs.Chr(kWidgetGroupAutomatic)) #removed other unrelated inserts to keep this clean and clear ok = vs.vsoInsertWidget(cP___div2 - 1, kWidgetSeparator, cP___div2, O_GetLocParmName(vs.GetName(pioRecordHandle), '__div2'), 0) ok = vs.vsoInsertWidget(symbolContainer-1, kFieldPopUp, symbolContainer, O_GetLocParmName(vs.GetName(pioRecordHandle), '__SymbolList'), 0) Parameters are set in the Plug in Manager. Widgets are linked correctly in the OIP, but the Symbols popup is blank by default. Clicking the popup will show everything that was added to it, but selecting anything from the list will just return the popup to the blank state as seen above. Quote Link to comment
Mike Rock Posted February 16 Share Posted February 16 On 4/26/2021 at 1:25 PM, AlHanson said: Clicking the popup will show everything that was added to it, but selecting anything from the list will just return the popup to the blank state as seen above. Were you able to solve this issue? I'm having the same problem with the Popup being blank after selecting an entry. I've included "result := SetObjPropVS(53, TRUE);" in the case for kObjOnInitXProperties: Quote Link to comment
AlHanson Posted February 17 Author Share Posted February 17 Kinda? I never had any luck getting this particular approach of inserting a popup into the OIP to work, but eventually found no reason to approach it in this manner. The easier approach I've been using which I've never had any issues with is just creating a popup field parameter via the plug in editor and then just populating it using the vs.vsoWidgetPopupAdd. Unless there's some reason to not approach it that way, that's my recommendation. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.