def OnSubindexGridCellLeftClick(self, event):
if not self.ParentWindow.ModeSolo:
col = event.GetCol()
- if not self.Editable and col == 0:
+ if self.Editable and col == 0:
+ selected = self.IndexList.GetSelection()
+ if selected != wx.NOT_FOUND:
+ index = self.ListIndex[selected]
+ subindex = event.GetRow()
+ entry_infos = self.Manager.GetEntryInfos(index)
+ if not entry_infos["struct"] & OD_MultipleSubindexes or subindex != 0:
+ subentry_infos = self.Manager.GetSubentryInfos(index, subindex)
+ typeinfos = self.Manager.GetEntryInfos(subentry_infos["type"])
+ if typeinfos:
+ bus_id = '.'.join(map(str, self.ParentWindow.GetBusId()))
+ size = typeinfos["size"]
+ data = wx.TextDataObject(str(("%s%s.%d.%d"%(SizeConversion[size], bus_id, index, subindex), "location")))
+ dragSource = wx.DropSource(self.SubindexGrid)
+ dragSource.SetData(data)
+ dragSource.DoDragDrop()
+ elif col == 0:
selected = self.IndexList.GetSelection()
if selected != wx.NOT_FOUND:
index = self.ListIndex[selected]
event.Skip()
def OnPartListBoxClick(self, event):
- self.SubindexGrid.SetGridCursor(0, 0)
- self.RefreshIndexList()
+ if not self.ParentWindow.IsClosing():
+ self.SubindexGrid.SetGridCursor(0, 0)
+ self.RefreshIndexList()
event.Skip()
def OnIndexListClick(self, event):
- self.SubindexGrid.SetGridCursor(0, 0)
- self.RefreshTable()
+ if not self.ParentWindow.IsClosing():
+ self.SubindexGrid.SetGridCursor(0, 0)
+ self.RefreshTable()
event.Skip()
def OnSubindexGridSelectCell(self, event):
- wx.CallAfter(self.ParentWindow.RefreshStatusBar)
+ if not self.ParentWindow.IsClosing():
+ wx.CallAfter(self.ParentWindow.RefreshStatusBar)
event.Skip()
#-------------------------------------------------------------------------------