controls/CustomTable.py
changeset 1878 fb73a6b6622d
parent 1847 6198190bc121
child 1881 091005ec69c4
equal deleted inserted replaced
1877:da5f1fa46f2b 1878:fb73a6b6622d
    86         update the grid if rows and columns have been added or deleted
    86         update the grid if rows and columns have been added or deleted
    87         """
    87         """
    88         grid.CloseEditControl()
    88         grid.CloseEditControl()
    89         grid.BeginBatch()
    89         grid.BeginBatch()
    90         for current, new, delmsg, addmsg in [
    90         for current, new, delmsg, addmsg in [
    91             (self._rows, self.GetNumberRows(), wx.grid.GRIDTABLE_NOTIFY_ROWS_DELETED, wx.grid.GRIDTABLE_NOTIFY_ROWS_APPENDED),
    91                 (
    92             (self._cols, self.GetNumberCols(), wx.grid.GRIDTABLE_NOTIFY_COLS_DELETED, wx.grid.GRIDTABLE_NOTIFY_COLS_APPENDED),
    92                     self._rows,
       
    93                     self.GetNumberRows(),
       
    94                     wx.grid.GRIDTABLE_NOTIFY_ROWS_DELETED,
       
    95                     wx.grid.GRIDTABLE_NOTIFY_ROWS_APPENDED
       
    96                 ),
       
    97                 (
       
    98                     self._cols,
       
    99                     self.GetNumberCols(),
       
   100                     wx.grid.GRIDTABLE_NOTIFY_COLS_DELETED,
       
   101                     wx.grid.GRIDTABLE_NOTIFY_COLS_APPENDED
       
   102                 ),
    93         ]:
   103         ]:
    94             if new < current:
   104             if new < current:
    95                 msg = wx.grid.GridTableMessage(self, delmsg, new, current-new)
   105                 msg = wx.grid.GridTableMessage(self, delmsg, new, current-new)
    96                 grid.ProcessTableMessage(msg)
   106                 grid.ProcessTableMessage(msg)
    97             elif new > current:
   107             elif new > current: