X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3115ef3e56082b961af85a06955b50ddf0c5738a..830efc9b0cb87eae22d4435af7858175017522ab:/wxPython/demo/wxListCtrl.py diff --git a/wxPython/demo/wxListCtrl.py b/wxPython/demo/wxListCtrl.py index 9c23d2e674..d1b9cf245f 100644 --- a/wxPython/demo/wxListCtrl.py +++ b/wxPython/demo/wxListCtrl.py @@ -105,7 +105,7 @@ class TestListCtrlPanel(wxPanel, wxColumnSorterMixin): self.list.SetImageList(self.il, wxIMAGE_LIST_SMALL) # Why doesn't this show up on MSW??? - self.list.SetToolTip(wxToolTip("This is a ToolTip!")) + #self.list.SetToolTip(wxToolTip("This is a ToolTip!")) if 0: # for normal, simple columns, you can add them like this: @@ -163,6 +163,7 @@ class TestListCtrlPanel(wxPanel, wxColumnSorterMixin): self.currentItem = 0 EVT_SIZE(self, self.OnSize) EVT_LIST_ITEM_SELECTED(self, tID, self.OnItemSelected) + EVT_LIST_ITEM_DESELECTED(self, tID, self.OnItemDeselected) EVT_LIST_ITEM_ACTIVATED(self, tID, self.OnItemActivated) EVT_LIST_DELETE_ITEM(self, tID, self.OnItemDelete) EVT_LIST_COL_CLICK(self, tID, self.OnColClick) @@ -217,6 +218,13 @@ class TestListCtrlPanel(wxPanel, wxColumnSorterMixin): # this does self.list.SetItemState(10, 0, wxLIST_STATE_SELECTED) + # Show how to reselect something we don't want deselected + def OnItemDeselected(self, evt): + item = evt.GetItem() + if evt.m_itemIndex == 11: + wxCallAfter(self.list.SetItemState, 11, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED) + + def OnItemActivated(self, event): self.currentItem = event.m_itemIndex self.log.WriteText("OnItemActivated: %s\n" % self.list.GetItemText(self.currentItem)) @@ -280,6 +288,8 @@ class TestListCtrlPanel(wxPanel, wxColumnSorterMixin): def OnPopupOne(self, event): self.log.WriteText("Popup one\n") + print "FindItem:", self.list.FindItem(-1, "Roxette") + print "FindItemData:", self.list.FindItemData(-1, 11) def OnPopupTwo(self, event): self.log.WriteText("Popup two\n")