Dynamically populate combo box?


#1

I’m working on an interface that needs to have a variable number of items in a combo box. I can’t find any information on dynamically adding/removing items, only dynamically replacing text. As of 9.3, is the only option to design the combo box with as many items as I anticipate the program needing and ignoring the ones I don’t use, or is there a better way?


#2

Hi GHSP Test Lab! Welcome to the OptoForums.

You’re correct. More detail from one of our in-house experts:

…right now there is no way of dynamically adding / removing objects from comboboxes. Like all other controls in PAC Display, what you design in Configurator is what you get in Runtime. There might be some workarounds…

I like this idea:

…make a few bordlerless windows that each contain a different combobox. These windows could have the same coordinates but different visibilities depending on some variable state. Then only the “correct” combobox would appear, etc.

Hope that helps!

-OptoMary


#3

Hi OptoMary,

Thanks for the quick reply. We have a somewhat non-homogeneous environment here, so flexibility in the interface is a key concern. The combo box values will actually be mapped to a Modbus field I/O system, but not all of the platforms have the same configuration. The good news is that we have a finite selection of modules, so that would simplify the borderless window strategy.