/[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 1273 by bh, Mon Jun 16 17:42:54 2003 UTC revision 1274 by jonathan, Fri Jun 20 17:46:04 2003 UTC
# Line 17  from Thuban.Model.table import FIELDTYPE Line 17  from Thuban.Model.table import FIELDTYPE
17       FIELDTYPE_STRING       FIELDTYPE_STRING
18    
19  from Thuban.Model.range import Range  from Thuban.Model.range import Range
20    from Thuban.UI.common import ThubanBeginBusyCursor, ThubanEndBusyCursor
21    
22  import classifier, resource  import classifier, resource
23    
# Line 506  class GenUniformPanel(wxPanel): Line 507  class GenUniformPanel(wxPanel):
507      def _OnRetrieve(self, event):      def _OnRetrieve(self, event):
508          table = self.layer.ShapeStore().Table()          table = self.layer.ShapeStore().Table()
509          if table is not None:          if table is not None:
510              wxBeginBusyCursor()              ThubanBeginBusyCursor()
511              try:              try:
512                  min, max = table.ValueRange(self.fieldName)                  min, max = table.ValueRange(self.fieldName)
513                  self.minCtrl.SetValue(str(min))                  self.minCtrl.SetValue(str(min))
514                  self.maxCtrl.SetValue(str(max))                  self.maxCtrl.SetValue(str(max))
515              finally:              finally:
516                  wxEndBusyCursor()                  ThubanEndBusyCursor()
517    
518      def __GetValidatedTypeEntry(self, win, value, type, badValue = None):      def __GetValidatedTypeEntry(self, win, value, type, badValue = None):
519    
# Line 720  class GenUniquePanel(wxPanel): Line 721  class GenUniquePanel(wxPanel):
721          self.list_avail.DeleteAllItems()          self.list_avail.DeleteAllItems()
722          self.list_avail_data = []          self.list_avail_data = []
723    
724          list = self.layer.ShapeStore().Table().UniqueValues(self.fieldName)          ThubanBeginBusyCursor()
725          index = 0          try:
726          for v in list:              list = self.layer.ShapeStore().Table().UniqueValues(self.fieldName)
727              self.dataList.append(v)              index = 0
728              i = self.list_avail.InsertStringItem(index, str(v))              for v in list:
729              self.list_avail.SetItemData(index, i)                  self.dataList.append(v)
730                    i = self.list_avail.InsertStringItem(index, str(v))
731              self.list_avail_data.append(v)                  self.list_avail.SetItemData(index, i)
732              index += 1      
733                    self.list_avail_data.append(v)
734                    index += 1
735            finally:
736                ThubanEndBusyCursor()
737    
738      def _OnUseAll(self, event):      def _OnUseAll(self, event):
739          for i in range(self.list_avail.GetItemCount()):          for i in range(self.list_avail.GetItemCount()):
# Line 835  class GenQuantilesPanel(wxPanel): Line 840  class GenQuantilesPanel(wxPanel):
840          _list = []          _list = []
841          table = self.layer.ShapeStore().Table()          table = self.layer.ShapeStore().Table()
842          if table is not None:          if table is not None:
843              wxBeginBusyCursor()              ThubanBeginBusyCursor()
844              try:              try:
845                  #                  #
846                  # FIXME: Replace with a call to table when the method                  # FIXME: Replace with a call to table when the method
# Line 844  class GenQuantilesPanel(wxPanel): Line 849  class GenQuantilesPanel(wxPanel):
849                  for i in range(table.NumRows()):                  for i in range(table.NumRows()):
850                      _list.append(table.ReadValue(i, self.fieldName))                      _list.append(table.ReadValue(i, self.fieldName))
851              finally:              finally:
852                  wxEndBusyCursor()                  ThubanEndBusyCursor()
853    
854          return _list          return _list
855    
# Line 863  class GenQuantilesPanel(wxPanel): Line 868  class GenQuantilesPanel(wxPanel):
868      def OnRetrieve(self, event):      def OnRetrieve(self, event):
869          table = self.layer.ShapeStore().Table()          table = self.layer.ShapeStore().Table()
870          if table is not None:          if table is not None:
871              wxBeginBusyCursor()              ThubanBeginBusyCursor()
872              try:              try:
873                  min, max = table.ValueRange(self.fieldName)                  min, max = table.ValueRange(self.fieldName)
874                  self.text_range.SetValue("[" + str(min) + ";" + str(max) + "]")                  self.text_range.SetValue("[" + str(min) + ";" + str(max) + "]")
875              finally:              finally:
876                  wxEndBusyCursor()                  ThubanEndBusyCursor()
877    
878  ID_CUSTOMRAMP_COPYSTART = 4001  ID_CUSTOMRAMP_COPYSTART = 4001
879  ID_CUSTOMRAMP_COPYEND = 4002  ID_CUSTOMRAMP_COPYEND = 4002

Legend:
Removed from v.1273  
changed lines
  Added in v.1274

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26