I have a list of choices in a wxChoice and want to allow the user to edit or remove choices by right clicking on them. But I don’t see any method for that (wx.EVT_CHOICE catches a left click on items).
Is there any way to do this? (maybe this is obvious, but I’ve had 2+ weeks away from “wxWorld” and am rusty).
I don't think that the native widget provides any way to catch that event, at least not on some platforms.
···
On 9/2/12 8:36 AM, C M wrote:
I have a list of choices in a wxChoice and want to allow the user to
edit or remove choices by right clicking on them. But I don't see any
method for that (wx.EVT_CHOICE catches a left click on items).
Is there any way to do this? (maybe this is obvious, but I've had 2+
weeks away from "wxWorld" and am rusty).
OK, good to know. Then for the best user experience, what could anyone suggest for a way to remove or edit choices? Go to a non-native control? (suggestion?) Or access these choices through some other means?
No, I haven’t tried them yet. I don’t see any event that one could catch for ComboBox, so that’s probably just as out as wxChoice. Yes, I guess you can do anything with ComboCtrl, but I was hoping I wouldn’t have to do the work to make a custom control (and also therefore go non-native) for just a right click–I guess I have to, though.
I may just add a button to allow the current selection in the wxChoice to be edited or removed via a dialog; not as elegant a UI, but not too bad and possibly easier.
I’m surprised the platforms don’t have this functionality–you’d think it would be an obvious benefit to a list of items to have more than one way to interact with a list item.
Thanks,
Che
···
On Tue, Sep 4, 2012 at 11:33 AM, Mike Driscoll kyosohma@gmail.com wrote:
Hi Che,
Did you try the wx.ComboBox or the custom ComboCtrl? I would think the latter at least would provide this or be able to be patched.
On Tuesday, September 4, 2012 1:13:01 PM UTC-5, Che M wrote:
Hi Mike,
No, I haven’t tried them yet. I don’t see any event that one could catch for ComboBox, so that’s probably just as out as wxChoice. Yes, I guess you can do anything with ComboCtrl, but I was hoping I wouldn’t have to do the work to make a custom control (and also therefore go non-native) for just a right click–I guess I have to, though.
I may just add a button to allow the current selection in the wxChoice to be edited or removed via a dialog; not as elegant a UI, but not too bad and possibly easier.
I’m surprised the platforms don’t have this functionality–you’d think it would be an obvious benefit to a list of items to have more than one way to interact with a list item.
Thanks,
Che
Yeah, you’d think so. Maybe Tim or Robin can shed some more light on the matter. However, I’m leaning towards the solutions you mentioned at the moment.
If you don't have to be able to edit the available choices in the same UI element that is used to select the choice, then using the ItemsPicker from an edit dialog or something might be a good choice. See the wx.lib.itemspicker module and corresponding sample in the demo.
···
On 9/3/12 6:36 PM, C M wrote:
On Mon, Sep 3, 2012 at 3:16 PM, Robin Dunn <robin@alldunn.com > <mailto:robin@alldunn.com>> wrote:
On 9/2/12 8:36 AM, C M wrote:
I have a list of choices in a wxChoice and want to allow the user to
edit or remove choices by right clicking on them. But I don't
see any
method for that (wx.EVT_CHOICE catches a left click on items).
Is there any way to do this? (maybe this is obvious, but I've
had 2+
weeks away from "wxWorld" and am rusty).
I don't think that the native widget provides any way to catch that
event, at least not on some platforms.
OK, good to know. Then for the best user experience, what could anyone
suggest for a way to remove or edit choices? Go to a non-native
control? (suggestion?) Or access these choices through some other means?