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

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

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

revision 854 by frank, Wed May 7 18:24:13 2003 UTC revision 914 by frank, Fri May 16 16:25:41 2003 UTC
# Line 1  Line 1 
1  # Copyright (c) 2001, 2002, 2003 by Intevation GmbH  # Copyright (c) 2001, 2002, 2003 by Intevation GmbH
2  # Authors:  # Authors:
3  # Jonathan Coles <[email protected]>  # Jonathan Coles <[email protected]>
4    # Frank Koormann <[email protected]>
5  #  #
6  # This program is free software under the GPL (>=v2)  # This program is free software under the GPL (>=v2)
7  # Read the file COPYING coming with Thuban for details.  # Read the file COPYING coming with Thuban for details.
# Line 15  from wxPython.wx import * Line 16  from wxPython.wx import *
16    
17  from Thuban.Model.layer import Layer  from Thuban.Model.layer import Layer
18  from Thuban.Model.map import Map  from Thuban.Model.map import Map
 from Thuban.Model.scalebar import ScaleBar  
 from Thuban.Model.messages import *  
19  from Thuban.Model.classification import ClassGroup  from Thuban.Model.classification import ClassGroup
20    
21  from Thuban.UI.messages import *  from Thuban.Model.messages import \
22        MAP_STACKING_CHANGED, MAP_LAYERS_ADDED, MAP_LAYERS_REMOVED, LAYER_CHANGED,\
23        LAYER_VISIBILITY_CHANGED, TITLE_CHANGED
24    
25    from Thuban.UI.messages import SCALE_CHANGED
26    
27  from Thuban.UI.classifier import ClassDataPreviewer  from Thuban.UI.classifier import ClassDataPreviewer
28  from Thuban.UI.dock import DockPanel  from Thuban.UI.dock import DockPanel
29    from Thuban.UI.scalebar import ScaleBar
30    
31  from Thuban.Lib.connector import ConnectorError  from Thuban.Lib.connector import ConnectorError
32    
# Line 250  class LegendTree(wxTreeCtrl): Line 255  class LegendTree(wxTreeCtrl):
255          else:          else:
256              return wxTreeCtrl.OnCompareItems(self, item1, item2)              return wxTreeCtrl.OnCompareItems(self, item1, item2)
257    
   
258      def DoOnShowLayer(self):      def DoOnShowLayer(self):
259          #self.__ShowHideLayer(True)          #self.__ShowHideLayer(True)
260          layer, group = self.GetSelectedHierarchy()          layer, group = self.GetSelectedHierarchy()
# Line 472  class ScaleBarBitmap(wxBoxSizer): Line 476  class ScaleBarBitmap(wxBoxSizer):
476          self.mainWindow = mainWindow          self.mainWindow = mainWindow
477          self.parent = parent          self.parent = parent
478          self.canvas = None          self.canvas = None
         self.scalebar = ScaleBar(map)  
479          self.SetCanvas(self.mainWindow.canvas)          self.SetCanvas(self.mainWindow.canvas)
480    
481      def SetCanvas(self, canvas):      def SetCanvas(self, canvas):
# Line 482  class ScaleBarBitmap(wxBoxSizer): Line 485  class ScaleBarBitmap(wxBoxSizer):
485              for msg, func in sub_list: self.canvas.Unsubscribe(msg, func)              for msg, func in sub_list: self.canvas.Unsubscribe(msg, func)
486                    
487          self.canvas = canvas          self.canvas = canvas
488            self.scalebar = ScaleBar(canvas.map)
489    
490          if self.canvas is not None:          if self.canvas is not None:
491              for msg, func in sub_list: self.canvas.Subscribe(msg, func)              for msg, func in sub_list: self.canvas.Subscribe(msg, func)
# Line 496  class ScaleBarBitmap(wxBoxSizer): Line 500  class ScaleBarBitmap(wxBoxSizer):
500          dc.SelectObject(bmp)          dc.SelectObject(bmp)
501          dc.Clear()          dc.Clear()
502    
503          self.scalebar.DrawScalebar(scale, dc)          self.scalebar.DrawScaleBar(scale, dc, (0,0), dc.GetSizeTuple())
504    
505          self.scalebarBitmap.SetBitmap(bmp)          self.scalebarBitmap.SetBitmap(bmp)
506    

Legend:
Removed from v.854  
changed lines
  Added in v.914

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26