/[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 550 by jonathan, Thu Mar 20 09:45:19 2003 UTC revision 879 by jonathan, Fri May 9 16:33:10 2003 UTC
# Line 30  import view Line 30  import view
30  import tree  import tree
31  import proj4dialog  import proj4dialog
32  import tableview, identifyview  import tableview, identifyview
33  import classifier  from Thuban.UI.classifier import Classifier
34  import legend  import legend
35  from menu import Menu  from menu import Menu
36    
# Line 38  from context import Context Line 38  from context import Context
38  from command import registry, Command, ToolCommand  from command import registry, Command, ToolCommand
39  from messages import LAYER_SELECTED, SHAPES_SELECTED, VIEW_POSITION  from messages import LAYER_SELECTED, SHAPES_SELECTED, VIEW_POSITION
40    
41    from Thuban.UI.dock import DockFrame
42    from Thuban.UI.join import JoinDialog
43    
44  # the directory where the toolbar icons are stored  import resource
 bitmapdir = os.path.join(Thuban.__path__[0], os.pardir, "Resources", "Bitmaps")  
 bitmapext = ".xpm"  
45    
46    import projdialog
47    
48  class MainWindow(wxFrame):  
49    
50    class MainWindow(DockFrame):
51    
52      # Some messages that can be subscribed/unsubscribed directly through      # Some messages that can be subscribed/unsubscribed directly through
53      # the MapCanvas come in fact from other objects. This is a map to      # the MapCanvas come in fact from other objects. This is a map to
# Line 58  class MainWindow(wxFrame): Line 61  class MainWindow(wxFrame):
61      # implemented in the __getattr__ method.      # implemented in the __getattr__ method.
62      delegated_methods = {"SelectLayer": "canvas",      delegated_methods = {"SelectLayer": "canvas",
63                           "SelectShapes": "canvas",                           "SelectShapes": "canvas",
64                             "SelectedShapes": "canvas",
65                           }                           }
66    
67      def __init__(self, parent, ID, title, application, interactor,      def __init__(self, parent, ID, title, application, interactor,
68                   initial_message = None, size = wxSize(-1, -1)):                   initial_message = None, size = wxSize(-1, -1)):
69          wxFrame.__init__(self, parent, ID, title, wxDefaultPosition, size)          DockFrame.__init__(self, parent, ID, title, wxDefaultPosition, size)
70            #wxFrame.__init__(self, parent, ID, title, wxDefaultPosition, size)
71    
72          self.application = application          self.application = application
73    
# Line 82  class MainWindow(wxFrame): Line 87  class MainWindow(wxFrame):
87          # call Realize to make sure that the tools appear.          # call Realize to make sure that the tools appear.
88          toolbar.Realize()          toolbar.Realize()
89    
90    
91          # Create the map canvas          # Create the map canvas
92          canvas = view.MapCanvas(self, -1)          canvas = view.MapCanvas(self, -1)
93          canvas.Subscribe(VIEW_POSITION, self.view_position_changed)          canvas.Subscribe(VIEW_POSITION, self.view_position_changed)
94          canvas.Subscribe(SHAPES_SELECTED, self.identify_view_on_demand)          canvas.Subscribe(SHAPES_SELECTED, self.identify_view_on_demand)
95          self.canvas = canvas          self.canvas = canvas
96    
97            self.SetMainWindow(self.canvas)
98    
99            self.SetAutoLayout(True)
100    
101          self.init_dialogs()          self.init_dialogs()
102    
103          EVT_CLOSE(self, self.OnClose)          EVT_CLOSE(self, self._OnClose)
104    
105      def Subscribe(self, channel, *args):      def Subscribe(self, channel, *args):
106          """Subscribe a function to a message channel.          """Subscribe a function to a message channel.
# Line 232  class MainWindow(wxFrame): Line 242  class MainWindow(wxFrame):
242              command = registry.Command(name)              command = registry.Command(name)
243              if command is not None:              if command is not None:
244                  ID = self.get_id(name)                  ID = self.get_id(name)
245                  filename = os.path.join(bitmapdir, command.Icon()) + bitmapext                  bitmap = resource.GetBitmapResource(command.Icon(),
246                  bitmap = wxBitmap(filename, wxBITMAP_TYPE_XPM)                                                      wxBITMAP_TYPE_XPM)
247                  toolbar.AddTool(ID, bitmap,                  toolbar.AddTool(ID, bitmap,
248                                  shortHelpString = command.HelpText(),                                  shortHelpString = command.HelpText(),
249                                  isToggle = command.IsCheckCommand())                                  isToggle = command.IsCheckCommand())
# Line 355  class MainWindow(wxFrame): Line 365  class MainWindow(wxFrame):
365    
366      def OpenSession(self):      def OpenSession(self):
367          self.save_modified_session()          self.save_modified_session()
368          dlg = wxFileDialog(self, _("Open Session"), ".", "", "*.thuban", wxOPEN)          dlg = wxFileDialog(self, _("Open Session"), ".", "",
369                               "Thuban Session File (*.thuban)|*.thuban", wxOPEN)
370          if dlg.ShowModal() == wxID_OK:          if dlg.ShowModal() == wxID_OK:
371              self.prepare_new_session()              self.prepare_new_session()
372              self.application.OpenSession(dlg.GetPath())              self.application.OpenSession(dlg.GetPath())
# Line 369  class MainWindow(wxFrame): Line 380  class MainWindow(wxFrame):
380    
381      def SaveSessionAs(self):      def SaveSessionAs(self):
382          dlg = wxFileDialog(self, _("Save Session As"), ".", "",          dlg = wxFileDialog(self, _("Save Session As"), ".", "",
383                             "*.thuban", wxOPEN)                             "Thuban Session File (*.thuban)|*.thuban",
384                               wxSAVE|wxOVERWRITE_PROMPT)
385          if dlg.ShowModal() == wxID_OK:          if dlg.ShowModal() == wxID_OK:
386              self.application.session.SetFilename(dlg.GetPath())              self.application.session.SetFilename(dlg.GetPath())
387              self.application.SaveSession()              self.application.SaveSession()
388          dlg.Destroy()          dlg.Destroy()
389    
390      def Exit(self):      def Exit(self):
391          self.Close(false)          self.Close(False)
392    
393      def OnClose(self, event):      def _OnClose(self, event):
394          result = self.save_modified_session(can_veto = event.CanVeto())          result = self.save_modified_session(can_veto = event.CanVeto())
395          if result == wxID_CANCEL:          if result == wxID_CANCEL:
396              event.Veto()              event.Veto()
# Line 387  class MainWindow(wxFrame): Line 399  class MainWindow(wxFrame):
399              # wx's destroy event, but that isn't implemented for wxGTK              # wx's destroy event, but that isn't implemented for wxGTK
400              # yet.              # yet.
401              self.canvas.Unsubscribe(VIEW_POSITION, self.view_position_changed)              self.canvas.Unsubscribe(VIEW_POSITION, self.view_position_changed)
402                DockFrame._OnClose(self, event)
403              self.Destroy()              self.Destroy()
404    
405      def SetMap(self, map):      def SetMap(self, map):
406          self.canvas.SetMap(map)          self.canvas.SetMap(map)
407            self.__SetTitle(map.Title())
408    
409            dialog = self.FindRegisteredDock("legend")
410            if dialog is not None:
411                dialog.GetPanel().SetMap(self.Map())
412    
413      def Map(self):      def Map(self):
414          """Return the map displayed by this mainwindow"""          """Return the map displayed by this mainwindow"""
415    
416          return self.canvas.Map()          return self.canvas.Map()
417    
418      def ShowSessionTree(self):      def ToggleSessionTree(self):
419            """If the session tree is shown close it otherwise create a new tree"""
420          name = "session_tree"          name = "session_tree"
421          dialog = self.get_open_dialog(name)          dialog = self.get_open_dialog(name)
422          if dialog is None:          if dialog is None:
# Line 404  class MainWindow(wxFrame): Line 424  class MainWindow(wxFrame):
424              self.add_dialog(name, dialog)              self.add_dialog(name, dialog)
425              dialog.Show(True)              dialog.Show(True)
426          else:          else:
427              # FIXME: bring dialog to front here              dialog.Close()
             pass  
428    
429        def SessionTreeShown(self):
430            """Return true iff the session tree is currently shown"""
431            return self.get_open_dialog("session_tree") is not None
432    
433      def About(self):      def About(self):
434          self.RunMessageBox(_("About"),          self.RunMessageBox(_("About"),
# Line 426  class MainWindow(wxFrame): Line 448  class MainWindow(wxFrame):
448          if dlg.ShowModal() == wxID_OK:          if dlg.ShowModal() == wxID_OK:
449              filename = dlg.GetPath()              filename = dlg.GetPath()
450              title = os.path.splitext(os.path.basename(filename))[0]              title = os.path.splitext(os.path.basename(filename))[0]
451              layer = Layer(title, filename)              store = self.application.Session().OpenShapefile(filename)
452                layer = Layer(title, store)
453              map = self.canvas.Map()              map = self.canvas.Map()
454              has_layers = map.HasLayers()              has_layers = map.HasLayers()
455              try:              try:
# Line 450  class MainWindow(wxFrame): Line 473  class MainWindow(wxFrame):
473      def CanRemoveLayer(self):      def CanRemoveLayer(self):
474          """Return true if the currently selected layer can be deleted.          """Return true if the currently selected layer can be deleted.
475    
476          If no layer is selected return false.          If no layer is selected return False.
477    
478          The return value of this method determines whether the remove          The return value of this method determines whether the remove
479          layer command is sensitive in menu.          layer command is sensitive in menu.
# Line 458  class MainWindow(wxFrame): Line 481  class MainWindow(wxFrame):
481          layer = self.current_layer()          layer = self.current_layer()
482          if layer is not None:          if layer is not None:
483              return self.canvas.Map().CanRemoveLayer(layer)              return self.canvas.Map().CanRemoveLayer(layer)
484          return 0          return False
485    
486      def RaiseLayer(self):      def RaiseLayer(self):
487          layer = self.current_layer()          layer = self.current_layer()
# Line 481  class MainWindow(wxFrame): Line 504  class MainWindow(wxFrame):
504          """Return true if a layer is currently selected"""          """Return true if a layer is currently selected"""
505          return self.canvas.HasSelectedLayer()          return self.canvas.HasSelectedLayer()
506    
507      def choose_color(self):      def has_selected_shapes(self):
508          """Run the color selection dialog and return the selected color.          """Return true if a shape is currently selected"""
509            return self.canvas.HasSelectedShapes()
         If the user cancels, return None.  
         """  
         dlg = wxColourDialog(self)  
         color = None  
         if dlg.ShowModal() == wxID_OK:  
             data = dlg.GetColourData()  
             wxc = data.GetColour()  
             color = Color(wxc.Red() / 255.0,  
                           wxc.Green() / 255.0,  
                           wxc.Blue() / 255.0)  
         dlg.Destroy()  
         return color  
   
     def LayerFillColor(self):  
         layer = self.current_layer()  
         if layer is not None:  
             color = self.choose_color()  
             if color is not None:  
                 layer.GetClassification().SetDefaultFill(color)  
   
     def LayerTransparentFill(self):  
         layer = self.current_layer()  
         if layer is not None:  
             layer.GetClassification().SetDefaultFill(Color.None)  
   
     def LayerOutlineColor(self):  
         layer = self.current_layer()  
         if layer is not None:  
             color = self.choose_color()  
             if color is not None:  
                 layer.GetClassification().SetDefaultLineColor(color)  
   
     def LayerNoOutline(self):  
         layer = self.current_layer()  
         if layer is not None:  
             layer.GetClassification().SetDefaultLineColor(Color.None)  
510    
511      def HideLayer(self):      def HideLayer(self):
512          layer = self.current_layer()          layer = self.current_layer()
# Line 547  class MainWindow(wxFrame): Line 534  class MainWindow(wxFrame):
534                  # FIXME: bring dialog to front here                  # FIXME: bring dialog to front here
535                  pass                  pass
536    
537      def Projection(self):      def MapProjection(self):
538          map = self.canvas.Map()  
539          proj = map.projection          name = "map_projection"
540          if proj is None:          dialog = self.get_open_dialog(name)
541              proj4Dlg = proj4dialog.Proj4Dialog(NULL, None, map.BoundingBox())  
542          else:          if dialog is None:
543              proj4Dlg = proj4dialog.Proj4Dialog(NULL, map.projection.params,              map = self.canvas.Map()
544                                                 map.BoundingBox())              dialog = projdialog.ProjFrame(self, name,
545          if proj4Dlg.ShowModal() == wxID_OK:                       _("Map Projection: %s") % map.Title(), map)
546              params = proj4Dlg.GetParams()              self.add_dialog(name, dialog)
547              if params is not None:              dialog.Show()
548                  proj = Projection(params)          dialog.Raise()
549              else:  
550                  proj = None      def LayerProjection(self):
551              map.SetProjection(proj)  
552          proj4Dlg.Destroy()          layer = self.current_layer()
553    
554            name = "layer_projection" + str(id(layer))
555            dialog = self.get_open_dialog(name)
556    
557            if dialog is None:
558                map = self.canvas.Map()
559                dialog = projdialog.ProjFrame(self, name,
560                         _("Layer Projection: %s") % layer.Title(), layer)
561                self.add_dialog(name, dialog)
562                dialog.Show()
563            dialog.Raise()
564    
565      def Classify(self):      def LayerEditProperties(self):
566    
567          #          #
568          # the menu option for this should only be available if there          # the menu option for this should only be available if there
# Line 573  class MainWindow(wxFrame): Line 571  class MainWindow(wxFrame):
571          #          #
572    
573          layer = self.current_layer()          layer = self.current_layer()
574          self.OpenClassifier(layer)          self.OpenLayerProperties(layer)
575    
576      def OpenClassifier(self, layer):      def OpenLayerProperties(self, layer, group = None):
577          name = "classifier" + str(id(layer))          name = "layer_properties" + str(id(layer))
578          dialog = self.get_open_dialog(name)          dialog = self.get_open_dialog(name)
579    
580          if dialog is None:          if dialog is None:
581              dialog = classifier.Classifier(self, name, layer)              dialog = Classifier(self, name, layer, group)
582              self.add_dialog(name, dialog)              self.add_dialog(name, dialog)
583              dialog.Show()              dialog.Show()
584            dialog.Raise()
585    
586        def LayerJoinTable(self):
587            print "LayerJoinTable"
588    
589        def LayerUnjoinTable(self):
590            print "LayerUnjoinTable"
591    
592      def ShowLegend(self):      def ShowLegend(self):
593            if not self.LegendShown():
594                self.ToggleLegend()
595    
596        def ToggleLegend(self):
597            """Show the legend if it's not shown otherwise hide it again"""
598          name = "legend"          name = "legend"
599          dialog = self.get_open_dialog(name)          dialog = self.FindRegisteredDock(name)
600    
601          if dialog is None:          if dialog is None:
602              dialog = legend.Legend(self, name, self.Map())              dialog = self.CreateDock(name, -1, _("Legend"), wxLAYOUT_LEFT)
603              self.add_dialog(name, dialog)              legend.LegendPanel(dialog, None, self)
604                dialog.Dock()
605                dialog.GetPanel().SetMap(self.Map())
606              dialog.Show()              dialog.Show()
607            else:
608                dialog.Show(not dialog.IsShown())
609    
610        def LegendShown(self):
611            """Return true iff the legend is currently open"""
612            dialog = self.FindRegisteredDock("legend")
613            return dialog is not None and dialog.IsShown()
614    
615        def TableOpen(self):
616            print "TableOpen"
617            dlg = wxFileDialog(self, _("Open Table"), ".", "",
618                               "DBF Files (*.dbf)|*.dbf|" +
619                               "CSV Files (*.csv)|*.csv|" +
620                               "All Files (*.*)|*.*",
621                               wxOPEN)
622            if dlg.ShowModal() == wxID_OK:
623                #self.application.session.OpenTable(dlg.GetPath())
624                pass
625    
626            dlg.Destroy()
627    
628        def TableClose(self):
629            print "TableClose"
630    
631        def TableShow(self):
632            print "TableShow"
633    
634        def TableHide(self):
635            print "TableHide"
636    
637        def TableJoin(self):
638            print "TableJoin"
639            dlg = JoinDialog(self, _("Join Tables"), self.application.session)
640            if dlg.ShowModal() == wxID_OK:
641                print "OK"
642    
643      def ZoomInTool(self):      def ZoomInTool(self):
644          self.canvas.ZoomInTool()          self.canvas.ZoomInTool()
# Line 613  class MainWindow(wxFrame): Line 659  class MainWindow(wxFrame):
659      def FullExtent(self):      def FullExtent(self):
660          self.canvas.FitMapToWindow()          self.canvas.FitMapToWindow()
661    
662        def FullLayerExtent(self):
663            self.canvas.FitLayerToWindow(self.current_layer())
664    
665        def FullSelectionExtent(self):
666            self.canvas.FitSelectedToWindow()
667    
668      def PrintMap(self):      def PrintMap(self):
669          self.canvas.Print()          self.canvas.Print()
670    
671        def RenameMap(self):
672            dlg = wxTextEntryDialog(self, "Map Title: ", "Rename Map",
673                                    self.Map().Title())
674            if dlg.ShowModal() == wxID_OK:
675                title = dlg.GetValue()
676                if title != "":
677                    self.Map().SetTitle(title)
678                    self.__SetTitle(title)
679    
680            dlg.Destroy()
681    
682      def identify_view_on_demand(self, layer, shapes):      def identify_view_on_demand(self, layer, shapes):
683            """Subscribed to the canvas' SHAPES_SELECTED message
684    
685            If the current tool is the identify tool, at least one shape is
686            selected and the identify dialog is not shown, show the dialog.
687            """
688            # If the selection has become empty we don't need to do
689            # anything. Otherwise it could happen that the dialog was popped
690            # up when the selection became empty, e.g. when a new selection
691            # is opened while the identify tool is active and dialog had
692            # been closed
693            if not shapes:
694                return
695    
696          name = "identify_view"          name = "identify_view"
697          if self.canvas.CurrentTool() == "IdentifyTool":          if self.canvas.CurrentTool() == "IdentifyTool":
698              if not self.dialog_open(name):              if not self.dialog_open(name):
699                  dialog = identifyview.IdentifyView(self, name)                  dialog = identifyview.IdentifyView(self, name)
700                  self.add_dialog(name, dialog)                  self.add_dialog(name, dialog)
701                  dialog.Show(true)                  dialog.Show(True)
702              else:              else:
703                  # FIXME: bring dialog to front?                  # FIXME: bring dialog to front?
704                  pass                  pass
705    
706        def __SetTitle(self, title):
707            self.SetTitle("Thuban - " + title)
708    
709  #  #
710  # Define all the commands available in the main window  # Define all the commands available in the main window
711  #  #
# Line 638  def call_method(context, methodname, *ar Line 717  def call_method(context, methodname, *ar
717      apply(getattr(context.mainwindow, methodname), args)      apply(getattr(context.mainwindow, methodname), args)
718    
719  def _method_command(name, title, method, helptext = "",  def _method_command(name, title, method, helptext = "",
720                      icon = "", sensitive = None):                      icon = "", sensitive = None, checked = None):
721      """Add a command implemented by a method of the mainwindow object"""      """Add a command implemented by a method of the mainwindow object"""
722      registry.Add(Command(name, title, call_method, args=(method,),      registry.Add(Command(name, title, call_method, args=(method,),
723                           helptext = helptext, icon = icon,                           helptext = helptext, icon = icon,
724                           sensitive = sensitive))                           sensitive = sensitive, checked = checked))
725    
726  def make_check_current_tool(toolname):  def make_check_current_tool(toolname):
727      """Return a function that tests if the currently active tool is toolname      """Return a function that tests if the currently active tool is toolname
# Line 667  def _has_selected_layer(context): Line 746  def _has_selected_layer(context):
746      """Return true if a layer is selected in the context"""      """Return true if a layer is selected in the context"""
747      return context.mainwindow.has_selected_layer()      return context.mainwindow.has_selected_layer()
748    
749    def _has_selected_shapes(context):
750        """Return true if a layer is selected in the context"""
751        return context.mainwindow.has_selected_shapes()
752    
753  def _can_remove_layer(context):  def _can_remove_layer(context):
754      return context.mainwindow.CanRemoveLayer()      return context.mainwindow.CanRemoveLayer()
755    
756  def _has_tree_window_shown(context):  def _has_tree_window_shown(context):
757      """Return true if the tree window is shown"""      """Return true if the tree window is shown"""
758      return context.mainwindow.get_open_dialog("session_tree") is None      return context.mainwindow.SessionTreeShown()
759    
760  def _has_visible_map(context):  def _has_visible_map(context):
761      """Return true iff theres a visible map in the mainwindow.      """Return true iff theres a visible map in the mainwindow.
# Line 687  def _has_visible_map(context): Line 770  def _has_visible_map(context):
770    
771  def _has_legend_shown(context):  def _has_legend_shown(context):
772      """Return true if the legend window is shown"""      """Return true if the legend window is shown"""
773      return context.mainwindow.get_open_dialog("legend") is None      return context.mainwindow.LegendShown()
774    
775    
776  # File menu  # File menu
777  _method_command("new_session", _("&New Session"), "NewSession")  _method_command("new_session", _("&New Session"), "NewSession")
778  _method_command("open_session", _("&Open Session"), "OpenSession")  _method_command("open_session", _("&Open Session..."), "OpenSession")
779  _method_command("save_session", _("&Save Session"), "SaveSession")  _method_command("save_session", _("&Save Session"), "SaveSession")
780  _method_command("save_session_as", _("Save Session &As"), "SaveSessionAs")  _method_command("save_session_as", _("Save Session &As..."), "SaveSessionAs")
781  _method_command("show_session_tree", _("Show Session &Tree"), "ShowSessionTree",  _method_command("toggle_session_tree", _("Session &Tree"), "ToggleSessionTree",
782                  sensitive = _has_tree_window_shown)                  checked = _has_tree_window_shown)
783    _method_command("toggle_legend", _("Legend"), "ToggleLegend",
784                    checked = _has_legend_shown)
785  _method_command("exit", _("E&xit"), "Exit")  _method_command("exit", _("E&xit"), "Exit")
786    
787  # Help menu  # Help menu
788  _method_command("help_about", _("&About"), "About")  _method_command("help_about", _("&About..."), "About")
789    
790    
791  # Map menu  # Map menu
792  _method_command("map_projection", _("Pro&jection"), "Projection")  _method_command("map_projection", _("Pro&jection..."), "MapProjection")
793    
794  _tool_command("map_zoom_in_tool", _("&Zoom in"), "ZoomInTool", "ZoomInTool",  _tool_command("map_zoom_in_tool", _("&Zoom in"), "ZoomInTool", "ZoomInTool",
795                helptext = _("Switch to map-mode 'zoom-in'"), icon = "zoom_in",                helptext = _("Switch to map-mode 'zoom-in'"), icon = "zoom_in",
# Line 725  _tool_command("map_label_tool", _("&Labe Line 810  _tool_command("map_label_tool", _("&Labe
810  _method_command("map_full_extent", _("&Full extent"), "FullExtent",  _method_command("map_full_extent", _("&Full extent"), "FullExtent",
811                 helptext = _("Full Extent"), icon = "fullextent",                 helptext = _("Full Extent"), icon = "fullextent",
812                sensitive = _has_visible_map)                sensitive = _has_visible_map)
813    _method_command("layer_full_extent", _("&Full layer extent"), "FullLayerExtent",
814                   helptext = _("Full Layer Extent"), icon = "fulllayerextent",
815                  sensitive = _has_selected_layer)
816    _method_command("selected_full_extent", _("&Full selection extent"), "FullSelectionExtent",
817                   helptext = _("Full Selection Extent"), icon = "fullselextent",
818                  sensitive = _has_selected_shapes)
819  _method_command("map_print", _("Prin&t"), "PrintMap",  _method_command("map_print", _("Prin&t"), "PrintMap",
820                  helptext = _("Print the map"))                  helptext = _("Print the map"))
821    _method_command("map_rename", _("&Rename..."), "RenameMap",
822  # Layer menu                  helptext = _("Rename the map"))
823  _method_command("layer_add", _("&Add Layer"), "AddLayer",  _method_command("layer_add", _("&Add Layer..."), "AddLayer",
824                  helptext = _("Add a new layer to active map"))                  helptext = _("Add a new layer to active map"))
825  _method_command("layer_remove", _("&Remove Layer"), "RemoveLayer",  _method_command("layer_remove", _("&Remove Layer"), "RemoveLayer",
826                  helptext = _("Remove selected layer(s)"),                  helptext = _("Remove selected layer(s)"),
827                  sensitive = _can_remove_layer)                  sensitive = _can_remove_layer)
828  _method_command("layer_fill_color", _("&Fill Color"), "LayerFillColor",  
829                  helptext = _("Set the fill color of selected layer(s)"),  # Layer menu
830                  sensitive = _has_selected_layer)  _method_command("layer_projection", _("Pro&jection..."), "LayerProjection",
 _method_command("layer_transparent_fill", _("&Transparent Fill"),  
                 "LayerTransparentFill",  
                 helptext = _("Do not fill the selected layer(s)"),  
                 sensitive = _has_selected_layer)  
 _method_command("layer_outline_color", _("&Outline Color"), "LayerOutlineColor",  
                 helptext = _("Set the outline color of selected layer(s)"),  
                 sensitive = _has_selected_layer)  
 _method_command("layer_no_outline", _("&No Outline"), "LayerNoOutline",  
                 helptext= _("Do not draw the outline of the selected layer(s)"),  
831                  sensitive = _has_selected_layer)                  sensitive = _has_selected_layer)
832  _method_command("layer_raise", _("&Raise"), "RaiseLayer",  _method_command("layer_raise", _("&Raise"), "RaiseLayer",
833                  helptext = _("Raise selected layer(s)"),                  helptext = _("Raise selected layer(s)"),
# Line 762  _method_command("layer_hide", _("&Hide") Line 844  _method_command("layer_hide", _("&Hide")
844  _method_command("layer_show_table", _("Show Ta&ble"), "LayerShowTable",  _method_command("layer_show_table", _("Show Ta&ble"), "LayerShowTable",
845                  helptext = _("Show the selected layer's table"),                  helptext = _("Show the selected layer's table"),
846                  sensitive = _has_selected_layer)                  sensitive = _has_selected_layer)
847  _method_command("layer_classifier", _("Classify"), "Classify",  _method_command("layer_properties", _("&Properties..."), "LayerEditProperties",
848                    sensitive = _has_selected_layer)
849    _method_command("layer_jointable", _("&Join Table..."), "LayerJoinTable",
850                  sensitive = _has_selected_layer)                  sensitive = _has_selected_layer)
851  _method_command("show_legend", _("Legend"), "ShowLegend",  _method_command("layer_unjointable", _("&Unjoin Table..."), "LayerUnjoinTable",
852                  sensitive = _has_legend_shown)                  sensitive = _has_selected_layer)
853    
854    # Table menu
855    _method_command("table_open", _("&Open..."), "TableOpen")
856    _method_command("table_close", _("&Close"), "TableClose")
857    _method_command("table_show", _("&Show"), "TableShow")
858    _method_command("table_hide", _("&Hide"), "TableHide")
859    _method_command("table_join", _("&Join..."), "TableJoin")
860    
861  # the menu structure  # the menu structure
862  main_menu = Menu("<main>", "<main>",  main_menu = Menu("<main>", "<main>",
863                   [Menu("file", _("&File"),                   [Menu("file", _("&File"),
864                         ["new_session", "open_session", None,                         ["new_session", "open_session", None,
865                          "save_session", "save_session_as", None,                          "save_session", "save_session_as", None,
866                          "show_session_tree", None,                          "toggle_session_tree", None,
                         "show_legend", None,  
867                          "exit"]),                          "exit"]),
868                    Menu("map", _("&Map"),                    Menu("map", _("&Map"),
869                         ["layer_add", "layer_remove",                         ["layer_add", "layer_remove", "map_rename",
870                          None,                          None,
871                          "map_projection",                          "map_projection",
872                          None,                          None,
873                          "map_zoom_in_tool", "map_zoom_out_tool",                          "map_zoom_in_tool", "map_zoom_out_tool",
874                          "map_pan_tool", "map_identify_tool", "map_label_tool",                          "map_pan_tool",
875                            "map_full_extent",
876                            "layer_full_extent",
877                            "selected_full_extent",
878                            None,
879                            "map_identify_tool", "map_label_tool",
880                          None,                          None,
881                          "map_full_extent",                          "toggle_legend",
882                          None,                          None,
883                          "map_print"]),                          "map_print"]),
884                    Menu("layer", _("&Layer"),                    Menu("layer", _("&Layer"),
885                         ["layer_fill_color", "layer_transparent_fill",                          ["layer_raise", "layer_lower",
                         "layer_outline_color", "layer_no_outline",  
                         None,  
                         "layer_raise", "layer_lower",  
886                          None,                          None,
887                          "layer_show", "layer_hide",                          "layer_show", "layer_hide",
888                          None,                          None,
889                            "layer_projection",
890                            None,
891                          "layer_show_table",                          "layer_show_table",
892                            "layer_jointable",
893                            "layer_unjointable",
894                          None,                          None,
895                          "layer_classifier"]),                          "layer_properties"]),
896                      Menu("table", _("&Table"),
897                           ["table_open", "table_close",
898                           None,
899                           "table_show", "table_hide",
900                           None,
901                           "table_join"]),
902                    Menu("help", _("&Help"),                    Menu("help", _("&Help"),
903                         ["help_about"])])                         ["help_about"])])
904    
# Line 804  main_menu = Menu("<main>", "<main>", Line 906  main_menu = Menu("<main>", "<main>",
906    
907  main_toolbar = Menu("<toolbar>", "<toolbar>",  main_toolbar = Menu("<toolbar>", "<toolbar>",
908                      ["map_zoom_in_tool", "map_zoom_out_tool", "map_pan_tool",                      ["map_zoom_in_tool", "map_zoom_out_tool", "map_pan_tool",
909                       "map_full_extent", None,                       "map_full_extent",
910                         "layer_full_extent",
911                         "selected_full_extent",
912                         None,
913                       "map_identify_tool", "map_label_tool"])                       "map_identify_tool", "map_label_tool"])

Legend:
Removed from v.550  
changed lines
  Added in v.879

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26