/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/tableview.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/tableview.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 808 by bh, Mon May 5 10:33:47 2003 UTC revision 838 by bh, Tue May 6 15:53:32 2003 UTC
# Line 38  class DataTable(wxPyGridTableBase): Line 38  class DataTable(wxPyGridTableBase):
38    
39      def SetTable(self, table):      def SetTable(self, table):
40          self.table = table          self.table = table
41          self.num_cols = table.field_count()          self.num_cols = table.NumColumns()
42          self.num_rows = table.record_count()          self.num_rows = table.NumRows()
43    
44          self.columns = []          self.columns = []
45          for i in range(self.num_cols):          for i in range(self.num_cols):
46              type, name, len, decc = table.field_info(i)              col = table.Column(i)
47              self.columns.append((name, wx_value_type_map[type], len, decc))              self.columns.append((col.name, wx_value_type_map[col.type]))
48    
49      #      #
50      # required methods for the wxPyGridTableBase interface      # required methods for the wxPyGridTableBase interface
# Line 64  class DataTable(wxPyGridTableBase): Line 64  class DataTable(wxPyGridTableBase):
64      # Renderer understands the type too,) not just strings as in the      # Renderer understands the type too,) not just strings as in the
65      # C++ version.      # C++ version.
66      def GetValue(self, row, col):      def GetValue(self, row, col):
67          record = self.table.read_record(row)          record = self.table.ReadRowAsDict(row)
68          return record[self.columns[col][0]]          return record[self.columns[col][0]]
69    
70      def SetValue(self, row, col, value):      def SetValue(self, row, col, value):

Legend:
Removed from v.808  
changed lines
  Added in v.838

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26