/[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 1101 by jonathan, Fri May 30 06:28:39 2003 UTC revision 1207 by bh, Fri Jun 13 18:16:10 2003 UTC
# Line 20  from wxPython.grid import * Line 20  from wxPython.grid import *
20  from Thuban import _  from Thuban import _
21  from Thuban.UI.common import Color2wxColour, wxColour2Color  from Thuban.UI.common import Color2wxColour, wxColour2Color
22    
23    from Thuban.Model.messages import MAP_LAYERS_REMOVED, LAYER_SHAPESTORE_REPLACED
24  from Thuban.Model.range import Range  from Thuban.Model.range import Range
25  from Thuban.Model.classification import \  from Thuban.Model.classification import \
26      Classification, ClassGroupDefault, \      Classification, ClassGroupDefault, \
# Line 677  class Classifier(NonModalNonParentDialog Line 678  class Classifier(NonModalNonParentDialog
678                     FIELDTYPE_INT:    _("Integer"),                     FIELDTYPE_INT:    _("Integer"),
679                     FIELDTYPE_DOUBLE: _("Decimal")}                     FIELDTYPE_DOUBLE: _("Decimal")}
680    
681      def __init__(self, parent, name, layer, group = None):      def __init__(self, parent, name, map, layer, group = None):
682          NonModalNonParentDialog.__init__(self, parent, name, "")          NonModalNonParentDialog.__init__(self, parent, name, "")
683    
684          self.__SetTitle(layer.Title())          self.__SetTitle(layer.Title())
685    
686          self.layer = layer          self.layer = layer
687            self.map = map
688    
689            self.map.Subscribe(MAP_LAYERS_REMOVED, self.map_layers_removed)
690            self.layer.Subscribe(LAYER_SHAPESTORE_REPLACED,
691                                 self.layer_shapestore_replaced)
692    
693          self.genDlg = None          self.genDlg = None
694    
# Line 853  class Classifier(NonModalNonParentDialog Line 858  class Classifier(NonModalNonParentDialog
858          text_title.SetFocus()          text_title.SetFocus()
859          self.haveApplied = False          self.haveApplied = False
860    
861        def unsubscribe_messages(self):
862            self.map.Unsubscribe(MAP_LAYERS_REMOVED, self.map_layers_removed)
863            self.layer.Unsubscribe(LAYER_SHAPESTORE_REPLACED,
864                                   self.layer_shapestore_replaced)
865    
866        def map_layers_removed(self, map):
867            if self.layer not in self.map.Layers():
868                self.Close()
869    
870        def layer_shapestore_replaced(self, *args):
871            self.Close()
872    
873      def EditSymbol(self, row):      def EditSymbol(self, row):
874          table = self.classGrid.GetTable()          table = self.classGrid.GetTable()
875          prop = table.GetValueAsCustom(row, COL_SYMBOL, None)          prop = table.GetValueAsCustom(row, COL_SYMBOL, None)
# Line 989  class Classifier(NonModalNonParentDialog Line 1006  class Classifier(NonModalNonParentDialog
1006          self.Close()          self.Close()
1007    
1008      def OnClose(self, event):      def OnClose(self, event):
1009            self.unsubscribe_messages()
1010          NonModalNonParentDialog.OnClose(self, event)          NonModalNonParentDialog.OnClose(self, event)
1011    
1012      def _OnCloseBtn(self, event):      def _OnCloseBtn(self, event):

Legend:
Removed from v.1101  
changed lines
  Added in v.1207

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26