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

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

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

revision 821 by jonathan, Mon May 5 18:20:15 2003 UTC revision 829 by jonathan, Tue May 6 12:06:38 2003 UTC
# Line 500  class MainWindow(DockFrame): Line 500  class MainWindow(DockFrame):
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    
# Line 637  class MainWindow(DockFrame): Line 641  class MainWindow(DockFrame):
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    
# Line 718  def _has_selected_layer(context): Line 725  def _has_selected_layer(context):
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    
# Line 779  _method_command("map_full_extent", _("&F Line 790  _method_command("map_full_extent", _("&F
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",
# Line 825  main_menu = Menu("<main>", "<main>", Line 839  main_menu = Menu("<main>", "<main>",
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,
# Line 848  main_menu = Menu("<main>", "<main>", Line 865  main_menu = Menu("<main>", "<main>",
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"])

Legend:
Removed from v.821  
changed lines
  Added in v.829

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26