Skip to main content
Known Participant
October 17, 2013
Question

combo_boxes and how to use them

  • October 17, 2013
  • 1 reply
  • 1258 views

I'd like to be able to type a search term into a combo box and, with each typed character, i'd like to perform a SQLite query and get back results that influence what items appear in the popup menu part of the combo-box.  I've been able to do this with a popup_menu and a separate edit_field, but it takes up too much room in the user interface. ideally i'd like to be able to do it from a combo_box.  but there don't seem to be enough hooks into a combo_box to do this. take for example the value parameter.  while a variable bound to it will contain the text typed into the combo_box, it also contains the value of whatever item is pulled down in the popup menu.  this leads to confusion and none of my experiments have been able to get values typed into the combo_box to actually produce new SQLite queries on a character-by-character basis (yes, i tried adding immediate=true to the combo_box instance when i created it).

that said, i'm going to guess that (like everything else in the SDK), there are parameters i can set in a combo_box to deal with the text typed into it and the item selected by the popup separately. i just don't know what they are because they are not mentioned in the documentation for a combo_box.  or i'm wrong and what i am requesting is impossible.  but i thought i'd ask here first.

This topic has been closed for replies.

1 reply

areohbee
Legend
October 17, 2013

immediate = true,

Known Participant
October 17, 2013

I know about that, but it doesn't solve my problem. Is there a way to have separate functions fire for changes made to the text being typed into the text box vs. the selecting of items in the popup menu? I'd like changes made via typing to affect the items showing up in the popup menu as those changes are typed.

areohbee
Legend
October 17, 2013

victorvodka wrote:

I know about that, but it doesn't solve my problem.

Sorry.

victorvodka wrote:

I'd like changes made via typing to affect the items showing up in the popup menu as those changes are typed.

Yes (maybe) - bind "popup" items to member of property table, then change as user types.

I've never done it (bound items to "dynamic" property in table) with a combo_box, but such works for popup_menu.

UPDATE:

-----------

I decided to try this and I'm having problem, it seems combo_box validate function is broken (validate not getting called no matter what I do). Are you having better luck than me?

This is so weird - I thought validator functions worked for combo_box, but current testing suggests they do not (I tested Lr3 & Lr4 as well as Lr5). Validator functions work for edit_field just fine, but not combo_box, not on my win7 box anyway. Bug reported here:

http://feedback.photoshop.com/photoshop_family/topics/lightroom_sdk_combo_box_validate_function_not_called?rfm=1

-----------

Rob

Message was UPDATED by: Rob Cole