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

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

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

revision 822 by jonathan, Mon May 5 18:20:28 2003 UTC revision 883 by jonathan, Fri May 9 16:34:39 2003 UTC
# Line 43  from renderer import ScreenRenderer, Pri Line 43  from renderer import ScreenRenderer, Pri
43    
44  import labeldialog  import labeldialog
45    
46  from messages import LAYER_SELECTED, SHAPES_SELECTED, VIEW_POSITION  from messages import LAYER_SELECTED, SHAPES_SELECTED, VIEW_POSITION, \
47                         SCALE_CHANGED
48    
49    
50  #  #
# Line 277  class MapCanvas(wxWindow, Publisher): Line 278  class MapCanvas(wxWindow, Publisher):
278      delegated_methods = {"SelectLayer": "selection",      delegated_methods = {"SelectLayer": "selection",
279                           "SelectShapes": "selection",                           "SelectShapes": "selection",
280                           "SelectedLayer": "selection",                           "SelectedLayer": "selection",
281                           "HasSelectedLayer": "selection"}                           "HasSelectedLayer": "selection",
282                             "HasSelectedShapes": "selection",
283                             "SelectedShapes": "selection"}
284    
285      def __init__(self, parent, winid):      def __init__(self, parent, winid):
286          wxWindow.__init__(self, parent, winid)          wxWindow.__init__(self, parent, winid)
# Line 474  class MapCanvas(wxWindow, Publisher): Line 477  class MapCanvas(wxWindow, Publisher):
477          self.scale = scale          self.scale = scale
478          self.offset = offset          self.offset = offset
479          self.full_redraw()          self.full_redraw()
480            self.issue(SCALE_CHANGED, scale)
481    
482      def proj_to_win(self, x, y):      def proj_to_win(self, x, y):
483          """\          """\
# Line 529  class MapCanvas(wxWindow, Publisher): Line 533  class MapCanvas(wxWindow, Publisher):
533              proj = self.map.GetProjection()              proj = self.map.GetProjection()
534              if proj is not None:              if proj is not None:
535                  bbox = proj.ForwardBBox(bbox)                  bbox = proj.ForwardBBox(bbox)
536                  if bbox is not None:  
537                      self.FitRectToWindow(bbox)              if bbox is not None:
538                    self.FitRectToWindow(bbox)
539    
540        def FitSelectedToWindow(self):
541            layer = self.selection.SelectedLayer()
542            shapes = self.selection.SelectedShapes()
543    
544            bbox = layer.ShapesBoundingBox(shapes)
545            if bbox is not None:
546                proj = self.map.GetProjection()
547                if proj is not None:
548                    bbox = proj.ForwardBBox(bbox)
549    
550                if bbox is not None:
551                    self.FitRectToWindow(bbox)
552    
553      def ZoomFactor(self, factor, center = None):      def ZoomFactor(self, factor, center = None):
554          """Multiply the zoom by factor and center on center.          """Multiply the zoom by factor and center on center.

Legend:
Removed from v.822  
changed lines
  Added in v.883

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26