/[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 6 by bh, Tue Aug 28 15:41:52 2001 UTC revision 18 by bh, Mon Sep 3 16:25:09 2001 UTC
# Line 97  class MainWindow(wxFrame): Line 97  class MainWindow(wxFrame):
97          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",
98                       "map_identify_tool", "map_label_tool"]:                       "map_identify_tool", "map_label_tool"]:
99              self.add_toolbar_command(toolbar, name)              self.add_toolbar_command(toolbar, name)
100            # call Realize to make sure that the tools appear.
101            toolbar.Realize()
102    
103          # Create the map canvas          # Create the map canvas
104          canvas = view.MapCanvas(self, -1)          canvas = view.MapCanvas(self, -1)
# Line 175  class MainWindow(wxFrame): Line 177  class MainWindow(wxFrame):
177          command = registry.Command(self.id_to_name[event.GetId()])          command = registry.Command(self.id_to_name[event.GetId()])
178          if command is not None:          if command is not None:
179              event.Enable(command.Sensitive(self))              event.Enable(command.Sensitive(self))
             event.Check(command.Checked(self))  
180              event.SetText(command.DynText(self))              event.SetText(command.DynText(self))
181                if command.IsCheckCommand():
182                    event.Check(command.Checked(self))
183    
184      def NewSession(self):      def NewSession(self):
185          session = Session("")          session = Session("")
# Line 246  class MainWindow(wxFrame): Line 249  class MainWindow(wxFrame):
249              filename = dlg.GetPath()              filename = dlg.GetPath()
250              title = os.path.splitext(os.path.basename(filename))[0]              title = os.path.splitext(os.path.basename(filename))[0]
251              layer = Layer(title, filename)              layer = Layer(title, filename)
252              self.canvas.Map().AddLayer(layer)              map = self.canvas.Map()
253                has_layers = map.HasLayers()
254                map.AddLayer(layer)
255                if not has_layers:
256                    # if we're adding a layer to an empty map, for the new
257                    # map to the window
258                    self.canvas.FitMapToWindow()
259          dlg.Destroy()          dlg.Destroy()
260    
261      def RemoveLayer(self):      def RemoveLayer(self):

Legend:
Removed from v.6  
changed lines
  Added in v.18

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26