Reputation: 1386
I am creating a wx.ListCtrl
(wxPython 2.8.11.0, Python 2.7) with style=wx.LC_REPORT|wx.LC_VRULES|wx.LC_SINGLE_SEL
containing a score column (amongst others). Is it possible to make the score for each item (in order of preference):
a drop down list of possible scores
allow for typing into that column only (I am aware of, though have never used, wx.lib.mixins.listctrl.TextEditMixin)?
EDIT: This needs to be a cross-platform solution.
Upvotes: 2
Views: 2692
Reputation: 33111
You can override the OnBeginEdit and check which column has been clicked in using event.m_col and act accordingly (i.e. event.Veto() or not). I don't think you can do a drop down in the cell itself, but you could create a simple dialog that does the same thing when the user clicks on that column. Or you might want to look at the UltimateListCtrl, a pure Python implementation of the ListCtrl that can do just about anything you want.
Upvotes: 4