/[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 573 by jonathan, Fri Mar 28 17:07:06 2003 UTC revision 621 by jonathan, Mon Apr 7 10:14:50 2003 UTC
# Line 101  class MainWindow(DockFrame): Line 101  class MainWindow(DockFrame):
101    
102          self.init_dialogs()          self.init_dialogs()
103    
104          EVT_CLOSE(self, self.OnClose)          EVT_CLOSE(self, self._OnClose)
105    
106      def Subscribe(self, channel, *args):      def Subscribe(self, channel, *args):
107          """Subscribe a function to a message channel.          """Subscribe a function to a message channel.
# Line 387  class MainWindow(DockFrame): Line 387  class MainWindow(DockFrame):
387          dlg.Destroy()          dlg.Destroy()
388    
389      def Exit(self):      def Exit(self):
390          self.Close(false)          self.Close(False)
391    
392      def OnClose(self, event):      def _OnClose(self, event):
393          result = self.save_modified_session(can_veto = event.CanVeto())          result = self.save_modified_session(can_veto = event.CanVeto())
394          if result == wxID_CANCEL:          if result == wxID_CANCEL:
395              event.Veto()              event.Veto()
# Line 398  class MainWindow(DockFrame): Line 398  class MainWindow(DockFrame):
398              # wx's destroy event, but that isn't implemented for wxGTK              # wx's destroy event, but that isn't implemented for wxGTK
399              # yet.              # yet.
400              self.canvas.Unsubscribe(VIEW_POSITION, self.view_position_changed)              self.canvas.Unsubscribe(VIEW_POSITION, self.view_position_changed)
401                DockFrame._OnClose(self, event)
402              self.Destroy()              self.Destroy()
403    
404      def SetMap(self, map):      def SetMap(self, map):
# Line 466  class MainWindow(DockFrame): Line 467  class MainWindow(DockFrame):
467      def CanRemoveLayer(self):      def CanRemoveLayer(self):
468          """Return true if the currently selected layer can be deleted.          """Return true if the currently selected layer can be deleted.
469    
470          If no layer is selected return false.          If no layer is selected return False.
471    
472          The return value of this method determines whether the remove          The return value of this method determines whether the remove
473          layer command is sensitive in menu.          layer command is sensitive in menu.
# Line 474  class MainWindow(DockFrame): Line 475  class MainWindow(DockFrame):
475          layer = self.current_layer()          layer = self.current_layer()
476          if layer is not None:          if layer is not None:
477              return self.canvas.Map().CanRemoveLayer(layer)              return self.canvas.Map().CanRemoveLayer(layer)
478          return 0          return False
479    
480      def RaiseLayer(self):      def RaiseLayer(self):
481          layer = self.current_layer()          layer = self.current_layer()
# Line 523  class MainWindow(DockFrame): Line 524  class MainWindow(DockFrame):
524      def LayerTransparentFill(self):      def LayerTransparentFill(self):
525          layer = self.current_layer()          layer = self.current_layer()
526          if layer is not None:          if layer is not None:
527              layer.GetClassification().SetDefaultFill(Color.None)              layer.GetClassification().SetDefaultFill(Color.Transparent)
528    
529      def LayerOutlineColor(self):      def LayerOutlineColor(self):
530          layer = self.current_layer()          layer = self.current_layer()
# Line 535  class MainWindow(DockFrame): Line 536  class MainWindow(DockFrame):
536      def LayerNoOutline(self):      def LayerNoOutline(self):
537          layer = self.current_layer()          layer = self.current_layer()
538          if layer is not None:          if layer is not None:
539              layer.GetClassification().SetDefaultLineColor(Color.None)              layer.GetClassification().SetDefaultLineColor(Color.Transparent)
540    
541      def HideLayer(self):      def HideLayer(self):
542          layer = self.current_layer()          layer = self.current_layer()
# Line 602  class MainWindow(DockFrame): Line 603  class MainWindow(DockFrame):
603          dialog.Raise()          dialog.Raise()
604    
605    
606      def ShowLegend(self, switch = False):      def ShowLegend(self):
607          name = "legend"          name = "legend"
608          dialog = self.FindRegisteredDock(name)          dialog = self.FindRegisteredDock(name)
609    
# Line 610  class MainWindow(DockFrame): Line 611  class MainWindow(DockFrame):
611              title = "Legend: %s" % self.Map().Title()              title = "Legend: %s" % self.Map().Title()
612              dialog = self.CreateDock(name, -1, title, wxLAYOUT_LEFT)              dialog = self.CreateDock(name, -1, title, wxLAYOUT_LEFT)
613              legend.LegendPanel(dialog, None, self)              legend.LegendPanel(dialog, None, self)
614                dialog.Dock()
615    
616          dialog.GetPanel().SetMap(self.Map())          dialog.GetPanel().SetMap(self.Map())
617          dialog.Show()          dialog.Show()
# Line 715  _method_command("new_session", _("&New S Line 717  _method_command("new_session", _("&New S
717  _method_command("open_session", _("&Open Session"), "OpenSession")  _method_command("open_session", _("&Open Session"), "OpenSession")
718  _method_command("save_session", _("&Save Session"), "SaveSession")  _method_command("save_session", _("&Save Session"), "SaveSession")
719  _method_command("save_session_as", _("Save Session &As"), "SaveSessionAs")  _method_command("save_session_as", _("Save Session &As"), "SaveSessionAs")
720  _method_command("show_session_tree", _("Show Session &Tree"), "ShowSessionTree",  _method_command("show_session_tree", _("Session &Tree"), "ShowSessionTree",
721                  sensitive = _has_tree_window_shown)                  sensitive = _has_tree_window_shown)
722    _method_command("show_legend", _("Legend"), "ShowLegend",
723                    sensitive = _has_legend_shown)
724  _method_command("exit", _("E&xit"), "Exit")  _method_command("exit", _("E&xit"), "Exit")
725    
726  # Help menu  # Help menu
# Line 784  _method_command("layer_show_table", _("S Line 788  _method_command("layer_show_table", _("S
788                  sensitive = _has_selected_layer)                  sensitive = _has_selected_layer)
789  _method_command("layer_classifier", _("Classify"), "Classify",  _method_command("layer_classifier", _("Classify"), "Classify",
790                  sensitive = _has_selected_layer)                  sensitive = _has_selected_layer)
 _method_command("show_legend", _("Show Legend"), "ShowLegend",  
                 sensitive = _has_legend_shown)  
791    
792  # the menu structure  # the menu structure
793  main_menu = Menu("<main>", "<main>",  main_menu = Menu("<main>", "<main>",
794                   [Menu("file", _("&File"),                   [Menu("file", _("&File"),
795                         ["new_session", "open_session", None,                         ["new_session", "open_session", None,
796                          "save_session", "save_session_as", None,                          "save_session", "save_session_as", None,
797                          "show_session_tree", None,                          "show_session_tree",
798                          "show_legend", None,                          "show_legend", None,
799                          "exit"]),                          "exit"]),
800                    Menu("map", _("&Map"),                    Menu("map", _("&Map"),

Legend:
Removed from v.573  
changed lines
  Added in v.621

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26