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

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

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

revision 1104 by jonathan, Fri May 30 06:29:54 2003 UTC revision 1146 by bh, Tue Jun 10 12:00:16 2003 UTC
# Line 21  import view Line 21  import view
21  from dialogs import NonModalNonParentDialog  from dialogs import NonModalNonParentDialog
22    
23  from messages import SHAPES_SELECTED, SESSION_REPLACED  from messages import SHAPES_SELECTED, SESSION_REPLACED
24  from Thuban.Model.messages import TABLE_REMOVED  from Thuban.Model.messages import TABLE_REMOVED, MAP_LAYERS_REMOVED
25    
26  wx_value_type_map = {FIELDTYPE_INT: wxGRID_VALUE_NUMBER,  wx_value_type_map = {FIELDTYPE_INT: wxGRID_VALUE_NUMBER,
27                       FIELDTYPE_DOUBLE: wxGRID_VALUE_FLOAT,                       FIELDTYPE_DOUBLE: wxGRID_VALUE_FLOAT,
# Line 496  class LayerTableFrame(QueryTableFrame): Line 496  class LayerTableFrame(QueryTableFrame):
496          self.layer = layer          self.layer = layer
497          self.grid.Subscribe(ROW_SELECTED, self.rows_selected)          self.grid.Subscribe(ROW_SELECTED, self.rows_selected)
498          self.parent.Subscribe(SHAPES_SELECTED, self.select_shapes)          self.parent.Subscribe(SHAPES_SELECTED, self.select_shapes)
499            self.map = self.parent.Map()
500            self.map.Subscribe(MAP_LAYERS_REMOVED, self.map_layers_removed)
501    
502          # if there is already a selection present, update the grid          # if there is already a selection present, update the grid
503          # accordingly          # accordingly
# Line 518  class LayerTableFrame(QueryTableFrame): Line 520  class LayerTableFrame(QueryTableFrame):
520          """Override the derived method to first unsubscribed."""          """Override the derived method to first unsubscribed."""
521          self.parent.Unsubscribe(SHAPES_SELECTED, self.select_shapes)          self.parent.Unsubscribe(SHAPES_SELECTED, self.select_shapes)
522          self.grid.Unsubscribe(ROW_SELECTED, self.rows_selected)          self.grid.Unsubscribe(ROW_SELECTED, self.rows_selected)
523            self.map.Unsubscribe(MAP_LAYERS_REMOVED, self.map_layers_removed)
524          QueryTableFrame.OnClose(self, event)          QueryTableFrame.OnClose(self, event)
525    
526      def select_shapes(self, layer, shapes):      def select_shapes(self, layer, shapes):
# Line 534  class LayerTableFrame(QueryTableFrame): Line 537  class LayerTableFrame(QueryTableFrame):
537          """          """
538          if self.layer is not None:          if self.layer is not None:
539              self.parent.SelectShapes(self.layer, rows)              self.parent.SelectShapes(self.layer, rows)
540    
541        def map_layers_removed(self, *args):
542            """Receiver for the map's MAP_LAYERS_REMOVED message
543    
544            Close the dialog if the layer whose table we're showing is not
545            in the map anymore.
546            """
547            if self.layer not in self.map.Layers():
548                self.Close()
549    

Legend:
Removed from v.1104  
changed lines
  Added in v.1146

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26