401 |
def SetMap(self, map): |
def SetMap(self, map): |
402 |
self.canvas.SetMap(map) |
self.canvas.SetMap(map) |
403 |
self.__SetTitle(map.Title()) |
self.__SetTitle(map.Title()) |
404 |
#self.legendPanel.SetMap(map) |
|
405 |
|
dialog = self.FindRegisteredDock("legend") |
406 |
|
if dialog is not None: |
407 |
|
dialog.GetPanel().SetMap(self.Map()) |
408 |
|
|
409 |
def Map(self): |
def Map(self): |
410 |
"""Return the map displayed by this mainwindow""" |
"""Return the map displayed by this mainwindow""" |
411 |
|
|
|
# sanity check |
|
|
#assert(self.canvas.Map() is self.legendPanel.GetMap()) |
|
|
|
|
412 |
return self.canvas.Map() |
return self.canvas.Map() |
413 |
|
|
414 |
def ToggleSessionTree(self): |
def ToggleSessionTree(self): |
649 |
dlg.Destroy() |
dlg.Destroy() |
650 |
|
|
651 |
def identify_view_on_demand(self, layer, shapes): |
def identify_view_on_demand(self, layer, shapes): |
652 |
|
"""Subscribed to the canvas' SHAPES_SELECTED message |
653 |
|
|
654 |
|
If the current tool is the identify tool, at least one shape is |
655 |
|
selected and the identify dialog is not shown, show the dialog. |
656 |
|
""" |
657 |
|
# If the selection has become empty we don't need to do |
658 |
|
# anything. Otherwise it could happen that the dialog was popped |
659 |
|
# up when the selection became empty, e.g. when a new selection |
660 |
|
# is opened while the identify tool is active and dialog had |
661 |
|
# been closed |
662 |
|
if not shapes: |
663 |
|
return |
664 |
|
|
665 |
name = "identify_view" |
name = "identify_view" |
666 |
if self.canvas.CurrentTool() == "IdentifyTool": |
if self.canvas.CurrentTool() == "IdentifyTool": |
667 |
if not self.dialog_open(name): |
if not self.dialog_open(name): |
814 |
"toggle_session_tree", None, |
"toggle_session_tree", None, |
815 |
"exit"]), |
"exit"]), |
816 |
Menu("map", _("&Map"), |
Menu("map", _("&Map"), |
817 |
["layer_add", "layer_remove", |
["layer_add", "layer_remove", "map_rename", |
818 |
None, |
None, |
819 |
"map_projection", |
"map_projection", |
820 |
None, |
None, |
825 |
None, |
None, |
826 |
"toggle_legend", |
"toggle_legend", |
827 |
None, |
None, |
828 |
"map_print", |
"map_print"]), |
|
None, |
|
|
"map_rename"]), |
|
829 |
Menu("layer", _("&Layer"), |
Menu("layer", _("&Layer"), |
830 |
["layer_raise", "layer_lower", |
["layer_raise", "layer_lower", |
831 |
None, |
None, |