/[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

trunk/thuban/Thuban/UI/view.py revision 2700 by dpinte, Mon Sep 18 14:27:02 2006 UTC branches/WIP-pyshapelib-bramz/Thuban/UI/view.py revision 2734 by bramz, Thu Mar 1 12:42:59 2007 UTC
# Line 425  class MapCanvas(wx.Window, ViewPort): Line 425  class MapCanvas(wx.Window, ViewPort):
425          dc = wx.ClientDC(self)          dc = wx.ClientDC(self)
426          font = wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL)          font = wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL)
427          dc.SetFont(font)          dc.SetFont(font)
428          return dc.GetTextExtent(text)          return dc.GetTextExtent(text.decode('iso-8859-1'))
429    
430      def LabelShapeAt(self, x, y, text=None):      def LabelShapeAt(self, x, y, text=None):
431          """Add or remove a label at window position x, y.          """Add or remove a label at window position x, y.
# Line 434  class MapCanvas(wx.Window, ViewPort): Line 434  class MapCanvas(wx.Window, ViewPort):
434          determine the shape at the position, run the label dialog and          determine the shape at the position, run the label dialog and
435          unless the user cancels the dialog, add a label.          unless the user cancels the dialog, add a label.
436          """          """
         label_layer = self.map.LabelLayer()  
437          layer, shape_index = self.find_shape_at(x, y, select_labels = 1)          layer, shape_index = self.find_shape_at(x, y, select_labels = 1)
438          if layer is None and shape_index is not None:          if layer is None and shape_index is not None:
439              ViewPort.LabelShapeAt(self, x, y)              ViewPort.LabelShapeAt(self, x, y)
# Line 443  class MapCanvas(wx.Window, ViewPort): Line 442  class MapCanvas(wx.Window, ViewPort):
442                                                  layer.ShapeStore().Table(),                                                  layer.ShapeStore().Table(),
443                                                  shape_index)                                                  shape_index)
444              ViewPort.LabelShapeAt(self, x, y, text)              ViewPort.LabelShapeAt(self, x, y, text)
445    
446    

Legend:
Removed from v.2700  
changed lines
  Added in v.2734

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26