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

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

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

revision 1341 by jonathan, Thu Jun 26 17:00:17 2003 UTC revision 1342 by jonathan, Tue Jul 1 16:10:54 2003 UTC
# Line 27  from Thuban.Model.classification import Line 27  from Thuban.Model.classification import
27      ClassGroupSingleton, ClassGroupRange, ClassGroupMap, \      ClassGroupSingleton, ClassGroupRange, ClassGroupMap, \
28      ClassGroupProperties      ClassGroupProperties
29    
30  from Thuban.Model.color import Color  from Thuban.Model.color import Transparent
31    
32  from Thuban.Model.layer import Layer, RasterLayer, \  from Thuban.Model.layer import Layer, RasterLayer, \
33      SHAPETYPE_ARC, SHAPETYPE_POLYGON, SHAPETYPE_POINT      SHAPETYPE_ARC, SHAPETYPE_POLYGON, SHAPETYPE_POINT
# Line 758  class Classifier(NonModalNonParentDialog Line 758  class Classifier(NonModalNonParentDialog
758          button_try = wxButton(self, ID_PROPERTY_TRY, _("Try"))          button_try = wxButton(self, ID_PROPERTY_TRY, _("Try"))
759          button_revert = wxButton(self, ID_PROPERTY_REVERT, _("Revert"))          button_revert = wxButton(self, ID_PROPERTY_REVERT, _("Revert"))
760          button_ok = wxButton(self, wxID_OK, _("OK"))          button_ok = wxButton(self, wxID_OK, _("OK"))
         button_ok.SetDefault()  
761          button_close = wxButton(self, wxID_CANCEL, _("Close"))          button_close = wxButton(self, wxID_CANCEL, _("Close"))
762            button_ok.SetDefault()
763    
764          ############################          ############################
765          # Layout the controls          # Layout the controls
# Line 909  class Classifier(NonModalNonParentDialog Line 909  class Classifier(NonModalNonParentDialog
909          if copyClass:          if copyClass:
910              clazz = copy.deepcopy(clazz)              clazz = copy.deepcopy(clazz)
911    
912          clazz.SetField(fieldName)          clazz.SetFieldInfo(fieldName, fieldType)
         clazz.SetFieldType(fieldType)  
913    
914    
915  #       table = self.classGrid.GetTable()  #       table = self.classGrid.GetTable()
# Line 934  class Classifier(NonModalNonParentDialog Line 933  class Classifier(NonModalNonParentDialog
933    
934              fieldName = self.fields.GetString(fieldIndex)              fieldName = self.fields.GetString(fieldIndex)
935              fieldType = self.layer.GetFieldType(fieldName)              fieldType = self.layer.GetFieldType(fieldName)
936              clazz.SetFieldType(fieldType)              clazz.SetFieldInfo(fieldName, fieldType)
937                                    
938          self.classGrid.CreateTable(clazz, self.layer.ShapeType(), group)          self.classGrid.CreateTable(clazz, self.layer.ShapeType(), group)
939    
# Line 1209  class SelectPropertiesDialog(wxDialog): Line 1208  class SelectPropertiesDialog(wxDialog):
1208          #          #
1209          buttonBox = wxBoxSizer(wxHORIZONTAL)          buttonBox = wxBoxSizer(wxHORIZONTAL)
1210          button_ok = wxButton(self, wxID_OK, _("OK"))          button_ok = wxButton(self, wxID_OK, _("OK"))
         button_ok.SetDefault()  
1211          buttonBox.Add(button_ok, 0, wxRIGHT|wxEXPAND, 10)          buttonBox.Add(button_ok, 0, wxRIGHT|wxEXPAND, 10)
1212          buttonBox.Add(wxButton(self, wxID_CANCEL, _("Cancel")),          buttonBox.Add(wxButton(self, wxID_CANCEL, _("Cancel")),
1213                        0, wxRIGHT|wxEXPAND, 10)                        0, wxRIGHT|wxEXPAND, 10)
1214          topBox.Add(buttonBox, 0, wxALIGN_RIGHT|wxBOTTOM|wxTOP, 10)          topBox.Add(buttonBox, 0, wxALIGN_RIGHT|wxBOTTOM|wxTOP, 10)
1215    
1216            button_ok.SetDefault()
1217                                                                                                                                                                    
1218          #EVT_BUTTON(self, wxID_OK, self._OnOK)          #EVT_BUTTON(self, wxID_OK, self._OnOK)
1219          #EVT_BUTTON(self, ID_SELPROP_CANCEL, self._OnCancel)          #EVT_BUTTON(self, ID_SELPROP_CANCEL, self._OnCancel)
# Line 1235  class SelectPropertiesDialog(wxDialog): Line 1235  class SelectPropertiesDialog(wxDialog):
1235    
1236      def __GetColor(self, cur):      def __GetColor(self, cur):
1237          dialog = wxColourDialog(self)          dialog = wxColourDialog(self)
1238          if cur is not Color.Transparent:          if cur is not Transparent:
1239              dialog.GetColourData().SetColour(Color2wxColour(cur))              dialog.GetColourData().SetColour(Color2wxColour(cur))
1240    
1241          ret = None          ret = None
# Line 1253  class SelectPropertiesDialog(wxDialog): Line 1253  class SelectPropertiesDialog(wxDialog):
1253          self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer          self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer
1254    
1255      def _OnChangeLineColorTrans(self, event):      def _OnChangeLineColorTrans(self, event):
1256          self.prop.SetLineColor(Color.Transparent)          self.prop.SetLineColor(Transparent)
1257          self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer          self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer
1258                    
1259      def _OnChangeFillColor(self, event):      def _OnChangeFillColor(self, event):
# Line 1263  class SelectPropertiesDialog(wxDialog): Line 1263  class SelectPropertiesDialog(wxDialog):
1263          self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer          self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer
1264    
1265      def _OnChangeFillColorTrans(self, event):      def _OnChangeFillColorTrans(self, event):
1266          self.prop.SetFill(Color.Transparent)          self.prop.SetFill(Transparent)
1267          self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer          self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer
1268    
1269      def GetClassGroupProperties(self):      def GetClassGroupProperties(self):
# Line 1319  class ClassDataPreviewer: Line 1319  class ClassDataPreviewer:
1319              h = rect.GetHeight()              h = rect.GetHeight()
1320    
1321          stroke = prop.GetLineColor()          stroke = prop.GetLineColor()
1322          if stroke is Color.Transparent:          if stroke is Transparent:
1323              pen = wxTRANSPARENT_PEN              pen = wxTRANSPARENT_PEN
1324          else:          else:
1325              pen = wxPen(Color2wxColour(stroke),              pen = wxPen(Color2wxColour(stroke),
# Line 1327  class ClassDataPreviewer: Line 1327  class ClassDataPreviewer:
1327                          wxSOLID)                          wxSOLID)
1328    
1329          stroke = prop.GetFill()          stroke = prop.GetFill()
1330          if stroke is Color.Transparent:          if stroke is Transparent:
1331              brush = wxTRANSPARENT_BRUSH              brush = wxTRANSPARENT_BRUSH
1332          else:          else:
1333              brush = wxBrush(Color2wxColour(stroke), wxSOLID)              brush = wxBrush(Color2wxColour(stroke), wxSOLID)

Legend:
Removed from v.1341  
changed lines
  Added in v.1342

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26