405 |
i = 0 |
i = 0 |
406 |
for projType, name, clazz in self.projPanels: |
for projType, name, clazz in self.projPanels: |
407 |
if myProjType == projType: |
if myProjType == projType: |
408 |
|
self.projchoice.Enable(True) |
409 |
self.projchoice.SetSelection(i) |
self.projchoice.SetSelection(i) |
410 |
self.__DoOnProjChoice() |
self.__DoOnProjChoice() |
411 |
|
|
416 |
assert self.curProjPanel is not None |
assert self.curProjPanel is not None |
417 |
|
|
418 |
self.curProjPanel.SetProjection(proj) |
self.curProjPanel.SetProjection(proj) |
419 |
|
break |
420 |
i += 1 |
i += 1 |
421 |
|
else: |
422 |
|
self.projchoice.Disable() |
423 |
|
self._show_proj_panel(UnknownProjPanel(self.panel_edit, |
424 |
|
self.receiver)) |
425 |
|
|
426 |
self.__VerifyButtons() |
self.__VerifyButtons() |
427 |
|
|
443 |
|
|
444 |
sel = choice.GetSelection() |
sel = choice.GetSelection() |
445 |
if sel != -1: |
if sel != -1: |
|
|
|
446 |
clazz, obj = choice.GetClientData(sel) |
clazz, obj = choice.GetClientData(sel) |
|
|
|
447 |
if obj is None: |
if obj is None: |
448 |
obj = clazz(self.panel_edit, self.receiver) |
obj = clazz(self.panel_edit, self.receiver) |
449 |
choice.SetClientData(sel, [clazz, obj]) |
choice.SetClientData(sel, [clazz, obj]) |
450 |
|
self._show_proj_panel(obj) |
451 |
|
|
452 |
if self.curProjPanel is not None: |
def _show_proj_panel(self, panel): |
453 |
self.curProjPanel.Hide() |
"""Show the panel as the projection panel""" |
454 |
self.sizer_projctrls.Remove(self.curProjPanel) |
if self.curProjPanel is not None: |
455 |
|
self.curProjPanel.Hide() |
456 |
self.curProjPanel = obj |
self.sizer_projctrls.Remove(self.curProjPanel) |
457 |
self.curProjPanel.Show() |
|
458 |
|
self.curProjPanel = panel |
459 |
self.sizer_projctrls.Add(self.curProjPanel, 1, |
self.curProjPanel.Show() |
460 |
wxALL|wxEXPAND|wxADJUST_MINSIZE, 3) |
|
461 |
self.sizer_projctrls.Layout() |
self.sizer_projctrls.Add(self.curProjPanel, 1, |
462 |
self.Layout() |
wxALL|wxEXPAND|wxADJUST_MINSIZE, 3) |
463 |
self.topBox.SetSizeHints(self) |
self.sizer_projctrls.Layout() |
464 |
|
self.Layout() |
465 |
|
self.topBox.SetSizeHints(self) |
466 |
|
|
467 |
def __SetProjection(self): |
def __SetProjection(self): |
468 |
"""Set the receiver's projection.""" |
"""Set the receiver's projection.""" |
708 |
ID_TMPANEL_SCALE = 4005 |
ID_TMPANEL_SCALE = 4005 |
709 |
|
|
710 |
class UnknownProjPanel(ProjPanel): |
class UnknownProjPanel(ProjPanel): |
711 |
|
|
712 |
|
"""Panel for unknown projection types""" |
713 |
|
|
714 |
def __init__(self, parent, receiver): |
def __init__(self, parent, receiver): |
715 |
ProjPanel.__init__(self, parent) |
ProjPanel.__init__(self, parent) |
716 |
|
|
721 |
|
|
722 |
sizer.Add(wxStaticText(self, -1, |
sizer.Add(wxStaticText(self, -1, |
723 |
_("Thuban does not know the parameters for the" |
_("Thuban does not know the parameters for the" |
724 |
" current projection and cannot display a" |
" current projection\n" |
725 |
" configuration panel."))) |
"and cannot display a configuration panel."))) |
726 |
|
|
727 |
ProjPanel._DoLayout(self, sizer) |
ProjPanel._DoLayout(self, sizer) |
728 |
|
|