335 |
return self.dialogs.get(name) |
return self.dialogs.get(name) |
336 |
|
|
337 |
def view_position_changed(self): |
def view_position_changed(self): |
338 |
|
"""Put current position in status bar after a mouse move.""" |
339 |
pos = self.canvas.CurrentPosition() |
pos = self.canvas.CurrentPosition() |
340 |
if pos is not None: |
if pos is not None: |
341 |
text = "(%10.10g, %10.10g)" % pos |
text = "(%10.10g, %10.10g)" % pos |
342 |
else: |
else: |
343 |
text = "" |
text = "" |
344 |
|
# XXX This is a hack until we find a better place for this code. |
345 |
|
# (BER 20050120) |
346 |
|
# BH wrote (20050120): |
347 |
|
# this branch is only executed when the mouse |
348 |
|
# leaves the canvas window, so it's not that often [..] |
349 |
|
# [Here] not the right place to put this code. |
350 |
|
# I don't have a better solution at hand, |
351 |
|
# but the view_position_changed is only there to update |
352 |
|
# the current position. If other information is to |
353 |
|
# be shown in the status bar it should |
354 |
|
# be handled in a different way and |
355 |
|
# by other methods. |
356 |
|
# |
357 |
|
# The status bar widget supports some kind of stack of texts. |
358 |
|
# maybe that can be used to distinguis |
359 |
|
# between short-lived information such as the mouse position |
360 |
|
# and more permanent information such as the hint |
361 |
|
# about the projections. |
362 |
map = self.canvas.Map() |
map = self.canvas.Map() |
363 |
for layer in map.layers: |
for layer in map.layers: |
364 |
bbox = layer.LatLongBoundingBox() |
bbox = layer.LatLongBoundingBox() |