/[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 640 by jonathan, Thu Apr 10 14:36:08 2003 UTC revision 653 by jonathan, Fri Apr 11 14:28:29 2003 UTC
# Line 40  from messages import LAYER_SELECTED, SHA Line 40  from messages import LAYER_SELECTED, SHA
40    
41  from Thuban.UI.dock import DockableWindow, DockFrame, DockPanel  from Thuban.UI.dock import DockableWindow, DockFrame, DockPanel
42    
43    import resource
44    
45    
46  # the directory where the toolbar icons are stored  # the directory where the toolbar icons are stored
47  bitmapdir = os.path.join(Thuban.__path__[0], os.pardir, "Resources", "Bitmaps")  bitmapdir = os.path.join(Thuban.__path__[0], os.pardir, "Resources", "Bitmaps")
# Line 243  class MainWindow(DockFrame): Line 245  class MainWindow(DockFrame):
245              command = registry.Command(name)              command = registry.Command(name)
246              if command is not None:              if command is not None:
247                  ID = self.get_id(name)                  ID = self.get_id(name)
248                  filename = os.path.join(bitmapdir, command.Icon()) + bitmapext                  bitmap = resource.GetBitmapResource(command.Icon(),
249                  bitmap = wxBitmap(filename, wxBITMAP_TYPE_XPM)                                                      wxBITMAP_TYPE_XPM)
250                  toolbar.AddTool(ID, bitmap,                  toolbar.AddTool(ID, bitmap,
251                                  shortHelpString = command.HelpText(),                                  shortHelpString = command.HelpText(),
252                                  isToggle = command.IsCheckCommand())                                  isToggle = command.IsCheckCommand())
# Line 403  class MainWindow(DockFrame): Line 405  class MainWindow(DockFrame):
405    
406      def SetMap(self, map):      def SetMap(self, map):
407          self.canvas.SetMap(map)          self.canvas.SetMap(map)
408          self.SetTitle("Thuban - " + map.Title())          self.__SetTitle(map.Title())
409          #self.legendPanel.SetMap(map)          #self.legendPanel.SetMap(map)
410    
411      def Map(self):      def Map(self):
# Line 628  class MainWindow(DockFrame): Line 630  class MainWindow(DockFrame):
630      def PrintMap(self):      def PrintMap(self):
631          self.canvas.Print()          self.canvas.Print()
632    
633        def RenameMap(self):
634            dlg = wxTextEntryDialog(self, "Map Title: ", "Rename Map",
635                                    self.Map().Title())
636            if dlg.ShowModal() == wxID_OK:
637                title = dlg.GetValue()
638                if title != "":
639                    self.Map().SetTitle(title)
640                    self.__SetTitle(title)
641    
642            dlg.Destroy()
643    
644      def identify_view_on_demand(self, layer, shapes):      def identify_view_on_demand(self, layer, shapes):
645          name = "identify_view"          name = "identify_view"
646          if self.canvas.CurrentTool() == "IdentifyTool":          if self.canvas.CurrentTool() == "IdentifyTool":
# Line 639  class MainWindow(DockFrame): Line 652  class MainWindow(DockFrame):
652                  # FIXME: bring dialog to front?                  # FIXME: bring dialog to front?
653                  pass                  pass
654    
655        def __SetTitle(self, title):
656            self.SetTitle("Thuban - " + title)
657    
658  #  #
659  # Define all the commands available in the main window  # Define all the commands available in the main window
660  #  #
# Line 741  _method_command("map_full_extent", _("&F Line 757  _method_command("map_full_extent", _("&F
757                sensitive = _has_visible_map)                sensitive = _has_visible_map)
758  _method_command("map_print", _("Prin&t"), "PrintMap",  _method_command("map_print", _("Prin&t"), "PrintMap",
759                  helptext = _("Print the map"))                  helptext = _("Print the map"))
760    _method_command("map_rename", _("&Rename"), "RenameMap",
761                    helptext = _("Rename the map"))
762    
763  # Layer menu  # Layer menu
764  _method_command("layer_add", _("&Add Layer"), "AddLayer",  _method_command("layer_add", _("&Add Layer"), "AddLayer",
# Line 785  main_menu = Menu("<main>", "<main>", Line 803  main_menu = Menu("<main>", "<main>",
803                          None,                          None,
804                          "toggle_legend",                          "toggle_legend",
805                          None,                          None,
806                          "map_print"]),                          "map_print",
807                            None,
808                            "map_rename"]),
809                    Menu("layer", _("&Layer"),                    Menu("layer", _("&Layer"),
810                          ["layer_raise", "layer_lower",                          ["layer_raise", "layer_lower",
811                          None,                          None,

Legend:
Removed from v.640  
changed lines
  Added in v.653

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26