RessourceEditor.py
changeset 672 d751b1c609b3
parent 658 89d20745b061
child 684 f10449b18dbe
equal deleted inserted replaced
671:47b9ad1471cc 672:d751b1c609b3
   404                 self.RefreshView()
   404                 self.RefreshView()
   405             return new_row
   405             return new_row
   406         setattr(self.InstancesGrid, "_MoveRow", _MoveInstance)
   406         setattr(self.InstancesGrid, "_MoveRow", _MoveInstance)
   407         
   407         
   408         def _RefreshInstanceButtons():
   408         def _RefreshInstanceButtons():
   409             rows = self.InstancesTable.GetNumberRows()
   409             if self:
   410             row = self.InstancesGrid.GetGridCursorRow()
   410                 rows = self.InstancesTable.GetNumberRows()
   411             self.DeleteInstanceButton.Enable(rows > 0)
   411                 row = self.InstancesGrid.GetGridCursorRow()
   412             self.UpInstanceButton.Enable(row > 0 and 
   412                 self.DeleteInstanceButton.Enable(rows > 0)
   413                 self.InstancesTable.GetValueByName(row, "Task") == self.InstancesTable.GetValueByName(row - 1, "Task"))
   413                 self.UpInstanceButton.Enable(row > 0 and 
   414             self.DownInstanceButton.Enable(0 <= row < rows - 1 and 
   414                     self.InstancesTable.GetValueByName(row, "Task") == self.InstancesTable.GetValueByName(row - 1, "Task"))
   415                 self.InstancesTable.GetValueByName(row, "Task") == self.InstancesTable.GetValueByName(row + 1, "Task"))
   415                 self.DownInstanceButton.Enable(0 <= row < rows - 1 and 
       
   416                     self.InstancesTable.GetValueByName(row, "Task") == self.InstancesTable.GetValueByName(row + 1, "Task"))
   416         setattr(self.InstancesGrid, "RefreshButtons", _RefreshInstanceButtons)
   417         setattr(self.InstancesGrid, "RefreshButtons", _RefreshInstanceButtons)
   417         
   418         
   418         self.InstancesGrid.SetRowLabelSize(0)
   419         self.InstancesGrid.SetRowLabelSize(0)
   419         self.InstancesTable.ResetView(self.InstancesGrid)
   420         self.InstancesTable.ResetView(self.InstancesGrid)
   420         self.InstancesGrid.RefreshButtons()
   421         self.InstancesGrid.RefreshButtons()