/[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 509 by jonathan, Tue Mar 11 09:45:59 2003 UTC revision 519 by jonathan, Tue Mar 11 22:27:35 2003 UTC
# Line 296  class ClassTable(wxPyGridTableBase): Line 296  class ClassTable(wxPyGridTableBase):
296                          wxGRIDTABLE_NOTIFY_ROWS_APPENDED,                          wxGRIDTABLE_NOTIFY_ROWS_APPENDED,
297                          newRows - curRows)    # how many                          newRows - curRows)    # how many
298              self.GetView().ProcessTableMessage(msg)              self.GetView().ProcessTableMessage(msg)
299                self.GetView().FitInside()
300          elif newRows < curRows:          elif newRows < curRows:
301              msg = wxGridTableMessage(self,              msg = wxGridTableMessage(self,
302                          wxGRIDTABLE_NOTIFY_ROWS_DELETED,                          wxGRIDTABLE_NOTIFY_ROWS_DELETED,
303                          curRows - newRows,    # position                          curRows - newRows,    # position
304                          curRows - newRows)    # how many                          curRows - newRows)    # how many
305              self.GetView().ProcessTableMessage(msg)              self.GetView().ProcessTableMessage(msg)
306                self.GetView().FitInside()
307    
308      def __SetRow(self, row, group):      def __SetRow(self, row, group):
309          """Set a row's data to that of the group.          """Set a row's data to that of the group.
# Line 583  class Classifier(NonModalDialog): Line 585  class Classifier(NonModalDialog):
585          NonModalDialog.__init__(self, parent, interactor, name,          NonModalDialog.__init__(self, parent, interactor, name,
586                                  _("Classifier: %s") % layer.Title())                                  _("Classifier: %s") % layer.Title())
587    
588          panel = wxPanel(self, -1)          panel = wxPanel(self, -1, size=(100, 100))
589    
590          self.layer = layer          self.layer = layer
591    
# Line 592  class Classifier(NonModalDialog): Line 594  class Classifier(NonModalDialog):
594          fieldType = self.originalClass.GetFieldType()          fieldType = self.originalClass.GetFieldType()
595    
596          topBox = wxBoxSizer(wxVERTICAL)          topBox = wxBoxSizer(wxVERTICAL)
597            panelBox = wxBoxSizer(wxVERTICAL)
598    
599          #topBox.Add(wxStaticText(panel, -1, _("Layer: %s") % layer.Title()),          #panelBox.Add(wxStaticText(panel, -1, _("Layer: %s") % layer.Title()),
600              #0, wxALIGN_LEFT | wxALL, 4)              #0, wxALIGN_LEFT | wxALL, 4)
601          topBox.Add(wxStaticText(panel, -1,          panelBox.Add(wxStaticText(panel, -1,
602                                  _("Layer Type: %s") % layer.ShapeType()),                                  _("Layer Type: %s") % layer.ShapeType()),
603              0, wxALIGN_LEFT | wxALL, 4)              0, wxALIGN_LEFT | wxALL, 4)
604    
# Line 628  class Classifier(NonModalDialog): Line 631  class Classifier(NonModalDialog):
631          ###########          ###########
632    
633          self.fieldTypeText = wxStaticText(panel, -1, "")          self.fieldTypeText = wxStaticText(panel, -1, "")
634          topBox.Add(self.fieldTypeText, 0, wxGROW | wxALIGN_LEFT | wxALL, 4)          panelBox.Add(self.fieldTypeText, 0, wxGROW | wxALIGN_LEFT | wxALL, 4)
635    
636          propertyBox = wxBoxSizer(wxHORIZONTAL)          propertyBox = wxBoxSizer(wxHORIZONTAL)
637          propertyBox.Add(wxStaticText(panel, -1, _("Field: ")),          propertyBox.Add(wxStaticText(panel, -1, _("Field: ")),
# Line 636  class Classifier(NonModalDialog): Line 639  class Classifier(NonModalDialog):
639          propertyBox.Add(self.fields, 1, wxGROW|wxALL, 4)          propertyBox.Add(self.fields, 1, wxGROW|wxALL, 4)
640          EVT_COMBOBOX(self, ID_PROPERTY_SELECT, self._OnFieldSelect)          EVT_COMBOBOX(self, ID_PROPERTY_SELECT, self._OnFieldSelect)
641    
642          topBox.Add(propertyBox, 0, wxGROW, 4)          panelBox.Add(propertyBox, 0, wxGROW, 4)
643    
644          ###########          ###########
645          #          #
# Line 645  class Classifier(NonModalDialog): Line 648  class Classifier(NonModalDialog):
648    
649          controlBox = wxBoxSizer(wxHORIZONTAL)          controlBox = wxBoxSizer(wxHORIZONTAL)
650    
651          self.classGrid = ClassGrid(self)          self.classGrid = ClassGrid(panel)
652          self.__SetGridTable(self.__cur_field)          self.__SetGridTable(self.__cur_field)
653    
654          controlBox.Add(self.classGrid, 1, wxGROW, 0)          controlBox.Add(self.classGrid, 1, wxGROW, 0)
# Line 681  class Classifier(NonModalDialog): Line 684  class Classifier(NonModalDialog):
684          self.controlButtons.append(button)          self.controlButtons.append(button)
685    
686          controlBox.Add(controlButtonBox, 0, wxGROW, 10)          controlBox.Add(controlButtonBox, 0, wxGROW, 10)
687          topBox.Add(controlBox, 0, wxGROW, 10)          panelBox.Add(controlBox, 1, wxGROW, 10)
688    
689          EVT_BUTTON(self, ID_CLASSIFY_ADD, self._OnAdd)          EVT_BUTTON(self, ID_CLASSIFY_ADD, self._OnAdd)
690          EVT_BUTTON(self, ID_CLASSIFY_REMOVE, self._OnRemove)          EVT_BUTTON(self, ID_CLASSIFY_REMOVE, self._OnRemove)
# Line 700  class Classifier(NonModalDialog): Line 703  class Classifier(NonModalDialog):
703          buttonBox.Add(60, 20, 0, wxALL, 4)          buttonBox.Add(60, 20, 0, wxALL, 4)
704          buttonBox.Add(wxButton(panel, ID_CLASSIFY_CANCEL, _("Cancel")),          buttonBox.Add(wxButton(panel, ID_CLASSIFY_CANCEL, _("Cancel")),
705                        0, wxALL, 4)                        0, wxALL, 4)
706          topBox.Add(buttonBox, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 0)          panelBox.Add(buttonBox, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 0)
707    
708          EVT_BUTTON(self, ID_CLASSIFY_OK, self._OnOK)          EVT_BUTTON(self, ID_CLASSIFY_OK, self._OnOK)
709          EVT_BUTTON(self, ID_CLASSIFY_APPLY, self._OnApply)          EVT_BUTTON(self, ID_CLASSIFY_APPLY, self._OnApply)
# Line 712  class Classifier(NonModalDialog): Line 715  class Classifier(NonModalDialog):
715          self.__SelectField(self.__cur_field)          self.__SelectField(self.__cur_field)
716    
717          panel.SetAutoLayout(True)          panel.SetAutoLayout(True)
718          panel.SetSizer(topBox)          panel.SetSizer(panelBox)
719            panelBox.SetSizeHints(panel)
         topBox.SetSizeHints(panel)  
         topBox.Fit(panel)  
720    
721            topBox.Add(panel, 1, wxGROW, 0)
722            panelBox.SetSizeHints(self)
723          self.SetAutoLayout(True)          self.SetAutoLayout(True)
724          self.Fit()          self.SetSizer(topBox)
   
725    
726      def __BuildClassification(self, fieldIndex):      def __BuildClassification(self, fieldIndex):
727    

Legend:
Removed from v.509  
changed lines
  Added in v.519

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26