objdictgen/subindextable.py
changeset 243 7fcc129a06ce
parent 242 4864f7f01e1d
child 254 f2b0acb54e65
equal deleted inserted replaced
242:4864f7f01e1d 243:7fcc129a06ce
   500         wxCallAfter(self.BeginDrag)
   500         wxCallAfter(self.BeginDrag)
   501         wxCallAfter(self.Parent.RefreshStatusBar)
   501         wxCallAfter(self.Parent.RefreshStatusBar)
   502         event.Skip()
   502         event.Skip()
   503 
   503 
   504     def BeginDrag(self):
   504     def BeginDrag(self):
   505         row = self.SubindexGrid.GetGridCursorRow()
   505         if not self.Parent.ModeSolo:
   506         col = self.SubindexGrid.GetGridCursorCol()
   506             row = self.SubindexGrid.GetGridCursorRow()
   507         if not self.Editable and col == 0:
   507             col = self.SubindexGrid.GetGridCursorCol()
   508             selected = self.IndexList.GetSelection()
   508             if not self.Editable and col == 0:
   509             if selected != wxNOT_FOUND:
   509                 selected = self.IndexList.GetSelection()
   510                 index = self.ListIndex[selected]
   510                 if selected != wxNOT_FOUND:
   511                 subindex = self.SubindexGrid.GetGridCursorRow()
   511                     index = self.ListIndex[selected]
   512                 entry_infos = self.Manager.GetEntryInfos(index)
   512                     subindex = self.SubindexGrid.GetGridCursorRow()
   513                 if not entry_infos["struct"] & OD_MultipleSubindexes or row != 0:
   513                     entry_infos = self.Manager.GetEntryInfos(index)
   514                     subentry_infos = self.Manager.GetSubentryInfos(index, subindex)
   514                     if not entry_infos["struct"] & OD_MultipleSubindexes or row != 0:
   515                     typeinfos = self.Manager.GetEntryInfos(subentry_infos["type"])
   515                         subentry_infos = self.Manager.GetSubentryInfos(index, subindex)
   516                     if subentry_infos["pdo"] and typeinfos:
   516                         typeinfos = self.Manager.GetEntryInfos(subentry_infos["type"])
   517                         bus_id = self.Parent.GetBusId()
   517                         if subentry_infos["pdo"] and typeinfos:
   518                         node_id = self.Parent.GetCurrentNodeId()
   518                             bus_id = self.Parent.GetBusId()
   519                         size = typeinfos["size"]
   519                             node_id = self.Parent.GetCurrentNodeId()
   520                         data = wxTextDataObject(str(("%s%d.%d.%d.%d"%(SizeConversion[size], bus_id, node_id, index, subindex), "location")))
   520                             size = typeinfos["size"]
   521                         dragSource = wxDropSource(self.SubindexGrid)
   521                             data = wxTextDataObject(str(("%s%d.%d.%d.%d"%(SizeConversion[size], bus_id, node_id, index, subindex), "location")))
   522                         dragSource.SetData(data)
   522                             dragSource = wxDropSource(self.SubindexGrid)
   523                         dragSource.DoDragDrop()
   523                             dragSource.SetData(data)
       
   524                             dragSource.DoDragDrop()
   524 
   525 
   525 #-------------------------------------------------------------------------------
   526 #-------------------------------------------------------------------------------
   526 #                             Refresh Functions
   527 #                             Refresh Functions
   527 #-------------------------------------------------------------------------------
   528 #-------------------------------------------------------------------------------
   528 
   529