/[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 33 by bh, Thu Sep 6 15:31:31 2001 UTC revision 49 by bh, Mon Sep 10 16:03:59 2001 UTC
# Line 44  class MainWindow(wxFrame): Line 44  class MainWindow(wxFrame):
44          wxFrame.__init__(self, parent, ID, 'Thuban',          wxFrame.__init__(self, parent, ID, 'Thuban',
45                           wxDefaultPosition, wxSize(400, 300))                           wxDefaultPosition, wxSize(400, 300))
46    
47            self.interactor = interactor
48    
49          self.CreateStatusBar()          self.CreateStatusBar()
50          self.SetStatusText("This is the wxPython-based "          self.SetStatusText("This is the wxPython-based "
51                        "Graphical User Interface for exploring geographic data")                        "Graphical User Interface for exploring geographic data")
# Line 264  class MainWindow(wxFrame): Line 266  class MainWindow(wxFrame):
266      def SetMap(self, map):      def SetMap(self, map):
267          self.canvas.SetMap(map)          self.canvas.SetMap(map)
268    
269        def ShowSessionTree(self):
270            name = "session_tree"
271            dialog = self.get_open_dialog(name)
272            if dialog is None:
273                dialog = tree.SessionTreeView(self, main.app, name)
274                self.add_dialog(name, dialog)
275                dialog.Show(true)
276            else:
277                # FIXME: bring dialog to front here
278                pass
279    
280      def About(self):      def About(self):
281          self.RunMessageBox("About",          self.RunMessageBox("About",
282                             ("Thuban is a program for\n"                             ("Thuban is a program for\n"
# Line 314  class MainWindow(wxFrame): Line 327  class MainWindow(wxFrame):
327    
328          If no layer is selected, return None          If no layer is selected, return None
329          """          """
330          tree = main.app.tree.tree          return self.interactor.SelectedLayer()
         layer = tree.GetPyData(tree.GetSelection())  
         if isinstance(layer, Layer):  
             return layer  
         return None  
331    
332      def has_selected_layer(self):      def has_selected_layer(self):
333          """Return true if a layer is currently selected"""          """Return true if a layer is currently selected"""
334          tree = main.app.tree.tree          return self.interactor.HasSelectedLayer()
         layer = tree.GetPyData(tree.GetSelection())  
         return isinstance(layer, Layer)  
335    
336      def choose_color(self):      def choose_color(self):
337          """Run the color selection dialog and return the selected color.          """Run the color selection dialog and return the selected color.
# Line 383  class MainWindow(wxFrame): Line 390  class MainWindow(wxFrame):
390              name = "table_view" + str(id(table))              name = "table_view" + str(id(table))
391              dialog = self.get_open_dialog(name)              dialog = self.get_open_dialog(name)
392              if dialog is None:              if dialog is None:
393                  dialog = tableview.TableFrame(self, main.app.interactor, name,                  dialog = tableview.TableFrame(self, self.interactor, name,
394                                                "Table: %s" % layer.Title(),                                                "Table: %s" % layer.Title(),
395                                                layer, table)                                                layer, table)
396                  self.add_dialog(name, dialog)                  self.add_dialog(name, dialog)
# Line 419  class MainWindow(wxFrame): Line 426  class MainWindow(wxFrame):
426    
427      def IdentifyTool(self):      def IdentifyTool(self):
428          self.canvas.IdentifyTool()          self.canvas.IdentifyTool()
429            self.identify_view_on_demand(None, None)
430    
431      def LabelTool(self):      def LabelTool(self):
432          self.canvas.LabelTool()          self.canvas.LabelTool()
# Line 433  class MainWindow(wxFrame): Line 441  class MainWindow(wxFrame):
441          name = "identify_view"          name = "identify_view"
442          if self.canvas.CurrentTool() == "IdentifyTool":          if self.canvas.CurrentTool() == "IdentifyTool":
443              if not self.dialog_open(name):              if not self.dialog_open(name):
444                  dialog = identifyview.IdentifyView(self, main.app.interactor,                  dialog = identifyview.IdentifyView(self, self.interactor, name)
                                                    name)  
445                  self.add_dialog(name, dialog)                  self.add_dialog(name, dialog)
446                  dialog.Show(true)                  dialog.Show(true)
447              else:              else:

Legend:
Removed from v.33  
changed lines
  Added in v.49

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26