From: Kevin A. <al...@se...> - 2007-01-05 23:57:58
|
On Jan 4, 2007, at 9:55 AM, Steffl, Joseph wrote: > While migrating from WxPython 2.6 to 2.8 noticed a difference between > the pythonCard dialog.multipleChoiceDialog. > > Using WxPython 2.6, the pythonCard multipleChoiceDialog would allow > multiple choices as well as quickly selecting all items by using > keyboard and Shift keys. The WxPython 2.6 dialog did not display a > checkbox next to each item either. > > Using WxPython 2.8, checkboxes are displayed next to each item and > there > was no way using the keyboard to select all the items in the > multipleChoiceDialog. Since there are a large number of selections > where at times I need to select all of them, the older way of > selection > (w/o checkboxes) is preferred. > > Any clue as to what changed or how I can get the 2.6 version behavior > back? > > Thanks. I haven't installed wxPython 2.8.x on any boxes so the following suggestions are untested but it should get you going in the right direction. The MultipleChoiceDialog is defined in wxPython, not wxWidgets, so it should be relatively simple to fix this for your code, though you may end up duplicating a lot of the underlying wxPython code and need to add an if/then block to use the old code if running wxPython 2.6.x or earlier. PythonCard defines an alias to the wxPython dialog in PythonCard/ dialog.py with the following bits of code: import wx from wx.lib import dialogs ... multipleChoiceDialog = dialogs.multipleChoiceDialog As you can see from the import above you want to look at the wx/lib/ dialogs.py file for the code that needs to be tweaked for wxPython 2.8. What you want to do is make your own multipleChoiceDialog and use that if wxPython version is 2.8 or higher. Something like: if wx.VERSION >= (2, 8): multipleChoiceDialog = # your definition here # in the rest of your code use multipleChoiceDialog instead of dialog.multipleChoiceDialog If in fact they replaced ListBox with CheckListBox, that seems like a bug to me since they shouldn't have kept the same id if the underlying functionality was going to change. But even so, the old ListBox should still be available, you just need to figure out the id/ name and substitute that for the CheckListBox where the wxPython makes use of it. ka |