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 |
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): |