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

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

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

revision 420 by frank, Thu Feb 20 16:22:46 2003 UTC revision 836 by bh, Tue May 6 15:53:13 2003 UTC
# Line 1  Line 1 
1  # Copyright (c) 2001, 2002 by Intevation GmbH  # Copyright (c) 2001, 2002, 2003 by Intevation GmbH
2  # Authors:  # Authors:
3  # Bernhard Herzog <[email protected]>  # Bernhard Herzog <[email protected]>
4  #  #
# Line 45  class RecordListCtrl(wxListCtrl): Line 45  class RecordListCtrl(wxListCtrl):
45          values = {}          values = {}
46    
47          if shape is not None:          if shape is not None:
             num_cols = table.field_count()  
   
48              names = []              names = []
49              for i in range(num_cols):              for col in table.Columns():
50                  type, name, length, decc = table.field_info(i)                  names.append(col.name)
51                  names.append(name)              record = table.ReadRowAsDict(shape)
             record = table.read_record(shape)  
52    
53              for i in range(len(names)):              for i in range(len(names)):
54                  name = names[i]                  name = names[i]
# Line 104  class RecordTable(wxPyGridTableBase): Line 101  class RecordTable(wxPyGridTableBase):
101          if record_index is not None:          if record_index is not None:
102              self.table = table              self.table = table
103              self.record_index = record_index              self.record_index = record_index
104              self.record = table.read_record(record_index)              self.record = table.ReadRowAsDict(record_index)
105    
106              # we have one row for each field in the table              # we have one row for each field in the table
107              self.num_rows = table.field_count()              self.num_rows = table.NumColumns()
108    
109              # extract the field types and names of the row we're showing.              # extract the field types and names of the row we're showing.
110              self.rows = []              self.rows = []
111              for i in range(self.num_rows):              for i in range(self.num_rows):
112                  type, name, len, decc = table.field_info(i)                  col = table.Column(i)
113                  self.rows.append((name, wx_value_type_map[type], len, decc))                  self.rows.append((col.name, wx_value_type_map[col.type]))
114              self.notify_get_values()              self.notify_get_values()
115          else:          else:
116              # make the grid empty              # make the grid empty

Legend:
Removed from v.420  
changed lines
  Added in v.836

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26