/[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 633 by jonathan, Wed Apr 9 10:11:07 2003 UTC revision 640 by jonathan, Thu Apr 10 14:36:08 2003 UTC
# Line 403  class MainWindow(DockFrame): Line 403  class MainWindow(DockFrame):
403    
404      def SetMap(self, map):      def SetMap(self, map):
405          self.canvas.SetMap(map)          self.canvas.SetMap(map)
406            self.SetTitle("Thuban - " + map.Title())
407          #self.legendPanel.SetMap(map)          #self.legendPanel.SetMap(map)
408    
409      def Map(self):      def Map(self):
# Line 517  class MainWindow(DockFrame): Line 518  class MainWindow(DockFrame):
518          dlg.Destroy()          dlg.Destroy()
519          return color          return color
520    
     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.Transparent)  
   
     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.Transparent)  
   
521      def HideLayer(self):      def HideLayer(self):
522          layer = self.current_layer()          layer = self.current_layer()
523          if layer is not None:          if layer is not None:
# Line 584  class MainWindow(DockFrame): Line 561  class MainWindow(DockFrame):
561              map.SetProjection(proj)              map.SetProjection(proj)
562          proj4Dlg.Destroy()          proj4Dlg.Destroy()
563    
564      def Classify(self):      def LayerEditProperties(self):
565    
566          #          #
567          # the menu option for this should only be available if there          # the menu option for this should only be available if there
# Line 593  class MainWindow(DockFrame): Line 570  class MainWindow(DockFrame):
570          #          #
571    
572          layer = self.current_layer()          layer = self.current_layer()
573          self.OpenClassifier(layer)          self.OpenLayerProperties(layer)
574    
575      def OpenClassifier(self, layer, group = None):      def OpenLayerProperties(self, layer, group = None):
576          name = "classifier" + str(id(layer))          name = "layer_properties" + str(id(layer))
577          dialog = self.get_open_dialog(name)          dialog = self.get_open_dialog(name)
578    
579          if dialog is None:          if dialog is None:
# Line 616  class MainWindow(DockFrame): Line 593  class MainWindow(DockFrame):
593          dialog = self.FindRegisteredDock(name)          dialog = self.FindRegisteredDock(name)
594    
595          if dialog is None:          if dialog is None:
596              title = "Legend: %s" % self.Map().Title()              dialog = self.CreateDock(name, -1, _("Legend"), wxLAYOUT_LEFT)
             dialog = self.CreateDock(name, -1, title, wxLAYOUT_LEFT)  
597              legend.LegendPanel(dialog, None, self)              legend.LegendPanel(dialog, None, self)
598              dialog.Dock()              dialog.Dock()
599              dialog.GetPanel().SetMap(self.Map())              dialog.GetPanel().SetMap(self.Map())
# Line 772  _method_command("layer_add", _("&Add Lay Line 748  _method_command("layer_add", _("&Add Lay
748  _method_command("layer_remove", _("&Remove Layer"), "RemoveLayer",  _method_command("layer_remove", _("&Remove Layer"), "RemoveLayer",
749                  helptext = _("Remove selected layer(s)"),                  helptext = _("Remove selected layer(s)"),
750                  sensitive = _can_remove_layer)                  sensitive = _can_remove_layer)
 _method_command("layer_fill_color", _("&Fill Color"), "LayerFillColor",  
                 helptext = _("Set the fill color of selected layer(s)"),  
                 sensitive = _has_selected_layer)  
 _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)"),  
                 sensitive = _has_selected_layer)  
751  _method_command("layer_raise", _("&Raise"), "RaiseLayer",  _method_command("layer_raise", _("&Raise"), "RaiseLayer",
752                  helptext = _("Raise selected layer(s)"),                  helptext = _("Raise selected layer(s)"),
753                  sensitive = _has_selected_layer)                  sensitive = _has_selected_layer)
# Line 800  _method_command("layer_hide", _("&Hide") Line 763  _method_command("layer_hide", _("&Hide")
763  _method_command("layer_show_table", _("Show Ta&ble"), "LayerShowTable",  _method_command("layer_show_table", _("Show Ta&ble"), "LayerShowTable",
764                  helptext = _("Show the selected layer's table"),                  helptext = _("Show the selected layer's table"),
765                  sensitive = _has_selected_layer)                  sensitive = _has_selected_layer)
766  _method_command("layer_classifier", _("Classify"), "Classify",  _method_command("layer_properties", _("Properties"), "LayerEditProperties",
767                  sensitive = _has_selected_layer)                  sensitive = _has_selected_layer)
768    
769  # the menu structure  # the menu structure
# Line 824  main_menu = Menu("<main>", "<main>", Line 787  main_menu = Menu("<main>", "<main>",
787                          None,                          None,
788                          "map_print"]),                          "map_print"]),
789                    Menu("layer", _("&Layer"),                    Menu("layer", _("&Layer"),
790                         ["layer_fill_color", "layer_transparent_fill",                          ["layer_raise", "layer_lower",
                         "layer_outline_color", "layer_no_outline",  
                         None,  
                         "layer_raise", "layer_lower",  
791                          None,                          None,
792                          "layer_show", "layer_hide",                          "layer_show", "layer_hide",
793                          None,                          None,
794                          "layer_show_table",                          "layer_show_table",
795                          None,                          None,
796                          "layer_classifier"]),                          "layer_properties"]),
797                    Menu("help", _("&Help"),                    Menu("help", _("&Help"),
798                         ["help_about"])])                         ["help_about"])])
799    

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26