/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/projdialog.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/projdialog.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1851 by bh, Tue Oct 21 14:17:24 2003 UTC revision 1858 by jan, Fri Oct 24 15:12:58 2003 UTC
# Line 73  class ProjFrame(NonModalNonParentDialog) Line 73  class ProjFrame(NonModalNonParentDialog)
73          self.originalProjection = self.receiver.GetProjection()          self.originalProjection = self.receiver.GetProjection()
74    
75          self.projection_list.SelectProjection(self.originalProjection)          self.projection_list.SelectProjection(self.originalProjection)
         self.button_ok.SetFocus()  
76          self.projection_list.SetFocus()          self.projection_list.SetFocus()
77    
78      def build_dialog(self):      def build_dialog(self):
# Line 209  class ProjFrame(NonModalNonParentDialog) Line 208  class ProjFrame(NonModalNonParentDialog)
208      def OnClose(self, event):      def OnClose(self, event):
209          self.projection_list.Unsubscribe(PROJ_SELECTION_CHANGED,          self.projection_list.Unsubscribe(PROJ_SELECTION_CHANGED,
210                                           self.proj_selection_changed)                                           self.proj_selection_changed)
211            # Destroy the projection list explicitly so that it properly
212            # unsubscribes everything. It would be cleaner if the projection
213            # could do this by itself but wx doesn't always send destroy
214            # events for non-top-level widgets
215            self.projection_list.Destroy()
216          NonModalNonParentDialog.OnClose(self, event)          NonModalNonParentDialog.OnClose(self, event)
217    
218      def OnApply(self, event):      def OnApply(self, event):
# Line 459  class ProjFrame(NonModalNonParentDialog) Line 463  class ProjFrame(NonModalNonParentDialog)
463                      self.projchoice.Select(0)                      self.projchoice.Select(0)
464                      self.projchoice.Disable()                      self.projchoice.Disable()
465                      self._show_proj_panel(UnknownProjPanel)                      self._show_proj_panel(UnknownProjPanel)
466                        assert self.curProjPanel is not None
467                        self.curProjPanel.SetProjection(proj)
468          else:          else:
469              self.projfilepath.SetLabel(_("Multiple Projections selected"))              self.projfilepath.SetLabel(_("Multiple Projections selected"))
470    
# Line 651  class UnknownProjPanel(ProjPanel): Line 657  class UnknownProjPanel(ProjPanel):
657      def __init__(self, parent, receiver):      def __init__(self, parent, receiver):
658          ProjPanel.__init__(self, parent)          ProjPanel.__init__(self, parent)
659    
660            self.__text = _("Thuban does not know the parameters\n"
661                            "for the current projection and cannot\n"
662                            "display a configuration panel.\n\n"
663                            "The unidentified set of parameters is:\n\n")
664    
665            self.__textbox = wxTextCtrl(self, -1, self.__text, size=(100,200),
666                                style=wxTE_READONLY|wxTE_MULTILINE|wxTE_LINEWRAP)
667          self._DoLayout()          self._DoLayout()
668    
669      def _DoLayout(self):      def _DoLayout(self):
670          sizer = wxBoxSizer(wxVERTICAL)          sizer = wxBoxSizer(wxVERTICAL)
671    
672          sizer.Add(wxStaticText(self, -1,          sizer.Add(self.__textbox, 0, wxALL|wxEXPAND, 4)
                                _("Thuban does not know the parameters\n"  
                                  "for the current projection and cannot\n"  
                                  "display a configuration panel.")))  
673    
674          ProjPanel._DoLayout(self, sizer)          ProjPanel._DoLayout(self, sizer)
675    
# Line 667  class UnknownProjPanel(ProjPanel): Line 677  class UnknownProjPanel(ProjPanel):
677          return "Unknown"          return "Unknown"
678    
679      def SetProjection(self, proj):      def SetProjection(self, proj):
680          pass          """Append the available parameters to the info text."""
681            text = self.__text
682            for param in proj.GetAllParameters():
683                text = text + '%s\n' % param
684            self.__textbox.SetValue(text)
685    
686      def GetParameters(self):      def GetParameters(self):
687          return None          return None

Legend:
Removed from v.1851  
changed lines
  Added in v.1858

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26