60 |
("tmerc", _("Transverse Mercator"), TMPanel), |
("tmerc", _("Transverse Mercator"), TMPanel), |
61 |
("utm", _("Universal Transverse Mercator"), UTMPanel), |
("utm", _("Universal Transverse Mercator"), UTMPanel), |
62 |
("lcc", _("Lambert Conic Conformal"), LCCPanel), |
("lcc", _("Lambert Conic Conformal"), LCCPanel), |
63 |
("latlong", _("Geographic"), GeoPanel)] |
("latlong", _("Geographic"), GeoPanel), |
64 |
|
("longlat", _("Geographic"), GeoPanel)]#longlat is an alias of proj |
65 |
self.receiver = receiver |
self.receiver = receiver |
66 |
self.haveTried = False |
self.haveTried = False |
67 |
self.curProjPanel = None |
self.curProjPanel = None |
74 |
self.originalProjection = self.receiver.GetProjection() |
self.originalProjection = self.receiver.GetProjection() |
75 |
|
|
76 |
self.projection_list.SelectProjection(self.originalProjection) |
self.projection_list.SelectProjection(self.originalProjection) |
|
self.button_ok.SetFocus() |
|
77 |
self.projection_list.SetFocus() |
self.projection_list.SetFocus() |
78 |
|
|
79 |
def build_dialog(self): |
def build_dialog(self): |
209 |
def OnClose(self, event): |
def OnClose(self, event): |
210 |
self.projection_list.Unsubscribe(PROJ_SELECTION_CHANGED, |
self.projection_list.Unsubscribe(PROJ_SELECTION_CHANGED, |
211 |
self.proj_selection_changed) |
self.proj_selection_changed) |
212 |
|
# Destroy the projection list explicitly so that it properly |
213 |
|
# unsubscribes everything. It would be cleaner if the projection |
214 |
|
# could do this by itself but wx doesn't always send destroy |
215 |
|
# events for non-top-level widgets |
216 |
|
self.projection_list.Destroy() |
217 |
NonModalNonParentDialog.OnClose(self, event) |
NonModalNonParentDialog.OnClose(self, event) |
218 |
|
|
219 |
def OnApply(self, event): |
def OnApply(self, event): |
464 |
self.projchoice.Select(0) |
self.projchoice.Select(0) |
465 |
self.projchoice.Disable() |
self.projchoice.Disable() |
466 |
self._show_proj_panel(UnknownProjPanel) |
self._show_proj_panel(UnknownProjPanel) |
467 |
|
assert self.curProjPanel is not None |
468 |
|
self.curProjPanel.SetProjection(proj) |
469 |
else: |
else: |
470 |
self.projfilepath.SetLabel(_("Multiple Projections selected")) |
self.projfilepath.SetLabel(_("Multiple Projections selected")) |
471 |
|
|
658 |
def __init__(self, parent, receiver): |
def __init__(self, parent, receiver): |
659 |
ProjPanel.__init__(self, parent) |
ProjPanel.__init__(self, parent) |
660 |
|
|
661 |
|
self.__text = _("Thuban does not know the parameters\n" |
662 |
|
"for the current projection and cannot\n" |
663 |
|
"display a configuration panel.\n\n" |
664 |
|
"The unidentified set of parameters is:\n\n") |
665 |
|
|
666 |
|
self.__textbox = wxTextCtrl(self, -1, self.__text, size=(100,200), |
667 |
|
style=wxTE_READONLY|wxTE_MULTILINE|wxTE_LINEWRAP) |
668 |
self._DoLayout() |
self._DoLayout() |
669 |
|
|
670 |
def _DoLayout(self): |
def _DoLayout(self): |
671 |
sizer = wxBoxSizer(wxVERTICAL) |
sizer = wxBoxSizer(wxVERTICAL) |
672 |
|
|
673 |
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."))) |
|
674 |
|
|
675 |
ProjPanel._DoLayout(self, sizer) |
ProjPanel._DoLayout(self, sizer) |
676 |
|
|
678 |
return "Unknown" |
return "Unknown" |
679 |
|
|
680 |
def SetProjection(self, proj): |
def SetProjection(self, proj): |
681 |
pass |
"""Append the available parameters to the info text.""" |
682 |
|
text = self.__text |
683 |
|
for param in proj.GetAllParameters(): |
684 |
|
text = text + '%s\n' % param |
685 |
|
self.__textbox.SetValue(text) |
686 |
|
|
687 |
def GetParameters(self): |
def GetParameters(self): |
688 |
return None |
return None |