447 return None |
447 return None |
448 |
448 |
449 def OnSubindexGridCellLeftClick(self, event): |
449 def OnSubindexGridCellLeftClick(self, event): |
450 if not self.ParentWindow.ModeSolo: |
450 if not self.ParentWindow.ModeSolo: |
451 col = event.GetCol() |
451 col = event.GetCol() |
452 if not self.Editable and col == 0: |
452 if self.Editable and col == 0: |
|
453 selected = self.IndexList.GetSelection() |
|
454 if selected != wx.NOT_FOUND: |
|
455 index = self.ListIndex[selected] |
|
456 subindex = event.GetRow() |
|
457 entry_infos = self.Manager.GetEntryInfos(index) |
|
458 if not entry_infos["struct"] & OD_MultipleSubindexes or subindex != 0: |
|
459 subentry_infos = self.Manager.GetSubentryInfos(index, subindex) |
|
460 typeinfos = self.Manager.GetEntryInfos(subentry_infos["type"]) |
|
461 if typeinfos: |
|
462 bus_id = '.'.join(map(str, self.ParentWindow.GetBusId())) |
|
463 size = typeinfos["size"] |
|
464 data = wx.TextDataObject(str(("%s%s.%d.%d"%(SizeConversion[size], bus_id, index, subindex), "location"))) |
|
465 dragSource = wx.DropSource(self.SubindexGrid) |
|
466 dragSource.SetData(data) |
|
467 dragSource.DoDragDrop() |
|
468 elif col == 0: |
453 selected = self.IndexList.GetSelection() |
469 selected = self.IndexList.GetSelection() |
454 if selected != wx.NOT_FOUND: |
470 if selected != wx.NOT_FOUND: |
455 index = self.ListIndex[selected] |
471 index = self.ListIndex[selected] |
456 subindex = event.GetRow() |
472 subindex = event.GetRow() |
457 entry_infos = self.Manager.GetEntryInfos(index) |
473 entry_infos = self.Manager.GetEntryInfos(index) |