/[thuban]/trunk/thuban/Thuban/UI/classifier.py
ViewVC logotype

Diff of /trunk/thuban/Thuban/UI/classifier.py

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

revision 661 by jonathan, Mon Apr 14 14:16:00 2003 UTC revision 782 by jonathan, Tue Apr 29 16:53:55 2003 UTC
# Line 398  class ClassTable(wxPyGridTableBase): Line 398  class ClassTable(wxPyGridTableBase):
398              if isinstance(group, ClassGroupMap):       return _("Map")              if isinstance(group, ClassGroupMap):       return _("Map")
399    
400          assert False # shouldn't get here          assert False # shouldn't get here
401          return _("")          return ""
402    
403      def GetNumberRows(self):      def GetNumberRows(self):
404          """Return the number of rows."""          """Return the number of rows."""
# Line 478  class ClassTable(wxPyGridTableBase): Line 478  class ClassTable(wxPyGridTableBase):
478          elif type in (FIELDTYPE_INT, FIELDTYPE_DOUBLE):          elif type in (FIELDTYPE_INT, FIELDTYPE_DOUBLE):
479    
480              if type == FIELDTYPE_INT:              if type == FIELDTYPE_INT:
481                    # the float call allows the user to enter 1.0 for 1
482                  conv = lambda p: int(float(p))                  conv = lambda p: int(float(p))
483              else:              else:
484                  conv = lambda p: p                  conv = lambda p: p
# Line 492  class ClassTable(wxPyGridTableBase): Line 493  class ClassTable(wxPyGridTableBase):
493              # function.              # function.
494              #              #
495              try:              try:
496                  return (conv(Str2Num(value)),)                  return (conv(value),)
497              except ValueError:              except ValueError:
498                  i = value.find('-')                  i = value.find('-')
499                  if i == 0:                  if i == 0:
500                      i = value.find('-', 1)                      i = value.find('-', 1)
501    
502                  return (conv(Str2Num(value[:i])), conv(Str2Num(value[i+1:])))                  return (conv(value[:i]), conv(value[i+1:]))
503    
504          assert False  # shouldn't get here          assert False  # shouldn't get here
505          return (0,)          return (0,)
# Line 558  class ClassTable(wxPyGridTableBase): Line 559  class ClassTable(wxPyGridTableBase):
559                      #                      #
560                      if len(dataInfo) == 1:                      if len(dataInfo) == 1:
561                          if not isinstance(group, ClassGroupSingleton):                          if not isinstance(group, ClassGroupSingleton):
562                              ngroup = ClassGroupSingleton(prop = props)                              ngroup = ClassGroupSingleton(props = props)
563                              changed = True                              changed = True
564                          ngroup.SetValue(dataInfo[0])                          ngroup.SetValue(dataInfo[0])
565                      elif len(dataInfo) == 2:                      elif len(dataInfo) == 2:
566                          if not isinstance(group, ClassGroupRange):                          if not isinstance(group, ClassGroupRange):
567                              ngroup = ClassGroupRange(prop = props)                              ngroup = ClassGroupRange(props = props)
568                              changed = True                              changed = True
569                          ngroup.SetRange(dataInfo[0], dataInfo[1])                          ngroup.SetRange(dataInfo[0], dataInfo[1])
570                      else:                      else:
# Line 723  class Classifier(NonModalDialog): Line 724  class Classifier(NonModalDialog):
724    
725    
726          #          #
727          # make field combo box          # make field choice box
728          #          #
729          self.fields = wxComboBox(panel, ID_PROPERTY_SELECT, "",          self.fields = wxChoice(panel, ID_PROPERTY_SELECT,)
730                                       style = wxCB_READONLY)          #self.fields = wxComboBox(panel, ID_PROPERTY_SELECT, "",
731            #                             style = wxCB_READONLY)
732    
733          self.num_cols = layer.table.field_count()          self.num_cols = layer.table.field_count()
734          # just assume the first field in case one hasn't been          # just assume the first field in case one hasn't been
# Line 759  class Classifier(NonModalDialog): Line 761  class Classifier(NonModalDialog):
761          sizer.Add(wxStaticText(panel, ID_PROPERTY_FIELDTEXT, _("Field: ")),          sizer.Add(wxStaticText(panel, ID_PROPERTY_FIELDTEXT, _("Field: ")),
762              0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 4)              0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 4)
763          sizer.Add(self.fields, 1, wxGROW | wxALL, 4)          sizer.Add(self.fields, 1, wxGROW | wxALL, 4)
764          EVT_COMBOBOX(self, ID_PROPERTY_SELECT, self._OnFieldSelect)          EVT_CHOICE(self, ID_PROPERTY_SELECT, self._OnFieldSelect)
765            #EVT_COMBOBOX(self, ID_PROPERTY_SELECT, self._OnFieldSelect)
766    
767          classBox.Add(sizer, 0, wxGROW, 4)          classBox.Add(sizer, 0, wxGROW, 4)
768    

Legend:
Removed from v.661  
changed lines
  Added in v.782

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26