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. |
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 |
|
|
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() |
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): |
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) |
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 |
|
|