2 |
# Authors: |
# Authors: |
3 |
# Jonathan Coles <[email protected]> |
# Jonathan Coles <[email protected]> |
4 |
# Frank Koormann <[email protected]> |
# Frank Koormann <[email protected]> |
5 |
|
# Jan-Oliver Wagner <[email protected]> |
6 |
# |
# |
7 |
# This program is free software under the GPL (>=v2) |
# This program is free software under the GPL (>=v2) |
8 |
# Read the file COPYING coming with Thuban for details. |
# Read the file COPYING coming with Thuban for details. |
9 |
|
|
10 |
|
"""Projection dialog""" |
11 |
|
|
12 |
|
__version__ = "$Revision$" |
13 |
|
# $Source$ |
14 |
|
# $Id$ |
15 |
|
|
16 |
import os, sys, math |
import os, sys, math |
17 |
from wxPython.wx import * |
from wxPython.wx import * |
18 |
|
|
378 |
if proj is None: |
if proj is None: |
379 |
# user selected <None> |
# user selected <None> |
380 |
self.projname.Clear() |
self.projname.Clear() |
381 |
|
self.projfilepath.SetLabel(_("Projection File: ")) |
382 |
else: |
else: |
383 |
|
|
384 |
if projfile is not None: |
if projfile is not None: |
832 |
ProjPanel.Clear(self) |
ProjPanel.Clear(self) |
833 |
|
|
834 |
def _OnPropose(self, event): |
def _OnPropose(self, event): |
835 |
UTMProposeZoneDialog |
"""Call the propose dialog. |
836 |
|
If the receiver (e.g. the current map) has no bounding box, |
837 |
|
inform the user accordingly. |
838 |
|
""" |
839 |
|
bb = self.receiver.BoundingBox() |
840 |
|
if bb is None: |
841 |
|
dlg = wxMessageDialog(self, |
842 |
|
_("Can not propose: No bounding box found."), |
843 |
|
_("Projection: Propose UTM Zone"), |
844 |
|
wxOK | wxICON_INFORMATION) |
845 |
|
dlg.CenterOnParent() |
846 |
|
result = dlg.ShowModal() |
847 |
|
dlg.Destroy() |
848 |
|
return |
849 |
|
|
850 |
dlg = UTMProposeZoneDialog(self, self.receiver.BoundingBox()) |
dlg = UTMProposeZoneDialog(self, self.receiver.BoundingBox()) |
851 |
if dlg.ShowModal() == wxID_OK: |
if dlg.ShowModal() == wxID_OK: |
852 |
self.__zone.SetValue(dlg.GetProposedZone()) |
self.__zone.SetValue(dlg.GetProposedZone()) |
980 |
wxDialog.__init__(self, parent, -1, _("Projection: Propose UTM Zone"), |
wxDialog.__init__(self, parent, -1, _("Projection: Propose UTM Zone"), |
981 |
wxDefaultPosition, wxSize(200, 100)) |
wxDefaultPosition, wxSize(200, 100)) |
982 |
self.parent = parent |
self.parent = parent |
|
#x, y, x2, y2 = elf.parent.parent.map_bounding_box |
|
983 |
x = x + 180 |
x = x + 180 |
984 |
x2 = x2 + 180 |
x2 = x2 + 180 |
985 |
center = (x2 - x) / 2 + x |
center = (x2 - x) / 2 + x |