/[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 278 by bh, Mon Aug 26 12:50:23 2002 UTC revision 517 by jonathan, Tue Mar 11 17:28:39 2003 UTC
# Line 12  The main window Line 12  The main window
12    
13  __version__ = "$Revision$"  __version__ = "$Revision$"
14    
15    __ThubanVersion__ = "0.2" #"$THUBAN_0_2$"
16    #__BuildDate__ = "$Date$"
17    
18  import os  import os
19    
20  from wxPython.wx import *  from wxPython.wx import *
21    
22  import Thuban  import Thuban
23    from Thuban import _
24  from Thuban.Model.session import create_empty_session  from Thuban.Model.session import create_empty_session
25  from Thuban.Model.layer import Layer  from Thuban.Model.layer import Layer
26  from Thuban.Model.color import Color  from Thuban.Model.color import Color
# Line 26  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
34  from menu import Menu  from menu import Menu
35    
36  from context import Context  from context import Context
37  from command import registry, Command  from command import registry, Command, ToolCommand
38  from messages import SELECTED_SHAPE, VIEW_POSITION  from messages import SELECTED_SHAPE, VIEW_POSITION
39    
40    
# Line 112  class MainWindow(wxFrame): Line 117  class MainWindow(wxFrame):
117          return menu_bar          return menu_bar
118    
119      def build_menu(self, menudesc):      def build_menu(self, menudesc):
120          """Build and return a wxMenu from a menudescription"""          """Return a wxMenu built from the menu description menudesc"""
121          wxmenu = wxMenu()          wxmenu = wxMenu()
122          last = None          last = None
123          for item in menudesc.items:          for item in menudesc.items:
             # here the items must all be Menu instances themselves  
124              if item is None:              if item is None:
125                  # a separator. Only add one if the last item was not a                  # a separator. Only add one if the last item was not a
126                  # separator                  # separator
# Line 169  class MainWindow(wxFrame): Line 173  class MainWindow(wxFrame):
173                              command.IsCheckCommand())                              command.IsCheckCommand())
174                  self.bind_command_events(command, ID)                  self.bind_command_events(command, ID)
175              else:              else:
176                  print "Unknown command %s" % name                  print _("Unknown command %s") % name
177    
178      def add_toolbar_command(self, toolbar, name):      def add_toolbar_command(self, toolbar, name):
179          """Add the command with name name to the toolbar toolbar.          """Add the command with name name to the toolbar toolbar.
# Line 191  class MainWindow(wxFrame): Line 195  class MainWindow(wxFrame):
195                                  isToggle = command.IsCheckCommand())                                  isToggle = command.IsCheckCommand())
196                  self.bind_command_events(command, ID)                  self.bind_command_events(command, ID)
197              else:              else:
198                  print "Unknown command %s" % name                  print _("Unknown command %s") % name
199    
200        def Context(self):
201            """Return the context object for a command invoked from this window
202            """
203            return Context(self.application, self.application.Session(), self)
204    
205      def invoke_command(self, event):      def invoke_command(self, event):
206          name = self.id_to_name.get(event.GetId())          name = self.id_to_name.get(event.GetId())
207          if name is not None:          if name is not None:
208              command = registry.Command(name)              command = registry.Command(name)
209              context = Context(self.application, self.application.Session(),              command.Execute(self.Context())
                               self)  
             command.Execute(context)  
210          else:          else:
211              print "Unknown command ID %d" % event.GetId()              print _("Unknown command ID %d") % event.GetId()
212    
213      def update_command_ui(self, event):      def update_command_ui(self, event):
214          #print "update_command_ui", self.id_to_name[event.GetId()]          #print "update_command_ui", self.id_to_name[event.GetId()]
215          context = Context(self.application, self.application.Session(), self)          context = self.Context()
216          command = registry.Command(self.id_to_name[event.GetId()])          command = registry.Command(self.id_to_name[event.GetId()])
217          if command is not None:          if command is not None:
218              event.Enable(command.Sensitive(context))              sensitive = command.Sensitive(context)
219                event.Enable(sensitive)
220                if command.IsTool() and not sensitive and command.Checked(context):
221                    # When a checked tool command is disabled deselect all
222                    # tools. Otherwise the tool would remain active but it
223                    # might lead to errors if the tools stays active. This
224                    # problem occurred in GREAT-ER and this fixes it, but
225                    # it's not clear to me whether this is really the best
226                    # way to do it (BH, 20021206).
227                    self.canvas.SelectTool(None)
228              event.SetText(command.DynText(context))              event.SetText(command.DynText(context))
229              if command.IsCheckCommand():              if command.IsCheckCommand():
230                  event.Check(command.Checked(context))                      event.Check(command.Checked(context))
231    
232      def RunMessageBox(self, title, text, flags = wxOK | wxICON_INFORMATION):      def RunMessageBox(self, title, text, flags = wxOK | wxICON_INFORMATION):
233          """Run a modal message box with the given text, title and flags          """Run a modal message box with the given text, title and flags
234          and return the result"""          and return the result"""
235          dlg = wxMessageDialog(self, text, title, flags)          dlg = wxMessageDialog(self, text, title, flags)
236            dlg.CenterOnParent()
237          result = dlg.ShowModal()          result = dlg.ShowModal()
238          dlg.Destroy()          dlg.Destroy()
239          return result          return result
# Line 230  class MainWindow(wxFrame): Line 247  class MainWindow(wxFrame):
247    
248      def add_dialog(self, name, dialog):      def add_dialog(self, name, dialog):
249          if self.dialogs.has_key(name):          if self.dialogs.has_key(name):
250              raise RuntimeError("The Dialog named %s is already open" % name)              raise RuntimeError(_("The Dialog named %s is already open") % name)
251          self.dialogs[name] = dialog          self.dialogs[name] = dialog
252    
253      def dialog_open(self, name):      def dialog_open(self, name):
# Line 248  class MainWindow(wxFrame): Line 265  class MainWindow(wxFrame):
265              text = "(%10.10g, %10.10g)" % pos              text = "(%10.10g, %10.10g)" % pos
266          else:          else:
267              text = ""              text = ""
268            self.set_position_text(text)
269    
270        def set_position_text(self, text):
271            """Set the statusbar text showing the current position.
272    
273            By default the text is shown in field 0 of the status bar.
274            Override this method in derived classes to put it into a
275            different field of the statusbar.
276            """
277          self.SetStatusText(text)          self.SetStatusText(text)
278    
279      def save_modified_session(self, can_veto = 1):      def save_modified_session(self, can_veto = 1):
# Line 263  class MainWindow(wxFrame): Line 289  class MainWindow(wxFrame):
289              flags = wxYES_NO | wxICON_QUESTION              flags = wxYES_NO | wxICON_QUESTION
290              if can_veto:              if can_veto:
291                  flags = flags | wxCANCEL                  flags = flags | wxCANCEL
292              result = self.RunMessageBox("Exit",              result = self.RunMessageBox(_("Exit"),
293                                          ("The session has been modified."                                          _("The session has been modified."
294                                           " Do you want to save it?"),                                           " Do you want to save it?"),
295                                          flags)                                          flags)
296              if result == wxID_YES:              if result == wxID_YES:
# Line 273  class MainWindow(wxFrame): Line 299  class MainWindow(wxFrame):
299              result = wxID_NO              result = wxID_NO
300          return result          return result
301    
302        def prepare_new_session(self):
303            for d in self.dialogs.values():
304                if not isinstance(d, tree.SessionTreeView):
305                    d.Close()
306    
307      def NewSession(self):      def NewSession(self):
308          self.save_modified_session()          self.save_modified_session()
309            self.prepare_new_session()
310          self.application.SetSession(create_empty_session())          self.application.SetSession(create_empty_session())
311    
312      def OpenSession(self):      def OpenSession(self):
313          self.save_modified_session()          self.save_modified_session()
314          dlg = wxFileDialog(self, "Select a session file", ".", "",          dlg = wxFileDialog(self, _("Open Session"), ".", "", "*.thuban", wxOPEN)
                            "*.thuban", wxOPEN)  
315          if dlg.ShowModal() == wxID_OK:          if dlg.ShowModal() == wxID_OK:
316                self.prepare_new_session()
317              self.application.OpenSession(dlg.GetPath())              self.application.OpenSession(dlg.GetPath())
318          dlg.Destroy()          dlg.Destroy()
319    
320      def SaveSession(self):      def SaveSession(self):
321          if self.application.session.filename == None:          if self.application.session.filename == None:
322              self.SaveSessionAs()              self.SaveSessionAs()
323          self.application.SaveSession()          else:
324                self.application.SaveSession()
325    
326      def SaveSessionAs(self):      def SaveSessionAs(self):
327          dlg = wxFileDialog(self, "Enter a filename for session", ".", "",          dlg = wxFileDialog(self, _("Save Session As"), ".", "",
328                             "*.thuban", wxOPEN)                             "*.thuban", wxOPEN)
329          if dlg.ShowModal() == wxID_OK:          if dlg.ShowModal() == wxID_OK:
330              self.application.session.SetFilename(dlg.GetPath())              self.application.session.SetFilename(dlg.GetPath())
# Line 306  class MainWindow(wxFrame): Line 339  class MainWindow(wxFrame):
339          if result == wxID_CANCEL:          if result == wxID_CANCEL:
340              event.Veto()              event.Veto()
341          else:          else:
342                # FIXME: it would be better to tie the unsubscription to
343                # wx's destroy event, but that isn't implemented for wxGTK
344                # yet.
345                self.canvas.Unsubscribe(VIEW_POSITION, self.view_position_changed)
346              self.Destroy()              self.Destroy()
347    
348      def SetMap(self, map):      def SetMap(self, map):
349          self.canvas.SetMap(map)          self.canvas.SetMap(map)
350    
351        def Map(self):
352            """Return the map displayed by this mainwindow"""
353            return self.canvas.Map()
354    
355      def ShowSessionTree(self):      def ShowSessionTree(self):
356          name = "session_tree"          name = "session_tree"
357          dialog = self.get_open_dialog(name)          dialog = self.get_open_dialog(name)
358          if dialog is None:          if dialog is None:
359              dialog = tree.SessionTreeView(self, self.application, name)              dialog = tree.SessionTreeView(self, self.application, name)
360              self.add_dialog(name, dialog)              self.add_dialog(name, dialog)
361              dialog.Show(true)              dialog.Show(True)
362          else:          else:
363              # FIXME: bring dialog to front here              # FIXME: bring dialog to front here
364              pass              pass
365    
366    
367      def About(self):      def About(self):
368          self.RunMessageBox("About",          self.RunMessageBox(_("About"),
369                             ("Thuban is a program for\n"                             _("Thuban v%s\n"
370                                #"Build Date: %s\n"
371                                "\n"
372                                "Thuban is a program for\n"
373                              "exploring geographic data.\n"                              "exploring geographic data.\n"
374                              "Copyright (C) 2001 Intevation GmbH.\n"                              "Copyright (C) 2001-2003 Intevation GmbH.\n"
375                              "Thuban is licensed under the GPL"),                              "Thuban is licensed under the GNU GPL"
376                               % __ThubanVersion__), #__BuildDate__)),
377                             wxOK | wxICON_INFORMATION)                             wxOK | wxICON_INFORMATION)
378    
379      def AddLayer(self):      def AddLayer(self):
380          dlg = wxFileDialog(self, "Select a data file", ".", "", "*.*",          dlg = wxFileDialog(self, _("Select a data file"), ".", "", "*.*",
381                             wxOPEN)                             wxOPEN)
382          if dlg.ShowModal() == wxID_OK:          if dlg.ShowModal() == wxID_OK:
383              filename = dlg.GetPath()              filename = dlg.GetPath()
# Line 343  class MainWindow(wxFrame): Line 389  class MainWindow(wxFrame):
389                  map.AddLayer(layer)                  map.AddLayer(layer)
390              except IOError:              except IOError:
391                  # the layer couldn't be opened                  # the layer couldn't be opened
392                  self.RunMessageBox("Add Layer",                  self.RunMessageBox(_("Add Layer"),
393                                     "Can't open the file '%s'." % filename)                                     _("Can't open the file '%s'.") % filename)
394              else:              else:
395                  if not has_layers:                  if not has_layers:
396                      # if we're adding a layer to an empty map, for the                      # if we're adding a layer to an empty map, for the
# Line 357  class MainWindow(wxFrame): Line 403  class MainWindow(wxFrame):
403          if layer is not None:          if layer is not None:
404              self.canvas.Map().RemoveLayer(layer)              self.canvas.Map().RemoveLayer(layer)
405    
406        def CanRemoveLayer(self):
407            """Return true if the currently selected layer can be deleted.
408    
409            If no layer is selected return false.
410    
411            The return value of this method determines whether the remove
412            layer command is sensitive in menu.
413            """
414            layer = self.current_layer()
415            if layer is not None:
416                return self.canvas.Map().CanRemoveLayer(layer)
417            return 0
418    
419      def RaiseLayer(self):      def RaiseLayer(self):
420          layer = self.current_layer()          layer = self.current_layer()
421          if layer is not None:          if layer is not None:
# Line 399  class MainWindow(wxFrame): Line 458  class MainWindow(wxFrame):
458          if layer is not None:          if layer is not None:
459              color = self.choose_color()              color = self.choose_color()
460              if color is not None:              if color is not None:
461                  layer.SetFill(color)                  layer.GetClassification().SetDefaultFill(color)
462    
463      def LayerTransparentFill(self):      def LayerTransparentFill(self):
464          layer = self.current_layer()          layer = self.current_layer()
465          if layer is not None:          if layer is not None:
466              layer.SetFill(None)              layer.GetClassification().SetDefaultFill(Color.None)
467    
468      def LayerOutlineColor(self):      def LayerOutlineColor(self):
469          layer = self.current_layer()          layer = self.current_layer()
470          if layer is not None:          if layer is not None:
471              color = self.choose_color()              color = self.choose_color()
472              if color is not None:              if color is not None:
473                  layer.SetStroke(color)                  layer.GetClassification().SetDefaultLineColor(color)
474    
475      def LayerNoOutline(self):      def LayerNoOutline(self):
476          layer = self.current_layer()          layer = self.current_layer()
477          if layer is not None:          if layer is not None:
478              layer.SetStroke(None)              layer.GetClassification().SetDefaultLineColor(Color.None)
479    
480      def HideLayer(self):      def HideLayer(self):
481          layer = self.current_layer()          layer = self.current_layer()
# Line 436  class MainWindow(wxFrame): Line 495  class MainWindow(wxFrame):
495              dialog = self.get_open_dialog(name)              dialog = self.get_open_dialog(name)
496              if dialog is None:              if dialog is None:
497                  dialog = tableview.LayerTableFrame(self, self.interactor, name,                  dialog = tableview.LayerTableFrame(self, self.interactor, name,
498                                                     "Table: %s" % layer.Title(),                                                     _("Table: %s") % layer.Title(),
499                                                     layer, table)                                                     layer, table)
500                  self.add_dialog(name, dialog)                  self.add_dialog(name, dialog)
501                  dialog.Show(true)                  dialog.Show(true)
# Line 461  class MainWindow(wxFrame): Line 520  class MainWindow(wxFrame):
520              map.SetProjection(proj)              map.SetProjection(proj)
521          proj4Dlg.Destroy()          proj4Dlg.Destroy()
522    
523        def Classify(self):
524    
525            #
526            # the menu option for this should only be available if there
527            # is a current layer, so we don't need to check if the
528            # current layer is None
529            #
530    
531            layer = self.current_layer()
532            name = "classifier" + str(id(layer))
533            dialog = self.get_open_dialog(name)
534    
535            if dialog is None:
536                dialog = classifier.Classifier(self, self.interactor,
537                                               name, self.current_layer())
538                self.add_dialog(name, dialog)
539                dialog.Show()
540    
541      def ZoomInTool(self):      def ZoomInTool(self):
542          self.canvas.ZoomInTool()          self.canvas.ZoomInTool()
543    
# Line 523  def make_check_current_tool(toolname): Line 600  def make_check_current_tool(toolname):
600      return check_current_tool      return check_current_tool
601    
602  def _tool_command(name, title, method, toolname, helptext = "",  def _tool_command(name, title, method, toolname, helptext = "",
603                    icon = ""):                    icon = "", sensitive = None):
604      """Add a tool command"""      """Add a tool command"""
605      registry.Add(Command(name, title, call_method, args=(method,),      registry.Add(ToolCommand(name, title, call_method, args=(method,),
606                           helptext = helptext, icon = icon,                               helptext = helptext, icon = icon,
607                           checked = make_check_current_tool(toolname)))                               checked = make_check_current_tool(toolname),
608                                 sensitive = sensitive))
609    
610  def _has_selected_layer(context):  def _has_selected_layer(context):
611      """Return true if a layer is selected in the context"""      """Return true if a layer is selected in the context"""
612      return context.mainwindow.has_selected_layer()      return context.mainwindow.has_selected_layer()
613    
614    def _can_remove_layer(context):
615        return context.mainwindow.CanRemoveLayer()
616    
617  def _has_tree_window_shown(context):  def _has_tree_window_shown(context):
618      """Return true if the tree window is shown"""      """Return true if the tree window is shown"""
619      return context.mainwindow.get_open_dialog("session_tree") is None      return context.mainwindow.get_open_dialog("session_tree") is None
620    
621    def _has_visible_map(context):
622        """Return true iff theres a visible map in the mainwindow.
623    
624        A visible map is a map with at least one visible layer."""
625        map = context.mainwindow.Map()
626        if map is not None:
627            for layer in map.Layers():
628                if layer.Visible():
629                    return 1
630        return 0
631    
632    
633  # File menu  # File menu
634  _method_command("new_session", "&New Session", "NewSession")  _method_command("new_session", _("&New Session"), "NewSession")
635  _method_command("open_session", "&Open Session", "OpenSession")  _method_command("open_session", _("&Open Session"), "OpenSession")
636  _method_command("save_session", "&Save Session", "SaveSession")  _method_command("save_session", _("&Save Session"), "SaveSession")
637  _method_command("save_session_as", "Save Session &As", "SaveSessionAs")  _method_command("save_session_as", _("Save Session &As"), "SaveSessionAs")
638  _method_command("show_session_tree", "Show Session &Tree", "ShowSessionTree",  _method_command("show_session_tree", _("Show Session &Tree"), "ShowSessionTree",
639                  sensitive = _has_tree_window_shown)                  sensitive = _has_tree_window_shown)
640  _method_command("exit", "&Exit", "Exit")  _method_command("exit", _("E&xit"), "Exit")
641    
642  # Help menu  # Help menu
643  _method_command("help_about", "&About", "About")  _method_command("help_about", _("&About"), "About")
644    
645    
646  # Map menu  # Map menu
647  _method_command("map_projection", "Pro&jection", "Projection")  _method_command("map_projection", _("Pro&jection"), "Projection")
648    
649  _tool_command("map_zoom_in_tool", "&Zoom in", "ZoomInTool", "ZoomInTool",  _tool_command("map_zoom_in_tool", _("&Zoom in"), "ZoomInTool", "ZoomInTool",
650                helptext = "Switch to map-mode 'zoom-in'", icon = "zoom_in")                helptext = _("Switch to map-mode 'zoom-in'"), icon = "zoom_in",
651  _tool_command("map_zoom_out_tool", "Zoom &out", "ZoomOutTool", "ZoomOutTool",                sensitive = _has_visible_map)
652                helptext = "Switch to map-mode 'zoom-out'", icon = "zoom_out")  _tool_command("map_zoom_out_tool", _("Zoom &out"), "ZoomOutTool", "ZoomOutTool",
653  _tool_command("map_pan_tool", "&Pan", "PanTool", "PanTool",                helptext = _("Switch to map-mode 'zoom-out'"), icon = "zoom_out",
654                helptext = "Switch to map-mode 'pan'", icon = "pan")                sensitive = _has_visible_map)
655  _tool_command("map_identify_tool", "&Identify", "IdentifyTool", "IdentifyTool",  _tool_command("map_pan_tool", _("&Pan"), "PanTool", "PanTool",
656                helptext = "Switch to map-mode 'identify'", icon = "identify")                helptext = _("Switch to map-mode 'pan'"), icon = "pan",
657  _tool_command("map_label_tool", "&Label", "LabelTool", "LabelTool",                sensitive = _has_visible_map)
658                helptext = "Add/Remove labels", icon = "label")  _tool_command("map_identify_tool", _("&Identify"), "IdentifyTool",
659  _method_command("map_full_extent", "&Full extent", "FullExtent",                "IdentifyTool",
660                 helptext = "Full Extent", icon = "fullextent")                helptext = _("Switch to map-mode 'identify'"), icon = "identify",
661  _method_command("map_print", "Prin&t", "PrintMap", helptext = "Print the map")                sensitive = _has_visible_map)
662    _tool_command("map_label_tool", _("&Label"), "LabelTool", "LabelTool",
663                  helptext = _("Add/Remove labels"), icon = "label",
664                  sensitive = _has_visible_map)
665    _method_command("map_full_extent", _("&Full extent"), "FullExtent",
666                   helptext = _("Full Extent"), icon = "fullextent",
667                  sensitive = _has_visible_map)
668    _method_command("map_print", _("Prin&t"), "PrintMap",
669                    helptext = _("Print the map"))
670    
671  # Layer menu  # Layer menu
672  _method_command("layer_add", "&Add Layer", "AddLayer",  _method_command("layer_add", _("&Add Layer"), "AddLayer",
673                  helptext = "Add a new layer to active map")                  helptext = _("Add a new layer to active map"))
674  _method_command("layer_remove", "&Remove Layer", "RemoveLayer",  _method_command("layer_remove", _("&Remove Layer"), "RemoveLayer",
675                  helptext = "Remove selected layer(s)",                  helptext = _("Remove selected layer(s)"),
676                  sensitive = _has_selected_layer)                  sensitive = _can_remove_layer)
677  _method_command("layer_fill_color", "&Fill Color", "LayerFillColor",  _method_command("layer_fill_color", _("&Fill Color"), "LayerFillColor",
678                  helptext = "Set the fill color of selected layer(s)",                  helptext = _("Set the fill color of selected layer(s)"),
679                  sensitive = _has_selected_layer)                  sensitive = _has_selected_layer)
680  _method_command("layer_transparent_fill", "&Transparent Fill",  _method_command("layer_transparent_fill", _("&Transparent Fill"),
681                  "LayerTransparentFill",                  "LayerTransparentFill",
682                  helptext = "Do not fill the selected layer(s)",                  helptext = _("Do not fill the selected layer(s)"),
683                  sensitive = _has_selected_layer)                  sensitive = _has_selected_layer)
684  _method_command("layer_outline_color", "&Outline Color", "LayerOutlineColor",  _method_command("layer_outline_color", _("&Outline Color"), "LayerOutlineColor",
685                  helptext = "Set the outline color of selected layer(s)",                  helptext = _("Set the outline color of selected layer(s)"),
686                  sensitive = _has_selected_layer)                  sensitive = _has_selected_layer)
687  _method_command("layer_no_outline", "&No Outline", "LayerNoOutline",  _method_command("layer_no_outline", _("&No Outline"), "LayerNoOutline",
688                  helptext = "Do not draw the outline of the selected layer(s)",                  helptext= _("Do not draw the outline of the selected layer(s)"),
689                  sensitive = _has_selected_layer)                  sensitive = _has_selected_layer)
690  _method_command("layer_raise", "&Raise", "RaiseLayer",  _method_command("layer_raise", _("&Raise"), "RaiseLayer",
691                  helptext = "Raise selected layer(s)",                  helptext = _("Raise selected layer(s)"),
692                  sensitive = _has_selected_layer)                  sensitive = _has_selected_layer)
693  _method_command("layer_lower", "&Lower", "LowerLayer",  _method_command("layer_lower", _("&Lower"), "LowerLayer",
694                  helptext = "Lower selected layer(s)",                  helptext = _("Lower selected layer(s)"),
695                  sensitive = _has_selected_layer)                  sensitive = _has_selected_layer)
696  _method_command("layer_show", "&Show", "ShowLayer",  _method_command("layer_show", _("&Show"), "ShowLayer",
697                  helptext = "Make selected layer(s) visible",                  helptext = _("Make selected layer(s) visible"),
698                  sensitive = _has_selected_layer)                  sensitive = _has_selected_layer)
699  _method_command("layer_hide", "&Hide", "HideLayer",  _method_command("layer_hide", _("&Hide"), "HideLayer",
700                  helptext = "Make selected layer(s) unvisible",                  helptext = _("Make selected layer(s) unvisible"),
701                  sensitive = _has_selected_layer)                  sensitive = _has_selected_layer)
702  _method_command("layer_show_table", "Show Ta&ble", "LayerShowTable",  _method_command("layer_show_table", _("Show Ta&ble"), "LayerShowTable",
703                  helptext = "Show the selected layer's table",                  helptext = _("Show the selected layer's table"),
704                  sensitive = _has_selected_layer)                  sensitive = _has_selected_layer)
705    
706    _method_command("layer_classifier", _("Classify"), "Classify",
707                    sensitive = _has_selected_layer)
708    
709  # the menu structure  # the menu structure
710  main_menu = Menu("<main>", "<main>",  main_menu = Menu("<main>", "<main>",
711                   [Menu("file", "&File",                   [Menu("file", _("&File"),
712                         ["new_session", "open_session", None,                         ["new_session", "open_session", None,
713                          "save_session", "save_session_as", None,                          "save_session", "save_session_as", None,
714                          "show_session_tree", None,                          "show_session_tree", None,
715                          "exit"]),                          "exit"]),
716                    Menu("map", "&Map",                    Menu("map", _("&Map"),
717                         ["layer_add", "layer_remove",                         ["layer_add", "layer_remove",
718                          None,                          None,
719                          "map_projection",                          "map_projection",
# Line 621  main_menu = Menu("<main>", "<main>", Line 724  main_menu = Menu("<main>", "<main>",
724                          "map_full_extent",                          "map_full_extent",
725                          None,                          None,
726                          "map_print"]),                          "map_print"]),
727                    Menu("layer", "&Layer",                    Menu("layer", _("&Layer"),
728                         ["layer_fill_color", "layer_transparent_fill",                         ["layer_fill_color", "layer_transparent_fill",
729                          "layer_outline_color", "layer_no_outline",                          "layer_outline_color", "layer_no_outline",
730                          None,                          None,
# Line 629  main_menu = Menu("<main>", "<main>", Line 732  main_menu = Menu("<main>", "<main>",
732                          None,                          None,
733                          "layer_show", "layer_hide",                          "layer_show", "layer_hide",
734                          None,                          None,
735                          "layer_show_table"]),                          "layer_show_table",
736                    Menu("help", "&Help",                          None,
737                            "layer_classifier"]),
738                      Menu("help", _("&Help"),
739                         ["help_about"])])                         ["help_about"])])
740    
741  # the main toolbar  # the main toolbar
742    
743  main_toolbar = Menu("<toolbar>", "<toolbar>",  main_toolbar = Menu("<toolbar>", "<toolbar>",
744                      ["map_zoom_in_tool", "map_zoom_out_tool", "map_pan_tool",                      ["map_zoom_in_tool", "map_zoom_out_tool", "map_pan_tool",
745                       "map_identify_tool", "map_label_tool", "map_full_extent"])                       "map_full_extent", None,
746                         "map_identify_tool", "map_label_tool"])

Legend:
Removed from v.278  
changed lines
  Added in v.517

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26