/[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 1789 by bh, Wed Oct 8 13:10:45 2003 UTC revision 1819 by bh, Mon Oct 13 15:55:43 2003 UTC
# Line 24  from Thuban.Model.resource import get_us Line 24  from Thuban.Model.resource import get_us
24                                    read_proj_file, write_proj_file                                    read_proj_file, write_proj_file
25  from Thuban.UI.dialogs import NonModalNonParentDialog  from Thuban.UI.dialogs import NonModalNonParentDialog
26    
27    from sizers import NotebookLikeSizer
28    
29  ID_PROJ_ADVANCED  = 4001  ID_PROJ_ADVANCED  = 4001
30  ID_PROJ_PROJCHOICE = 4002  ID_PROJ_PROJCHOICE = 4002
# Line 49  class ProjFrame(NonModalNonParentDialog) Line 50  class ProjFrame(NonModalNonParentDialog)
50                          SetProjection(projection)                          SetProjection(projection)
51                          GetProjection()                          GetProjection()
52          """          """
53                    NonModalNonParentDialog.__init__(self, parent, name, title)
54    
55            self.projection_panel_defs = [
56                ("tmerc", _("Transverse Mercator"), TMPanel),
57                ("utm", _("Universal Transverse Mercator"), UTMPanel),
58                ("lcc", _("Lambert Conic Conformal"), LCCPanel),
59                ("latlong", _("Geographic"), GeoPanel)]
60          self.receiver = receiver          self.receiver = receiver
61          self.haveTried = False          self.haveTried = False
62          self.curProjPanel = None          self.curProjPanel = None
63    
64          self.projPanels = []          self.build_dialog()
65          self.projPanels.append(          self.Layout()
             ("tmerc", _("Transverse Mercator"), TMPanel))  
         self.projPanels.append(  
             ("utm", _("Universal Transverse Mercator"), UTMPanel))  
         self.projPanels.append(  
             ("lcc", _("Lambert Conic Conformal"), LCCPanel))  
         self.projPanels.append(  
             ("latlong", _("Geographic"), GeoPanel))  
66    
67          NonModalNonParentDialog.__init__(self, parent, name, title)          self.originalProjection = self.receiver.GetProjection()
         # originally generate by wxGlade  
         self.panel_1 = wxPanel(self, -1)  
         self.panel_edit = wxPanel(self, -1)  
         self.label_5 = wxStaticText(self.panel_1, -1,  
                         _("Available Projections:"))  
68    
69          # Projection List specific actions (Import/Export/Remove)          self.__DoOnProjAvail()
70          self.button_import = wxButton(self.panel_1, ID_PROJ_IMPORT,          self.button_ok.SetFocus()
71                                        _("Import..."))          self.availprojs.SetFocus()
72          self.button_export = wxButton(self.panel_1, ID_PROJ_EXPORT,  
73                                        _("Export..."))      def build_dialog(self):
74          self.button_remove = wxButton(self.panel_1, ID_PROJ_REMOVE,          """Build the dialog's widgets and set the event handlers"""
75                                        _("Remove"))          self.topBox = top_box = wxBoxSizer(wxVERTICAL)
76    
77            main_box = wxBoxSizer(wxHORIZONTAL)
78            top_box.Add(main_box, 1, wxALL|wxEXPAND)
79    
80          # The Projection List          #
81          self.availprojs = wxListBox(self.panel_1, ID_PROJ_AVAIL,          #    The projection list and associated controls
82            #
83            vbox = wxBoxSizer(wxVERTICAL)
84            main_box.Add(vbox, 0, wxALL|wxEXPAND)
85    
86            label = wxStaticText(self, -1, _("Available Projections:"))
87            vbox.Add(label, 0, wxLEFT|wxRIGHT|wxTOP, 4)
88    
89            hbox = wxBoxSizer(wxHORIZONTAL)
90            vbox.Add(hbox, 1, wxALL|wxEXPAND)
91            self.availprojs = wxListBox(self, ID_PROJ_AVAIL,
92                                      style=wxLB_EXTENDED|wxLB_SORT)                                      style=wxLB_EXTENDED|wxLB_SORT)
93          self.projfilepath = wxStaticText(self.panel_1, -1, "")          EVT_LISTBOX(self, ID_PROJ_AVAIL, self._OnProjAvail)
94            hbox.Add(self.availprojs, 1, wxALL|wxEXPAND|wxADJUST_MINSIZE, 4)
95            self.__FillAvailList(selectCurrent = True)
96    
97          # Projection Specific Entries (Name/Projection)          # Projection List specific actions (Import/Export/Remove)
98          self.label_2 = wxStaticText(self.panel_edit, -1, _("Name:"))          buttons = wxBoxSizer(wxVERTICAL)
99          self.projname = wxTextCtrl(self.panel_edit, ID_PROJ_PROJNAME, "")          hbox.Add(buttons, 0, wxALL)
100          self.label_3 = wxStaticText(self.panel_edit, -1, _("Projection:"))          self.button_import = wxButton(self, ID_PROJ_IMPORT, _("Import..."))
101          self.projchoice = wxChoice(self.panel_edit, ID_PROJ_PROJCHOICE)          EVT_BUTTON(self, ID_PROJ_IMPORT, self._OnImport)
102            buttons.Add(self.button_import, 1, wxALL|wxEXPAND, 4)
103            self.button_export = wxButton(self, ID_PROJ_EXPORT, _("Export..."))
104            EVT_BUTTON(self, ID_PROJ_EXPORT, self._OnExport)
105            buttons.Add(self.button_export, 1, wxALL|wxEXPAND, 4)
106            buttons.Add(20, 20, 0, wxEXPAND, 0)
107            self.button_remove = wxButton(self, ID_PROJ_REMOVE, _("Remove"))
108            EVT_BUTTON(self, ID_PROJ_REMOVE, self._OnRemove)
109            buttons.Add(self.button_remove, 1, wxALL|wxEXPAND, 4)
110    
111          # Projection Specific actions (New/Save/Add)          # The file path
112          self.button_new = wxButton(self.panel_edit, ID_PROJ_NEW, _("New"))          self.projfilepath = wxStaticText(self, -1, "")
113          self.button_add = wxButton(self.panel_edit, ID_PROJ_ADDTOLIST,          vbox.Add(self.projfilepath, 0, wxALL|wxEXPAND)
                                       _("Add to List"))  
         self.button_save = wxButton(self.panel_edit, ID_PROJ_SAVE,_("Update"))  
114    
115          # Main Action buttons (Try/Revert/OK/Close)          #
116          self.button_try = wxButton(self, wxID_APPLY, _("Try"))          #   The projection editor part
117          self.button_revert = wxButton(self, ID_PROJ_REVERT,          #
118                                        _("Revert"))          self.edit_box = wxStaticBox(self, -1, _("Edit"))
119          self.button_ok = wxButton(self, wxID_OK, _("OK"))          sizer_edit = wxStaticBoxSizer(self.edit_box, wxHORIZONTAL)
120          self.button_ok.SetDefault()          main_box.Add(sizer_edit, 1, wxALL|wxEXPAND)
         self.button_close = wxButton(self, wxID_CANCEL,  
                                      _("Close"))  
121    
122          self.__set_properties()          # Projection Specific Entries (Name/Projection)
123          self.__do_layout()          self.sizer_projctrls = wxBoxSizer(wxVERTICAL)
124            sizer_edit.Add(self.sizer_projctrls, 1, wxALL|wxEXPAND)
125    
126          # wxGlade          hbox = wxBoxSizer(wxHORIZONTAL)
127            self.sizer_projctrls.Add(hbox, 0, wxALL|wxEXPAND)
128            label = wxStaticText(self, -1, _("Name:"))
129            hbox.Add(label, 0, wxALL|wxALIGN_CENTER_VERTICAL, 4)
130            self.projname = wxTextCtrl(self, ID_PROJ_PROJNAME, "")
131            EVT_TEXT(self, ID_PROJ_PROJNAME, self._OnProjName)
132            hbox.Add(self.projname, 1, wxALL|wxEXPAND, 4)
133    
134            hbox = wxBoxSizer(wxHORIZONTAL)
135            self.sizer_projctrls.Add(hbox, 0, wxALL|wxEXPAND)
136            label = wxStaticText(self, -1, _("Projection:"))
137            hbox.Add(label, 0, wxALL|wxALIGN_CENTER_VERTICAL, 4)
138            self.projchoice = wxChoice(self, ID_PROJ_PROJCHOICE)
139            self.projchoice.SetSelection(0)
140            EVT_CHOICE(self, ID_PROJ_PROJCHOICE, self._OnProjChoice)
141            hbox.Add(self.projchoice, 1, wxALL|wxEXPAND, 4)
142          # Fill the projection choice list.          # Fill the projection choice list.
143          for proj, name, clazz in self.projPanels:          self.nbsizer = NotebookLikeSizer()
144              self.projchoice.Append(name, [clazz, None])          self.sizer_projctrls.Add(self.nbsizer, 1,
145                                     wxALL|wxEXPAND|wxADJUST_MINSIZE, 3)
146            self.projection_panels = []
147            for proj_type, name, cls in self.projection_panel_defs:
148                self.projchoice.Append(name, proj_type)
149                panel = cls(self, self.receiver)
150                panel.Hide()
151                panel.projection_index = len(self.projection_panels)
152                panel.projection_type = proj_type
153                self.projection_panels.append(panel)
154                self.nbsizer.Add(panel)
155            self.unknown_projection_panel = UnknownProjPanel(self, self.receiver)
156            self.unknown_projection_panel.Hide()
157            self.nbsizer.Add(self.unknown_projection_panel)
158    
159          self.originalProjection = self.receiver.GetProjection()          # Projection Specific actions (New/Save/Add)
160            buttons = wxBoxSizer(wxVERTICAL)
161            sizer_edit.Add(buttons, 0, wxALL)
162            self.button_new = wxButton(self, ID_PROJ_NEW, _("New"))
163            EVT_BUTTON(self, ID_PROJ_NEW, self._OnNew)
164            buttons.Add(self.button_new, 0, wxEXPAND|wxALL, 4)
165            self.button_add = wxButton(self, ID_PROJ_ADDTOLIST, _("Add to List"))
166            EVT_BUTTON(self, ID_PROJ_ADDTOLIST, self._OnAddToList)
167            buttons.Add(self.button_add, 0, wxEXPAND|wxALL, 4)
168            buttons.Add(20, 20, 0, wxEXPAND, 0)
169            self.button_save = wxButton(self, ID_PROJ_SAVE,_("Update"))
170            EVT_BUTTON(self, ID_PROJ_SAVE, self._OnSave)
171            buttons.Add(self.button_save, 0, wxEXPAND|wxALL|wxALIGN_BOTTOM, 4)
172    
173          self.__DoOnProjAvail()          #
174          self.button_ok.SetFocus()          # Main Action buttons (Try/Revert/OK/Close)
175          self.availprojs.SetFocus()          #
176                    buttons = wxBoxSizer(wxHORIZONTAL)
177            top_box.Add(buttons, 0, wxALL|wxALIGN_RIGHT, 10)
178            self.button_try = wxButton(self, wxID_APPLY, _("Try"))
179          EVT_BUTTON(self, wxID_APPLY, self.OnApply)          EVT_BUTTON(self, wxID_APPLY, self.OnApply)
180            buttons.Add(self.button_try, 0, wxRIGHT, 10)
181            self.button_revert = wxButton(self, ID_PROJ_REVERT, _("Revert"))
182          EVT_BUTTON(self, ID_PROJ_REVERT, self._OnRevert)          EVT_BUTTON(self, ID_PROJ_REVERT, self._OnRevert)
183            buttons.Add(self.button_revert, 0, wxRIGHT, 10)
184            self.button_ok = wxButton(self, wxID_OK, _("OK"))
185          EVT_BUTTON(self, wxID_OK, self.OnOK)          EVT_BUTTON(self, wxID_OK, self.OnOK)
186            self.button_ok.SetDefault()
187            buttons.Add(self.button_ok, 0, wxRIGHT, 10)
188            self.button_close = wxButton(self, wxID_CANCEL, _("Close"))
189          EVT_BUTTON(self, wxID_CANCEL, self.OnCancel)          EVT_BUTTON(self, wxID_CANCEL, self.OnCancel)
190          EVT_CHOICE(self, ID_PROJ_PROJCHOICE, self._OnProjChoice)          buttons.Add(self.button_close, 0, wxRIGHT, 10)
         EVT_LISTBOX(self, ID_PROJ_AVAIL, self._OnProjAvail)  
         EVT_BUTTON(self, ID_PROJ_IMPORT, self._OnImport)  
         EVT_BUTTON(self, ID_PROJ_EXPORT, self._OnExport)  
         EVT_BUTTON(self, ID_PROJ_REMOVE, self._OnRemove)  
191    
         EVT_BUTTON(self, ID_PROJ_NEW, self._OnNew)  
         EVT_BUTTON(self, ID_PROJ_SAVE, self._OnSave)  
         EVT_BUTTON(self, ID_PROJ_ADDTOLIST, self._OnAddToList)  
192    
193          EVT_TEXT(self, ID_PROJ_PROJNAME, self._OnProjName)          #
194            # Automatic Layout
195            #
196            self.SetAutoLayout(1)
197            self.SetSizer(top_box)
198            top_box.Fit(self)
199            top_box.SetSizeHints(self)
200    
201      def OnApply(self, event):      def OnApply(self, event):
202          self.__SetProjection()          self.__SetProjection()
# Line 190  class ProjFrame(NonModalNonParentDialog) Line 252  class ProjFrame(NonModalNonParentDialog)
252                  self.__ShowError(projfile.GetFilename(), errstr)                  self.__ShowError(projfile.GetFilename(), errstr)
253              self.availprojs.SetClientData(sel[0], [newproj, projfile])              self.availprojs.SetClientData(sel[0], [newproj, projfile])
254    
255              self.__FillAvailList( selectProj = newproj.GetName())              self.__FillAvailList( selectProj = newproj.Label())
256    
257      def _OnAddToList(self, event):      def _OnAddToList(self, event):
258    
# Line 202  class ProjFrame(NonModalNonParentDialog) Line 264  class ProjFrame(NonModalNonParentDialog)
264              except IOError, (errno, errstr):              except IOError, (errno, errstr):
265                  self.__ShowError(self.__userProjFile.GetFilename(), errstr)                  self.__ShowError(self.__userProjFile.GetFilename(), errstr)
266    
267              self.__FillAvailList( selectProj = proj.GetName())              self.__FillAvailList( selectProj = proj.Label())
268    
269      def _OnProjAvail(self, event):      def _OnProjAvail(self, event):
270          self.__DoOnProjAvail()          self.__DoOnProjAvail()
# Line 328  class ProjFrame(NonModalNonParentDialog) Line 390  class ProjFrame(NonModalNonParentDialog)
390          self.button_save.Enable(True)          self.button_save.Enable(True)
391          self.button_remove.Enable(True)          self.button_remove.Enable(True)
392    
393          self.panel_edit.Enable(True)          self.edit_box.Enable(True)
394    
395          for ctrl in [self.button_import,          for ctrl in [self.button_import,
396                       self.button_export,                       self.button_export,
# Line 337  class ProjFrame(NonModalNonParentDialog) Line 399  class ProjFrame(NonModalNonParentDialog)
399                       self.button_add,                       self.button_add,
400                       self.projchoice,                       self.projchoice,
401                       self.projname,                       self.projname,
402                       self.panel_edit]:                       self.edit_box]:
403              ctrl.Enable(True)              ctrl.Enable(True)
404    
405          if self.curProjPanel is not None:          if self.curProjPanel is not None:
# Line 376  class ProjFrame(NonModalNonParentDialog) Line 438  class ProjFrame(NonModalNonParentDialog)
438                  self.button_save.Enable(False)                  self.button_save.Enable(False)
439    
440          else:          else:
441              self.panel_edit.Enable(False)              self.edit_box.Enable(False)
442    
443      def __DoOnProjAvail(self):      def __DoOnProjAvail(self):
444    
# Line 391  class ProjFrame(NonModalNonParentDialog) Line 453  class ProjFrame(NonModalNonParentDialog)
453                  self.projname.Clear()                  self.projname.Clear()
454                  self.projfilepath.SetLabel(_("Projection File: "))                  self.projfilepath.SetLabel(_("Projection File: "))
455              else:              else:
456                
457                  if projfile is not None:                  if projfile is not None:
458                      self.projfilepath.SetLabel(_("Projection File: ") +                      self.projfilepath.SetLabel(_("Projection File: ") +
459                          os.path.basename(projfile.GetFilename()))                          os.path.basename(projfile.GetFilename()))
# Line 399  class ProjFrame(NonModalNonParentDialog) Line 461  class ProjFrame(NonModalNonParentDialog)
461                      # only None if the currently used projection is selected                      # only None if the currently used projection is selected
462                      self.projfilepath.SetLabel(_("Projection File: "))                      self.projfilepath.SetLabel(_("Projection File: "))
463    
464                  self.projname.SetValue(proj.GetName())                  self.projname.SetValue(proj.Label())
465    
466                  myProjType = proj.GetParameter("proj")                  myProjType = proj.GetParameter("proj")
467                  i = 0                  i = 0
468                  for projType, name, clazz in self.projPanels:                  for projType, name, cls in self.projection_panel_defs:
469                      if myProjType == projType:                      if myProjType == projType:
470                          self.projchoice.Enable(True)                          self.projchoice.Enable(True)
471                          self.projchoice.SetSelection(i)                          self.projchoice.SetSelection(i)
# Line 420  class ProjFrame(NonModalNonParentDialog) Line 482  class ProjFrame(NonModalNonParentDialog)
482                      i += 1                      i += 1
483                  else:                  else:
484                      self.projchoice.Disable()                      self.projchoice.Disable()
485                      self._show_proj_panel(UnknownProjPanel(self.panel_edit,                      self._show_proj_panel(UnknownProjPanel)
                                                            self.receiver))  
486    
487          self.__VerifyButtons()          self.__VerifyButtons()
488    
# Line 438  class ProjFrame(NonModalNonParentDialog) Line 499  class ProjFrame(NonModalNonParentDialog)
499          At the end of this method self.curProjPanel will not be None          At the end of this method self.curProjPanel will not be None
500          if there was a item selected.          if there was a item selected.
501          """          """
   
502          choice = self.projchoice          choice = self.projchoice
503    
504          sel = choice.GetSelection()          sel = choice.GetSelection()
505          if sel != -1:          if sel != -1:
506              clazz, obj = choice.GetClientData(sel)              proj_type = choice.GetClientData(sel)
507              if obj is None:              for t, name, cls in self.projection_panel_defs:
508                  obj = clazz(self.panel_edit, self.receiver)                  if t == proj_type:
509                  choice.SetClientData(sel, [clazz, obj])                      self._show_proj_panel(cls)
510              self._show_proj_panel(obj)                      break
511            # FIXME: what to do if sel == -1?
512    
513      def _show_proj_panel(self, panel):      def _show_proj_panel(self, panel_class):
514          """Show the panel as the projection panel"""          """Show the panel as the projection panel"""
515          if self.curProjPanel is not None:          if panel_class is UnknownProjPanel:
516              self.curProjPanel.Hide()              self.edit_box.Disable()
517              self.sizer_projctrls.Remove(self.curProjPanel)              self.nbsizer.Activate(self.unknown_projection_panel)
518                self.curProjPanel = self.unknown_projection_panel
519          self.curProjPanel = panel          else:
520          self.curProjPanel.Show()              self.edit_box.Enable(True)
521                self.unknown_projection_panel.Hide()
522          self.sizer_projctrls.Add(self.curProjPanel, 1,              for panel in self.projection_panels:
523              wxALL|wxEXPAND|wxADJUST_MINSIZE, 3)                  if panel.__class__ is panel_class:
524          self.sizer_projctrls.Layout()                      self.nbsizer.Activate(panel)
525          self.Layout()                      self.curProjPanel = panel
         self.topBox.SetSizeHints(self)  
526    
527      def __SetProjection(self):      def __SetProjection(self):
528          """Set the receiver's projection."""          """Set the receiver's projection."""
# Line 521  class ProjFrame(NonModalNonParentDialog) Line 581  class ProjFrame(NonModalNonParentDialog)
581          projfile, warnings = get_system_proj_file()          projfile, warnings = get_system_proj_file()
582          self.show_warnings(_("Warnings"), projfile.GetFilename(), warnings)          self.show_warnings(_("Warnings"), projfile.GetFilename(), warnings)
583          for proj in projfile.GetProjections():          for proj in projfile.GetProjections():
584              self.availprojs.Append(proj.GetName(), [proj, projfile])              self.availprojs.Append(proj.Label(), [proj, projfile])
585          self.__sysProjFile = projfile          self.__sysProjFile = projfile
586    
587          projfile, warnings = get_user_proj_file()          projfile, warnings = get_user_proj_file()
588          self.show_warnings(_("Warnings"), projfile.GetFilename(), warnings)          self.show_warnings(_("Warnings"), projfile.GetFilename(), warnings)
589          for proj in projfile.GetProjections():          for proj in projfile.GetProjections():
590              self.availprojs.Append(proj.GetName(), [proj, projfile])              self.availprojs.Append(proj.Label(), [proj, projfile])
591          self.__usrProjFile = projfile          self.__usrProjFile = projfile
592    
593          #          #
# Line 537  class ProjFrame(NonModalNonParentDialog) Line 597  class ProjFrame(NonModalNonParentDialog)
597          #          #
598          proj = self.receiver.GetProjection()          proj = self.receiver.GetProjection()
599          if proj is not None:          if proj is not None:
600              proj_item = _("%s (current)") % proj.GetName()              proj_item = _("%s (current)") % proj.Label()
601              self.availprojs.Append(proj_item, [proj, None])              self.availprojs.Append(proj_item, [proj, None])
602              if selectCurrent:              if selectCurrent:
603                  self.availprojs.SetSelection(                  self.availprojs.SetSelection(
# Line 553  class ProjFrame(NonModalNonParentDialog) Line 613  class ProjFrame(NonModalNonParentDialog)
613                          self.availprojs.FindString(selectProj)                          self.availprojs.FindString(selectProj)
614                      )                      )
615    
                   
   
     def __set_properties(self):  
   
         #self.availprojs.SetSelection(0)  
         self.projchoice.SetSelection(0)  
   
         self.__FillAvailList(selectCurrent = True)  
   
         self.projname.SetMaxLength(32)  
   
     def __do_layout(self):  
         # originally generated by wxGlade  
   
         self.topBox = wxBoxSizer(wxVERTICAL)  
         self.sizer_panel = wxBoxSizer(wxVERTICAL)  
         sizer_6 = wxBoxSizer(wxHORIZONTAL)  
         self.sizer_mainbttns = wxBoxSizer(wxHORIZONTAL)  
         self.sizer_mainctrls = wxBoxSizer(wxHORIZONTAL)  
         self.sizer_edit = wxStaticBoxSizer(wxStaticBox(self.panel_edit, -1, _("Edit")), wxHORIZONTAL)  
         sizer_11 = wxBoxSizer(wxVERTICAL)  
         self.sizer_projctrls = wxBoxSizer(wxVERTICAL)  
         sizer_14 = wxBoxSizer(wxHORIZONTAL)  
         sizer_13 = wxBoxSizer(wxHORIZONTAL)  
         sizer_15 = wxBoxSizer(wxVERTICAL)  
         sizer_15.Add(self.button_import, 0, wxALL, 4)  
         sizer_15.Add(self.button_export, 0, wxALL, 4)  
         sizer_15.Add(20, 20, 0, wxEXPAND, 0)  
         sizer_15.Add(self.button_remove, 0, wxALL|wxALIGN_BOTTOM, 4)  
   
         # list controls  
         grid_sizer_1 = wxFlexGridSizer(3, 2, 0, 0)  
         grid_sizer_1.Add(self.label_5, 0, wxLEFT|wxRIGHT|wxTOP, 4)  
         grid_sizer_1.Add(20, 20, 0, wxEXPAND, 0)  
         grid_sizer_1.Add(self.availprojs, 1, wxALL|wxEXPAND|wxADJUST_MINSIZE, 4)  
         grid_sizer_1.Add(sizer_15, 0, wxALL|wxEXPAND, 4)  
         grid_sizer_1.Add(self.projfilepath, 0, wxEXPAND|wxALL|wxADJUST_MINSIZE, 4)  
         grid_sizer_1.AddGrowableRow(1)  
         grid_sizer_1.AddGrowableCol(0)  
   
         # edit controls  
         sizer_13.Add(self.label_2, 0, wxALL|wxALIGN_CENTER_VERTICAL, 4)  
         sizer_13.Add(self.projname, 1, wxALL, 4)  
         self.sizer_projctrls.Add(sizer_13, 0, wxEXPAND, 0)  
         sizer_14.Add(self.label_3, 0, wxALL|wxALIGN_CENTER_VERTICAL, 4)  
         sizer_14.Add(self.projchoice, 1, wxALL|wxALIGN_CENTER_VERTICAL, 4)  
         self.sizer_projctrls.Add(sizer_14, 0, wxEXPAND, 0)  
         self.sizer_edit.Add(self.sizer_projctrls, 1, wxEXPAND, 0)  
         sizer_11.Add(self.button_new, 0, wxEXPAND|wxALL, 4)  
         sizer_11.Add(self.button_add, 0, wxEXPAND|wxALL, 4)  
         sizer_11.Add(20, 20, 0, wxEXPAND, 0)  
         sizer_11.Add(self.button_save, 0, wxEXPAND|wxALL|wxALIGN_BOTTOM, 4)  
         self.sizer_edit.Add(sizer_11, 0, wxALL|wxEXPAND, 4)  
   
         sizer_6.Add(self.button_try, 0, wxRIGHT| wxEXPAND, 10)  
         sizer_6.Add(self.button_revert, 0, wxRIGHT| wxEXPAND, 10)  
         sizer_6.Add(self.button_ok, 0, wxRIGHT| wxEXPAND, 10)  
         sizer_6.Add(self.button_close, 0, wxRIGHT| wxEXPAND, 10)  
   
         self.panel_1.SetAutoLayout(1)  
         self.panel_1.SetSizer(grid_sizer_1)  
         grid_sizer_1.Fit(self.panel_1)  
         grid_sizer_1.SetSizeHints(self.panel_1)  
   
         self.panel_edit.SetAutoLayout(1)  
         self.panel_edit.SetSizer(self.sizer_edit)  
         self.sizer_edit.Fit(self.panel_edit)  
         self.sizer_edit.SetSizeHints(self.panel_edit)  
   
         self.sizer_mainctrls.Add(self.panel_1, 0,  
             wxALL|wxEXPAND|wxADJUST_MINSIZE, 0)  
         self.sizer_mainctrls.Add(self.panel_edit, 1,  
             wxALL|wxEXPAND|wxADJUST_MINSIZE, 0)  
   
         self.sizer_mainbttns.Add(sizer_6, 0,  
             wxALL|wxEXPAND|wxADJUST_MINSIZE, 10)  
   
         self.topBox.Add(self.sizer_mainctrls, 1, wxALL|wxEXPAND, 4)  
         self.topBox.Add(self.sizer_mainbttns, 0, wxALIGN_RIGHT|wxBOTTOM, 0)  
   
         self.SetAutoLayout(1)  
         self.SetSizer(self.topBox)  
         self.topBox.Fit(self)  
         self.topBox.SetSizeHints(self)  
         self.Layout()  
   
 # end of class ProjFrame  
   
616    
617  class ProjPanel(wxPanel):  class ProjPanel(wxPanel):
618      """Base class for all projection panels."""      """Base class for all projection panels."""
# Line 720  class UnknownProjPanel(ProjPanel): Line 692  class UnknownProjPanel(ProjPanel):
692          sizer = wxBoxSizer(wxVERTICAL)          sizer = wxBoxSizer(wxVERTICAL)
693    
694          sizer.Add(wxStaticText(self, -1,          sizer.Add(wxStaticText(self, -1,
695                                 _("Thuban does not know the parameters for the"                                 _("Thuban does not know the parameters\n"
696                                   " current projection\n"                                   "for the current projection and cannot\n"
697                                   "and cannot display a configuration panel.")))                                   "display a configuration panel.")))
698    
699          ProjPanel._DoLayout(self, sizer)          ProjPanel._DoLayout(self, sizer)
700    
# Line 751  class TMPanel(ProjPanel): Line 723  class TMPanel(ProjPanel):
723    
724      def _DoLayout(self):      def _DoLayout(self):
725    
726          sizer = wxFlexGridSizer(4, 4, 0, 0)          sizer = wxFlexGridSizer(4, 2, 0, 0)
727          sizer.Add(wxStaticText(self, -1, _("Latitude:")), 0, wxALL, 4)          sizer.Add(wxStaticText(self, -1, _("Latitude:")), 0, wxALL, 4)
728          sizer.Add(self.__latitude, 0, wxALL, 4)          sizer.Add(self.__latitude, 0, wxALL, 4)
         sizer.Add(wxStaticText(self, -1, _("False Easting:")), 0, wxALL, 4)  
         sizer.Add(self.__falseEast, 0, wxALL, 4)  
729          sizer.Add(wxStaticText(self, -1, _("Longitude:")), 0, wxALL, 4)          sizer.Add(wxStaticText(self, -1, _("Longitude:")), 0, wxALL, 4)
730          sizer.Add(self.__longitude, 0, wxALL, 4)          sizer.Add(self.__longitude, 0, wxALL, 4)
731            sizer.Add(wxStaticText(self, -1, _("False Easting:")), 0, wxALL, 4)
732            sizer.Add(self.__falseEast, 0, wxALL, 4)
733          sizer.Add(wxStaticText(self, -1, _("False Northing:")), 0, wxALL, 4)          sizer.Add(wxStaticText(self, -1, _("False Northing:")), 0, wxALL, 4)
734          sizer.Add(self.__falseNorth, 0, wxALL, 4)          sizer.Add(self.__falseNorth, 0, wxALL, 4)
735          sizer.Add(wxStaticText(self, -1, _("Scale Factor:")), 0, wxALL, 4)          sizer.Add(wxStaticText(self, -1, _("Scale Factor:")), 0, wxALL, 4)

Legend:
Removed from v.1789  
changed lines
  Added in v.1819

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26