mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-08 21:10:06 +01:00
List event/item Phoenix Fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@74401 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -167,18 +167,18 @@ class TestListCtrlPanel(wx.Panel, listmix.ColumnSorterMixin):
|
||||
else:
|
||||
# but since we want images on the column header we have to do it the hard way:
|
||||
info = wx.ListItem()
|
||||
info.m_mask = wx.LIST_MASK_TEXT | wx.LIST_MASK_IMAGE | wx.LIST_MASK_FORMAT
|
||||
info.m_image = -1
|
||||
info.m_format = 0
|
||||
info.m_text = "Artist"
|
||||
info.Mask = wx.LIST_MASK_TEXT | wx.LIST_MASK_IMAGE | wx.LIST_MASK_FORMAT
|
||||
info.Image = -1
|
||||
info.Align = 0
|
||||
info.Text = "Artist"
|
||||
self.list.InsertColumnInfo(0, info)
|
||||
|
||||
info.m_format = wx.LIST_FORMAT_RIGHT
|
||||
info.m_text = "Title"
|
||||
info.Align = wx.LIST_FORMAT_RIGHT
|
||||
info.Text = "Title"
|
||||
self.list.InsertColumnInfo(1, info)
|
||||
|
||||
info.m_format = 0
|
||||
info.m_text = "Genre"
|
||||
info.Align = 0
|
||||
info.Text = "Genre"
|
||||
self.list.InsertColumnInfo(2, info)
|
||||
|
||||
items = musicdata.items()
|
||||
|
||||
@@ -777,7 +777,7 @@ class UltimateListCtrlPanel(wx.Panel, listmix.ColumnSorterMixin):
|
||||
|
||||
|
||||
def OnItemSelected(self, event):
|
||||
self.currentItem = event.m_itemIndex
|
||||
self.currentItem = event.Index
|
||||
self.log.write("OnItemSelected: %s, %s, %s, %s\n" %(self.currentItem,
|
||||
self.list.GetItemText(self.currentItem),
|
||||
self.getColumnText(self.currentItem, 1),
|
||||
@@ -797,15 +797,15 @@ class UltimateListCtrlPanel(wx.Panel, listmix.ColumnSorterMixin):
|
||||
|
||||
def OnItemDeselected(self, evt):
|
||||
item = evt.GetItem()
|
||||
self.log.write("OnItemDeselected: %d\n" % evt.m_itemIndex)
|
||||
self.log.write("OnItemDeselected: %d\n" % evt.Index)
|
||||
|
||||
## # Show how to reselect something we don't want deselected
|
||||
## if evt.m_itemIndex == 11:
|
||||
## if evt.Index == 11:
|
||||
## wx.CallAfter(self.list.SetItemState, 11, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
|
||||
|
||||
|
||||
def OnItemActivated(self, event):
|
||||
self.currentItem = event.m_itemIndex
|
||||
self.currentItem = event.Index
|
||||
self.log.write("OnItemActivated: %s\nTopItem: %s\n" %(self.list.GetItemText(self.currentItem), self.list.GetTopItem()))
|
||||
|
||||
def OnBeginEdit(self, event):
|
||||
|
||||
@@ -82,14 +82,14 @@ class TestUltimateListCtrl(ULC.UltimateListCtrl):
|
||||
|
||||
def OnItemSelected(self, event):
|
||||
|
||||
self.currentItem = event.m_itemIndex
|
||||
self.currentItem = event.Index
|
||||
self.log.write("OnItemSelected: %s, %s, %s, %s\n" %(self.currentItem,
|
||||
self.GetItemText(self.currentItem),
|
||||
self.getColumnText(self.currentItem, 1),
|
||||
self.getColumnText(self.currentItem, 2)))
|
||||
|
||||
def OnItemActivated(self, event):
|
||||
self.currentItem = event.m_itemIndex
|
||||
self.currentItem = event.Index
|
||||
self.log.write("OnItemActivated: %s\nTopItem: %s\n" %(self.GetItemText(self.currentItem), self.GetTopItem()))
|
||||
|
||||
def getColumnText(self, index, col):
|
||||
@@ -98,7 +98,7 @@ class TestUltimateListCtrl(ULC.UltimateListCtrl):
|
||||
return item.GetText()
|
||||
|
||||
def OnItemDeselected(self, evt):
|
||||
self.log.write("OnItemDeselected: %s\n" % evt.m_itemIndex)
|
||||
self.log.write("OnItemDeselected: %s\n" % evt.Index)
|
||||
|
||||
|
||||
#---------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user