Deselect items by default if marketBrowser itemView is repopulated

This commit is contained in:
HomeWorld
2010-12-11 13:50:52 +02:00
parent 374f91eec9
commit b6602bf501
2 changed files with 7 additions and 13 deletions

View File

@@ -167,16 +167,13 @@ class Display(wx.ListCtrl):
return lastFound
def deselectItems(self):
sel = self.GetFirstSelected()
while sel != -1:
self.SetItemState(sel, 0, wx.LIST_STATE_SELECTED | wx.LIST_STATE_FOCUSED)
sel = self.GetNextSelected(sel)
def populate(self, stuff):
selection = []
# sel = self.GetFirstSelected()
# while sel != -1:
# selection.append(sel)
# sel = self.GetNextSelected(sel)
# self.DeleteAllItems()
if stuff is not None:
listItemCount = self.GetItemCount()
@@ -197,10 +194,6 @@ class Display(wx.ListCtrl):
self.Refresh()
# for sel in selection:
# self.Select(sel)
def refresh(self, stuff):
if stuff == None:
return

View File

@@ -332,6 +332,7 @@ class ItemView(d.Display):
return (item.metaGroup.parent.name, item.metaGroup.ID , item.name)
def populate(self, stuff):
self.deselectItems()
stuff.sort(key=self.itemSort)
self.active = stuff
d.Display.populate(self, stuff)