EditableListBox buttons

Thank you, that worked perfectly!

I can't seem to find a page which explains how to catch interactions with the EditableListBox.
E.g. when the user presses the delete button, I'd like it to delete the entry in the list I made it load.
Also the sorting isn't applied to the loaded list.. ListCtrl commands, like EVT_LIST_ITEM_SELECTED, don't seem to work..

Is there a page where I can find what commands to use with EditableListBox?

Thanks!

P.S. Sorry about the new email thing.. I forgot to remove your reply to the old question before sending my question.

Robin Dunn wrote:

···

When you start a new topic in this list please do it by creating a new email, not replying to an existing one with a different subject.

L. Fanchi wrote:

Hello,

I'm having problems disabling/removing the 'new' and 'edit' buttons of my EditableListBox.
Could someone explain how it works? This is what I have now:

/imageList = gizmos.EditableListBox(panel, -1, "Images", pos = (310,80), size = (250, 330))/

Pass a style parameter to the constructor using the flags for the buttons you want. By default it is all of these:

    wx.gizmos.EL_ALLOW_NEW,
    wx.gizmos.EL_ALLOW_EDIT
    wx.gizmos.EL_ALLOW_DELETE

I'm trying to get the sort and delete buttons to work, but I'm also having problems with those.
Here's what I did:

        imageList = gizmos.EditableListBox(panel, -1, "Images", pos = (300,80), size = (250, 330), style = wx.gizmos.EL_ALLOW_DELETE)
        imageList.SetStrings()
        imageList_w = imageList.GetListCtrl()
        imageList_delbutton = imageList.GetDelButton()
        imageList_delbutton.Enable(True)
        self.Bind(wx.EVT_BUTTON, self.OnDeleteItem, imageList_delbutton)
        wx.EVT_LIST_ITEM_SELECTED(imageList, imageList_w.GetId(), self.OnItemSelected)

The event for the selection of the item triggers the self.OnItemSelected, but the delete button, for some reason, doesn't trigger the self.OnDeleteItem at this point..

Any tips?

Thanks in advance!

Robin Dunn wrote:

···

L. Fanchi wrote:

Thank you, that worked perfectly!

I can't seem to find a page which explains how to catch interactions with the EditableListBox.
E.g. when the user presses the delete button, I'd like it to delete the entry in the list I made it load.
Also the sorting isn't applied to the loaded list.. ListCtrl commands, like EVT_LIST_ITEM_SELECTED, don't seem to work..

Is there a page where I can find what commands to use with EditableListBox?

You can get access to the internal listctrl using the GetListCtrl method. Using that you should be able to do anything you can do with any other listctrl.