92 |
wxPyGridTableBase.__init__(self) |
wxPyGridTableBase.__init__(self) |
93 |
self.num_cols = 1 |
self.num_cols = 1 |
94 |
self.num_rows = 0 |
self.num_rows = 0 |
|
self.columns = [] |
|
95 |
self.table = None |
self.table = None |
96 |
self.record_index = record |
self.record_index = record |
97 |
self.record = None |
self.record = None |
188 |
# default, doesn't necessarily have to be the same type used |
# default, doesn't necessarily have to be the same type used |
189 |
# nativly by the editor/renderer if they know how to convert. |
# nativly by the editor/renderer if they know how to convert. |
190 |
def GetTypeName(self, row, col): |
def GetTypeName(self, row, col): |
191 |
if row < self.num_rows: |
# for some reason row and col may be negative sometimes, but |
192 |
|
# it's probably a wx bug (filed as #593189 on sourceforge) |
193 |
|
if 0 <= row < self.num_rows: |
194 |
return self.rows[row][1] |
return self.rows[row][1] |
195 |
return wxGRID_VALUE_STRING |
return wxGRID_VALUE_STRING |
196 |
|
|
204 |
def CanSetValueAs(self, row, col, typeName): |
def CanSetValueAs(self, row, col, typeName): |
205 |
return self.CanGetValueAs(row, col, typeName) |
return self.CanGetValueAs(row, col, typeName) |
206 |
|
|
207 |
|
|
208 |
|
|
209 |
class RecordGridCtrl(wxGrid): |
class RecordGridCtrl(wxGrid): |
210 |
|
|
225 |
self.AutoSizeColumn(0, true) |
self.AutoSizeColumn(0, true) |
226 |
|
|
227 |
#self.SetSelectionMode(wxGrid.wxGridSelectRows) |
#self.SetSelectionMode(wxGrid.wxGridSelectRows) |
228 |
|
|
229 |
#EVT_GRID_RANGE_SELECT(self, self.OnRangeSelect) |
#EVT_GRID_RANGE_SELECT(self, self.OnRangeSelect) |
230 |
#EVT_GRID_SELECT_CELL(self, self.OnSelectCell) |
#EVT_GRID_SELECT_CELL(self, self.OnSelectCell) |
231 |
|
|