14 Replies Latest reply on Aug 22, 2010 10:52 PM by areohbee

    Bug: Combo boxes completely broken?

    johnrellis Most Valuable Participant

      It appears that combo boxes don't work at all, ignoring any input the user types:

       

      local LrDialogs = import 'LrDialogs'
      local LrView = import 'LrView'
      local f = LrView.osFactory()

      local combo = f:combo_box {value = 1, items = {1, 2, 3}}
      LrDialogs.presentModalDialog {title = "Test", contents = combo}
      LrDialogs.message (combo.value)

       

      Am I missing something obvious?  I tried the example in the SDK Guide on page 101, and that doesn't seem to work either. This would explain why validation of combo boxes doesn't work:

       

      http://forums.adobe.com/thread/673170?tstart=0

        • 1. Re: Bug: Combo boxes completely broken?
          areohbee Level 5

          I'm not having any such problems. Probably you need to bind the value to a property instead of specifying a fixed value.

          • 2. Re: Bug: Combo boxes completely broken?
            johnrellis Most Valuable Participant
            Probably you need to bind the value to a property instead of specifying a fixed value.


            Hmm, here's a version binding to a property, and it still doesnt work:

             

            local LrBinding = import 'LrBinding'
            local LrDialogs = import 'LrDialogs'
            local LrFunctionContext = import 'LrFunctionContext'
            local LrView = import 'LrView'
            local f = LrView.osFactory()

            LrFunctionContext.callWithContext ("test", function (context)
                local prop = LrBinding.makePropertyTable (context)
                LrDialogs.presentModalDialog {title = "Test",
                    contents = f:combo_box {bind_to_object = prop,
                        value = LrView.bind ("value"), items = {"1", "2", "3"}}}
                LrDialogs.message (prop.value)
                end)

             

            When you select an item from the menu, that gets displayed in the message dialog, but any value you type in isn't.

             

            I'm not having any such problems.

            I wonder what's different.  Does the code above work on your machine?  Which platform?  I'm on Windows 7 32-bit. Note that the example on page 101 of the SDK Guide doesn't work for me either.

             

            Does one of your published plugins use combo boxes within presentModalDialog ()?  If so, I could download it and see if it works properly on my config.

            • 3. Re: Bug: Combo boxes completely broken?
              areohbee Level 5

              John,

               

              That code works fine for me: win7/64 - I can enter a value of "4" and it will be displayed after clicking OK.

               

              DevAdjust has combo boxes if you want to try it.

               

              Rob

              • 4. Re: Bug: Combo boxes completely broken?
                johnrellis Most Valuable Participant

                Hmm, the combo boxes in DevAdjust don't work on my config.  Here's what I did:

                 

                1. File > Plug-in Extras > DevAdjust

                2. Adjustments | New Presets | Combos

                3. In the first combo box, type "Tone Curve - Darks", enter 5.00 as the value

                4. Save As Preset, use the filename "Test1"

                5. Examine the contents of Test1.lua -- it's empty.

                6. Repeat, but instead of typing, use the drop-down to select "Tone Curve - Darks".

                7. The contents of Test1.lua are no longer empty.

                 

                I'm stuck.  I wonder if this is specific to my config or to Windows 7 32-bit?

                 

                Anyone else with Windows 7 32-bit who could run the simple test code above?

                • 5. Re: Bug: Combo boxes completely broken?
                  areohbee Level 5

                  Chet? - You still with us Mr. Drarvik? - Any body else havin' problems with combo boxes on win7/32 ?

                  • 6. Re: Bug: Combo boxes completely broken?
                    areohbee Level 5

                    Combo boxes no longer working for me! - I have the same problem as you now John (selected values are fine but text entries are not being committed to the property value). Only thing I can think of thats changed for me is Lr3.0 -> Lr3.2RC, but all of my plugins that use combo-boxes are broken!

                     

                    Adobe - please fix this ASAP, eh?

                     

                    John - I'm going to go submit this via "the form" too - how you coming with it?

                     

                    Rob

                    • 7. Re: Bug: Combo boxes completely broken?
                      johnrellis Most Valuable Participant

                      I've just had to design without them.

                      • 8. Re: Bug: Combo boxes completely broken?
                        areohbee Level 5

                        Is there not some way to force commit using a technique similar to the one you showed me/us for hiding the default button in a modal dialog box? i.e. shuffling through the bits and pieces tied to the combo_box control to find the text that's not being commited, and then "latching" on to it?

                         

                        Rob

                        • 9. Re: Bug: Combo boxes completely broken?
                          johnrellis Most Valuable Participant
                          Is there not some way to force commit using a technique similar to the one you showed me/us for hiding the default button in a modal dialog box? i.e. shuffling through the bits and pieces tied to the combo_box control to find the text that's not being commited, and then "latching" on to it?

                          My guess is that would be a lot harder than my hack of setting the enabled property of the OK button.  By dumping out the entire structure of a control, it was relatively easy to find the OK button and set a property, but I'm not sure what might be involved in trying to fix the combo-box bug.

                          • 10. Re: Bug: Combo boxes completely broken?
                            areohbee Level 5

                            John,

                             

                            I gave it a whack, but came up short.

                             

                            I tried dumping everything and then looking for the entered value but its not in there. My guess is that there is some kind of missing link between the control and Lightroom such that by the time the dialog box is dismissed the value has already been discarded.

                             

                            So did you code a combo-box emulation or do you just do without combo boxes altogether?

                             

                            Weird it was working for me, and then not. And, nobody else has chimed in on this thread either - does that mean its working for everybody else?, or that it isn't?, nobody uses the text-field aspect of combo-boxs?... I haven't had any of my plugin users complain, but I'm not sure what to make of that.

                             

                            Blah, blah, blah,

                            Rob

                            • 11. Re: Bug: Combo boxes completely broken?
                              areohbee Level 5

                              John,

                               

                              Two things:

                               

                              1. I implemented a make-shift combo-box emulation thingy if you're interested.

                              2. I discovered that if you hit the tab key until the combo box comes back into focus, the value will be committed as it should. Not that we could expect our users to do that - but it may be a clue.

                               

                              Chet Drarvik

                              Chet Drarvik

                              Chet Drarvik

                              Chet Drarvik

                              Chet Drarvik

                              Chet Drarvik

                              Chet Drarvik

                              Chet Drarvik

                               

                              - Are we going to have to work-around this bug after Lr3.2 final is released too? - Or can we count on a fix??

                               

                              Rob

                              • 12. Re: Bug: Combo boxes completely broken?
                                areohbee Level 5

                                I hereby request everyone who reads this to try this test plugin and report results.

                                 

                                http://www.robcole.com/_temp/ComboBoxBugTest_LrPlugin.zip

                                 

                                I would really like to know how widespread is the problem.

                                 

                                John had it since day 1, I didn't and now I do...

                                 

                                Anybody else?

                                 

                                Rob

                                • 13. Re: Bug: Combo boxes completely broken?
                                  johnrellis Most Valuable Participant

                                  Since I first encountered the bug, I moved from Windows 7 32-bit to Windows 7 64-bit (on a brand-new computer), and the bug still occurs.  Your handy test fails.

                                  • 14. Re: Bug: Combo boxes completely broken?
                                    areohbee Level 5

                                    Jeffrey Friedl is going to deliver that test plugin directly to contacts he has at Adobe (I don't have any such contacts, but I am acquainted with Jeffrey and I sent him the test plugin). So, if they don't do anything it won't be because they didn't know about the problem...