/[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 57 by bh, Thu Sep 13 13:55:33 2001 UTC revision 78 by bh, Mon Feb 4 19:37:16 2002 UTC
# Line 1  Line 1 
1  # Copyright (c) 2001 by Intevation GmbH  # Copyright (c) 2001, 2002 by Intevation GmbH
2  # Authors:  # Authors:
3  # Bernhard Herzog <[email protected]>  # Bernhard Herzog <[email protected]>
4  #  #
# Line 507  class MapCanvas(wxWindow): Line 507  class MapCanvas(wxWindow):
507                  dc = wxClientDC(self)                  dc = wxClientDC(self)
508                  font = wxFont(10, wx.wxSWISS, wx.wxNORMAL, wx.wxNORMAL)                  font = wxFont(10, wx.wxSWISS, wx.wxNORMAL, wx.wxNORMAL)
509                  dc.SetFont(font)                  dc.SetFont(font)
510                  for i in range(len(labels)):                  for i in range(len(labels) - 1, -1, -1):
511                      label = labels[i]                      label = labels[i]
512                      x = label.x                      x = label.x
513                      y = label.y                      y = label.y
# Line 565  class MapCanvas(wxWindow): Line 565  class MapCanvas(wxWindow):
565    
566              select_shape = -1              select_shape = -1
567              if shapetype == SHAPETYPE_POLYGON:              if shapetype == SHAPETYPE_POLYGON:
568                  for i in range(layer.NumShapes()):                  for i in range(layer.NumShapes() - 1, -1, -1):
569                      result = point_in_polygon_shape(layer.shapefile.cobject(),                      result = point_in_polygon_shape(layer.shapefile.cobject(),
570                                                      i,                                                      i,
571                                                      filled, stroked,                                                      filled, stroked,
# Line 576  class MapCanvas(wxWindow): Line 576  class MapCanvas(wxWindow):
576                          select_shape = i                          select_shape = i
577                          break                          break
578              elif shapetype == SHAPETYPE_ARC:              elif shapetype == SHAPETYPE_ARC:
579                  for i in range(layer.NumShapes()):                  for i in range(layer.NumShapes() - 1, -1, -1):
580                      result = point_in_polygon_shape(layer.shapefile.cobject(),                      result = point_in_polygon_shape(layer.shapefile.cobject(),
581                                                      i, 0, 1,                                                      i, 0, 1,
582                                                      map_proj, layer_proj,                                                      map_proj, layer_proj,
# Line 586  class MapCanvas(wxWindow): Line 586  class MapCanvas(wxWindow):
586                          select_shape = i                          select_shape = i
587                          break                          break
588              elif shapetype == SHAPETYPE_POINT:              elif shapetype == SHAPETYPE_POINT:
589                  for i in range(layer.NumShapes()):                  for i in range(layer.NumShapes() - 1, -1, -1):
590                      shape = layer.Shape(i)                      shape = layer.Shape(i)
591                      x, y = shape.Points()[0]                      x, y = shape.Points()[0]
592                      if inverse:                      if inverse:
# Line 604  class MapCanvas(wxWindow): Line 604  class MapCanvas(wxWindow):
604          return None, None          return None, None
605    
606      def SelectShapeAt(self, x, y):      def SelectShapeAt(self, x, y):
607          layer, shape = self.find_shape_at(x, y)          layer, shape = self.find_shape_at(x, y, selected_layer = 0)
608          # If layer is None, then shape will also be None. We don't want          # If layer is None, then shape will also be None. We don't want
609          # to deselect the currently selected layer, so we simply select          # to deselect the currently selected layer, so we simply select
610          # the already selected layer again.          # the already selected layer again.

Legend:
Removed from v.57  
changed lines
  Added in v.78

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26