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

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

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

revision 1218 by jonathan, Thu Jun 12 12:41:31 2003 UTC revision 1219 by bh, Mon Jun 16 17:42:54 2003 UTC
# Line 60  class ClassGenDialog(wxDialog): Line 60  class ClassGenDialog(wxDialog):
60          self.layer = layer          self.layer = layer
61          self.clazz = None          self.clazz = None
62    
63          col = layer.table.Column(fieldName)          col = layer.ShapeStore().Table().Column(fieldName)
64          self.type = col.type          self.type = col.type
65    
66          self.fieldName = fieldName          self.fieldName = fieldName
# Line 504  class GenUniformPanel(wxPanel): Line 504  class GenUniformPanel(wxPanel):
504              self.parent.AllowGenerate(False)              self.parent.AllowGenerate(False)
505    
506      def _OnRetrieve(self, event):      def _OnRetrieve(self, event):
507            table = self.layer.ShapeStore().Table()
508          if self.layer.table is not None:          if table is not None:
509              wxBeginBusyCursor()              wxBeginBusyCursor()
510              try:              try:
511                  min, max = self.layer.table.ValueRange(self.fieldName)                  min, max = table.ValueRange(self.fieldName)
512                  self.minCtrl.SetValue(str(min))                  self.minCtrl.SetValue(str(min))
513                  self.maxCtrl.SetValue(str(max))                  self.maxCtrl.SetValue(str(max))
514              finally:              finally:
# Line 720  class GenUniquePanel(wxPanel): Line 720  class GenUniquePanel(wxPanel):
720          self.list_avail.DeleteAllItems()          self.list_avail.DeleteAllItems()
721          self.list_avail_data = []          self.list_avail_data = []
722    
723          list = self.layer.table.UniqueValues(self.fieldName)          list = self.layer.ShapeStore().Table().UniqueValues(self.fieldName)
724          index = 0          index = 0
725          for v in list:          for v in list:
726              self.dataList.append(v)              self.dataList.append(v)
# Line 832  class GenQuantilesPanel(wxPanel): Line 832  class GenQuantilesPanel(wxPanel):
832          return self.__range          return self.__range
833    
834      def GetList(self):      def GetList(self):
   
835          _list = []          _list = []
836            table = self.layer.ShapeStore().Table()
837          if self.layer.table is not None:          if table is not None:
838              wxBeginBusyCursor()              wxBeginBusyCursor()
839              try:              try:
840                  #                  #
841                  # FIXME: Replace with a call to table when the method                  # FIXME: Replace with a call to table when the method
842                  # has been written to get all the values                  # has been written to get all the values
843                  #                  #
                 table = self.layer.table  
844                  for i in range(table.NumRows()):                  for i in range(table.NumRows()):
845                      _list.append(table.ReadValue(i, self.fieldName))                      _list.append(table.ReadValue(i, self.fieldName))
846              finally:              finally:
# Line 863  class GenQuantilesPanel(wxPanel): Line 861  class GenQuantilesPanel(wxPanel):
861              self.text_range.SetForegroundColour(wxRED)              self.text_range.SetForegroundColour(wxRED)
862    
863      def OnRetrieve(self, event):      def OnRetrieve(self, event):
864            table = self.layer.ShapeStore().Table()
865          if self.layer.table is not None:          if table is not None:
866              wxBeginBusyCursor()              wxBeginBusyCursor()
867              try:              try:
868                  min, max = self.layer.table.ValueRange(self.fieldName)                  min, max = table.ValueRange(self.fieldName)
869                  self.text_range.SetValue("[" + str(min) + ";" + str(max) + "]")                  self.text_range.SetValue("[" + str(min) + ";" + str(max) + "]")
870              finally:              finally:
871                  wxEndBusyCursor()                  wxEndBusyCursor()

Legend:
Removed from v.1218  
changed lines
  Added in v.1219

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26