500 |
"""Return true if a layer is currently selected""" |
"""Return true if a layer is currently selected""" |
501 |
return self.canvas.HasSelectedLayer() |
return self.canvas.HasSelectedLayer() |
502 |
|
|
503 |
|
def has_selected_shapes(self): |
504 |
|
"""Return true if a shape is currently selected""" |
505 |
|
return self.canvas.HasSelectedShapes() |
506 |
|
|
507 |
def choose_color(self): |
def choose_color(self): |
508 |
"""Run the color selection dialog and return the selected color. |
"""Run the color selection dialog and return the selected color. |
509 |
|
|
641 |
def FullLayerExtent(self): |
def FullLayerExtent(self): |
642 |
self.canvas.FitLayerToWindow(self.current_layer()) |
self.canvas.FitLayerToWindow(self.current_layer()) |
643 |
|
|
644 |
|
def FullSelectionExtent(self): |
645 |
|
self.canvas.FitSelectedToWindow() |
646 |
|
|
647 |
def PrintMap(self): |
def PrintMap(self): |
648 |
self.canvas.Print() |
self.canvas.Print() |
649 |
|
|
725 |
"""Return true if a layer is selected in the context""" |
"""Return true if a layer is selected in the context""" |
726 |
return context.mainwindow.has_selected_layer() |
return context.mainwindow.has_selected_layer() |
727 |
|
|
728 |
|
def _has_selected_shapes(context): |
729 |
|
"""Return true if a layer is selected in the context""" |
730 |
|
return context.mainwindow.has_selected_shapes() |
731 |
|
|
732 |
def _can_remove_layer(context): |
def _can_remove_layer(context): |
733 |
return context.mainwindow.CanRemoveLayer() |
return context.mainwindow.CanRemoveLayer() |
734 |
|
|
790 |
helptext = _("Full Extent"), icon = "fullextent", |
helptext = _("Full Extent"), icon = "fullextent", |
791 |
sensitive = _has_visible_map) |
sensitive = _has_visible_map) |
792 |
_method_command("layer_full_extent", _("&Full layer extent"), "FullLayerExtent", |
_method_command("layer_full_extent", _("&Full layer extent"), "FullLayerExtent", |
793 |
helptext = _("Full Layer Extent"), icon = "fullextent", |
helptext = _("Full Layer Extent"), icon = "fulllayerextent", |
794 |
sensitive = _has_selected_layer) |
sensitive = _has_selected_layer) |
795 |
|
_method_command("selected_full_extent", _("&Full selection extent"), "FullSelectionExtent", |
796 |
|
helptext = _("Full Selection Extent"), icon = "fullselextent", |
797 |
|
sensitive = _has_selected_shapes) |
798 |
_method_command("map_print", _("Prin&t"), "PrintMap", |
_method_command("map_print", _("Prin&t"), "PrintMap", |
799 |
helptext = _("Print the map")) |
helptext = _("Print the map")) |
800 |
_method_command("map_rename", _("&Rename..."), "RenameMap", |
_method_command("map_rename", _("&Rename..."), "RenameMap", |
839 |
"map_projection", |
"map_projection", |
840 |
None, |
None, |
841 |
"map_zoom_in_tool", "map_zoom_out_tool", |
"map_zoom_in_tool", "map_zoom_out_tool", |
842 |
"map_pan_tool", "map_full_extent", "layer_full_extent", |
"map_pan_tool", |
843 |
|
"map_full_extent", |
844 |
|
"layer_full_extent", |
845 |
|
"selected_full_extent", |
846 |
None, |
None, |
847 |
"map_identify_tool", "map_label_tool", |
"map_identify_tool", "map_label_tool", |
848 |
None, |
None, |
865 |
|
|
866 |
main_toolbar = Menu("<toolbar>", "<toolbar>", |
main_toolbar = Menu("<toolbar>", "<toolbar>", |
867 |
["map_zoom_in_tool", "map_zoom_out_tool", "map_pan_tool", |
["map_zoom_in_tool", "map_zoom_out_tool", "map_pan_tool", |
868 |
"map_full_extent", None, |
"map_full_extent", |
869 |
|
"layer_full_extent", |
870 |
|
"selected_full_extent", |
871 |
|
None, |
872 |
"map_identify_tool", "map_label_tool"]) |
"map_identify_tool", "map_label_tool"]) |