/[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 84 by bh, Wed Apr 3 15:21:46 2002 UTC revision 113 by jan, Sun Apr 21 17:38:50 2002 UTC
# Line 104  class MainWindow(wxFrame): Line 104  class MainWindow(wxFrame):
104          toolbar.SetToolBitmapSize(wxSize(24, 24))          toolbar.SetToolBitmapSize(wxSize(24, 24))
105    
106          for name in ["map_zoom_in_tool", "map_zoom_out_tool", "map_pan_tool",          for name in ["map_zoom_in_tool", "map_zoom_out_tool", "map_pan_tool",
107                       "map_identify_tool", "map_label_tool"]:                       "map_identify_tool", "map_label_tool", "map_full_extent"]:
108              self.add_toolbar_command(toolbar, name)              self.add_toolbar_command(toolbar, name)
109          # call Realize to make sure that the tools appear.          # call Realize to make sure that the tools appear.
110          toolbar.Realize()          toolbar.Realize()
# Line 259  class MainWindow(wxFrame): Line 259  class MainWindow(wxFrame):
259          dlg.Destroy()          dlg.Destroy()
260    
261      def SaveSession(self):      def SaveSession(self):
262            if main.app.session.filename == None:
263                self.SaveSessionAs()
264          main.app.SaveSession()          main.app.SaveSession()
265    
266      def SaveSessionAs(self):      def SaveSessionAs(self):
# Line 419  class MainWindow(wxFrame): Line 421  class MainWindow(wxFrame):
421          map = self.canvas.Map()          map = self.canvas.Map()
422          proj = map.projection          proj = map.projection
423          if proj is None:          if proj is None:
424              proj4Dlg = proj4dialog.Proj4Dialog(NULL, None)              proj4Dlg = proj4dialog.Proj4Dialog(NULL, None, map.BoundingBox())
425          else:          else:
426              proj4Dlg = proj4dialog.Proj4Dialog(NULL, map.projection.params)              proj4Dlg = proj4dialog.Proj4Dialog(NULL, map.projection.params,
427                                                   map.BoundingBox())
428          if proj4Dlg.ShowModal() == wxID_OK:          if proj4Dlg.ShowModal() == wxID_OK:
429              params = proj4Dlg.GetParams()              params = proj4Dlg.GetParams()
430              if params is not None:              if params is not None:
# Line 474  def call_method(context, methodname, *ar Line 477  def call_method(context, methodname, *ar
477      """Call the context's method methodname with args *args"""      """Call the context's method methodname with args *args"""
478      apply(getattr(context, methodname), args)      apply(getattr(context, methodname), args)
479    
480  def _method_command(name, title, method, helptext = "", sensitive = None):  def _method_command(name, title, method, helptext = "",
481                        icon = "", sensitive = None):
482      """Add a command implemented by a method of the context object"""      """Add a command implemented by a method of the context object"""
483      registry.Add(Command(name, title, call_method, args=(method,),      registry.Add(Command(name, title, call_method, args=(method,),
484                           helptext = helptext, sensitive = sensitive))                           helptext = helptext, icon = icon,
485                             sensitive = sensitive))
486    
487  def _tool_command(name, title, method, toolname, helptext = "",  def _tool_command(name, title, method, toolname, helptext = "",
488                    icon = ""):                    icon = ""):
489      """Add a tool command"""      """Add a tool command"""
# Line 515  _tool_command("map_identify_tool", "&Ide Line 521  _tool_command("map_identify_tool", "&Ide
521                helptext = "Switch to map-mode 'identify'", icon = "identify")                helptext = "Switch to map-mode 'identify'", icon = "identify")
522  _tool_command("map_label_tool", "&Label", "LabelTool", "LabelTool",  _tool_command("map_label_tool", "&Label", "LabelTool", "LabelTool",
523                helptext = "Add/Remove labels", icon = "label")                helptext = "Add/Remove labels", icon = "label")
524  _method_command("map_full_extent", "&Full extent", "FullExtent")  _method_command("map_full_extent", "&Full extent", "FullExtent",
525                   helptext = "Full Extent", icon = "fullextent")
526  _method_command("map_print", "Prin&t", "PrintMap", helptext = "Print the map")  _method_command("map_print", "Prin&t", "PrintMap", helptext = "Print the map")
527    
528  # Layer menu  # Layer menu

Legend:
Removed from v.84  
changed lines
  Added in v.113

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26