/[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 824 by jonathan, Tue May 6 08:09:27 2003 UTC revision 855 by frank, Wed May 7 18:24:27 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    
284      def __init__(self, parent, winid):      def __init__(self, parent, winid):
285          wxWindow.__init__(self, parent, winid)          wxWindow.__init__(self, parent, winid)
# Line 474  class MapCanvas(wxWindow, Publisher): Line 476  class MapCanvas(wxWindow, Publisher):
476          self.scale = scale          self.scale = scale
477          self.offset = offset          self.offset = offset
478          self.full_redraw()          self.full_redraw()
479            self.issue(SCALE_CHANGED, scale)
480    
481      def proj_to_win(self, x, y):      def proj_to_win(self, x, y):
482          """\          """\
# Line 528  class MapCanvas(wxWindow, Publisher): Line 531  class MapCanvas(wxWindow, Publisher):
531          if bbox is not None:          if bbox is not None:
532              proj = self.map.GetProjection()              proj = self.map.GetProjection()
533              if proj is not None:              if proj is not None:
534                    bbox = proj.ForwardBBox(bbox)
535    
536                if bbox is not None:
537                    self.FitRectToWindow(bbox)
538    
539        def FitSelectedToWindow(self):
540            layer = self.selection.SelectedLayer()
541            shapes = self.selection.SelectedShapes()
542    
543            bbox = layer.ShapesBoundingBox(shapes)
544            if bbox is not None:
545                proj = self.map.GetProjection()
546                if proj is not None:
547                  bbox = proj.ForwardBBox(bbox)                  bbox = proj.ForwardBBox(bbox)
548    
549              if bbox is not None:              if bbox is not None:

Legend:
Removed from v.824  
changed lines
  Added in v.855

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26