1 |
# Copyright (c) 2003 by Intevation GmbH |
# Copyright (c) 2003 by Intevation GmbH |
2 |
# Authors: |
# Authors: |
3 |
# Jonathan Coles <[email protected]> |
# Jonathan Coles <[email protected]> |
4 |
|
# Frank Koormann <[email protected]> |
5 |
# |
# |
6 |
# This program is free software under the GPL (>=v2) |
# This program is free software under the GPL (>=v2) |
7 |
# Read the file COPYING coming with Thuban for details. |
# Read the file COPYING coming with Thuban for details. |
8 |
|
|
9 |
|
"""Projection dialog""" |
10 |
|
|
11 |
|
__version__ = "$Revision$" |
12 |
|
# $Source$ |
13 |
|
# $Id$ |
14 |
|
|
15 |
import os, sys, math |
import os, sys, math |
16 |
from wxPython.wx import * |
from wxPython.wx import * |
17 |
|
|
19 |
|
|
20 |
from Thuban.Model.proj import Projection, ProjFile |
from Thuban.Model.proj import Projection, ProjFile |
21 |
|
|
22 |
from Thuban.Model.resource import GetUserProjFiles, GetSystemProjFiles, \ |
from Thuban.Model.resource import get_user_proj_files, get_system_proj_files, \ |
23 |
ReadProjFile, WriteProjFile |
read_proj_file, write_proj_file |
24 |
from Thuban.UI.dialogs import NonModalDialog |
from Thuban.UI.dialogs import NonModalNonParentDialog |
25 |
|
|
26 |
|
|
27 |
ID_PROJ_ADVANCED = 4001 |
ID_PROJ_ADVANCED = 4001 |
39 |
CLIENT_PROJ = 0 |
CLIENT_PROJ = 0 |
40 |
CLIENT_PROJFILE = 1 |
CLIENT_PROJFILE = 1 |
41 |
|
|
42 |
class ProjFrame(NonModalDialog): |
class ProjFrame(NonModalNonParentDialog): |
43 |
|
|
44 |
def __init__(self, parent, name, title, receiver): |
def __init__(self, parent, name, title, receiver): |
45 |
"""Initialize the projection dialog. |
"""Initialize the projection dialog. |
63 |
self.projPanels.append( |
self.projPanels.append( |
64 |
("latlong", _("Geographic"), GeoPanel)) |
("latlong", _("Geographic"), GeoPanel)) |
65 |
|
|
66 |
NonModalDialog.__init__(self, parent, name, title) |
NonModalNonParentDialog.__init__(self, parent, name, title) |
67 |
# originally generate by wxGlade |
# originally generate by wxGlade |
68 |
self.panel_1 = wxPanel(self, -1) |
self.panel_1 = wxPanel(self, -1) |
69 |
self.panel_edit = wxPanel(self, -1) |
self.panel_edit = wxPanel(self, -1) |
|
self.panel_buttons = wxPanel(self, -1) |
|
70 |
self.label_5 = wxStaticText(self.panel_1, -1, |
self.label_5 = wxStaticText(self.panel_1, -1, |
71 |
_("Available Projections:")) |
_("Available Projections:")) |
72 |
|
|
73 |
|
# Projection List specific actions (Import/Export/Remove) |
74 |
|
self.button_import = wxButton(self.panel_1, ID_PROJ_IMPORT, |
75 |
|
_("Import...")) |
76 |
|
self.button_export = wxButton(self.panel_1, ID_PROJ_EXPORT, |
77 |
|
_("Export...")) |
78 |
|
self.button_remove = wxButton(self.panel_1, ID_PROJ_REMOVE, |
79 |
|
_("Remove")) |
80 |
|
|
81 |
|
# The Projection List |
82 |
self.availprojs = wxListBox(self.panel_1, ID_PROJ_AVAIL, |
self.availprojs = wxListBox(self.panel_1, ID_PROJ_AVAIL, |
83 |
style=wxLB_EXTENDED|wxLB_SORT) |
style=wxLB_EXTENDED|wxLB_SORT) |
84 |
self.projfilepath = wxStaticText(self.panel_1, -1, "") |
self.projfilepath = wxStaticText(self.panel_1, -1, "") |
85 |
|
|
86 |
|
# Projection Specific Entries (Name/Projection) |
87 |
self.label_2 = wxStaticText(self.panel_edit, -1, _("Name:")) |
self.label_2 = wxStaticText(self.panel_edit, -1, _("Name:")) |
88 |
self.projname = wxTextCtrl(self.panel_edit, ID_PROJ_PROJNAME, "") |
self.projname = wxTextCtrl(self.panel_edit, ID_PROJ_PROJNAME, "") |
89 |
self.label_3 = wxStaticText(self.panel_edit, -1, _("Projection:")) |
self.label_3 = wxStaticText(self.panel_edit, -1, _("Projection:")) |
90 |
self.projchoice = wxChoice(self.panel_edit, ID_PROJ_PROJCHOICE) |
self.projchoice = wxChoice(self.panel_edit, ID_PROJ_PROJCHOICE) |
91 |
self.button_import = wxButton(self.panel_1, ID_PROJ_IMPORT, |
|
92 |
_("Import...")) |
# Projection Specific actions (New/Save/Add) |
|
self.button_export = wxButton(self.panel_1, ID_PROJ_EXPORT, |
|
|
_("Export...")) |
|
|
self.button_remove = wxButton(self.panel_1, ID_PROJ_REMOVE, _("Remove")) |
|
93 |
self.button_new = wxButton(self.panel_edit, ID_PROJ_NEW, _("New")) |
self.button_new = wxButton(self.panel_edit, ID_PROJ_NEW, _("New")) |
|
self.button_save = wxButton(self.panel_edit, ID_PROJ_SAVE,_("Save")) |
|
94 |
self.button_add = wxButton(self.panel_edit, ID_PROJ_ADDTOLIST, |
self.button_add = wxButton(self.panel_edit, ID_PROJ_ADDTOLIST, |
95 |
_("Add to List")) |
_("Add to List")) |
96 |
self.button_try = wxButton(self.panel_buttons, wxID_APPLY, _("Try")) |
self.button_save = wxButton(self.panel_edit, ID_PROJ_SAVE,_("Update")) |
97 |
self.button_revert = wxButton(self.panel_buttons, ID_PROJ_REVERT, |
|
98 |
|
# Main Action buttons (Try/Revert/OK/Close) |
99 |
|
self.button_try = wxButton(self, wxID_APPLY, _("Try")) |
100 |
|
self.button_revert = wxButton(self, ID_PROJ_REVERT, |
101 |
_("Revert")) |
_("Revert")) |
102 |
self.button_ok = wxButton(self.panel_buttons, wxID_OK, _("OK")) |
self.button_ok = wxButton(self, wxID_OK, _("OK")) |
103 |
self.button_ok.SetDefault() |
self.button_ok.SetDefault() |
104 |
self.button_close = wxButton(self.panel_buttons, wxID_CANCEL, |
self.button_close = wxButton(self, wxID_CANCEL, |
105 |
_("Close")) |
_("Close")) |
106 |
|
|
107 |
self.__set_properties() |
self.__set_properties() |
108 |
self.__do_layout() |
self.__do_layout() |
109 |
|
|
110 |
# wxGlade |
# wxGlade |
111 |
|
|
112 |
|
# Fill the projection choice list. |
113 |
|
for proj, name, clazz in self.projPanels: |
114 |
|
self.projchoice.Append(name, [clazz, None]) |
115 |
|
|
116 |
self.originalProjection = self.receiver.GetProjection() |
self.originalProjection = self.receiver.GetProjection() |
117 |
|
|
118 |
self.__DoOnProjAvail() |
self.__DoOnProjAvail() |
135 |
|
|
136 |
EVT_TEXT(self, ID_PROJ_PROJNAME, self._OnProjName) |
EVT_TEXT(self, ID_PROJ_PROJNAME, self._OnProjName) |
137 |
|
|
|
|
|
138 |
def OnApply(self, event): |
def OnApply(self, event): |
139 |
self.__SetProjection() |
self.__SetProjection() |
140 |
self.haveTried = True |
self.haveTried = True |
154 |
self.receiver.SetProjection(self.originalProjection) |
self.receiver.SetProjection(self.originalProjection) |
155 |
self.haveTried = False |
self.haveTried = False |
156 |
|
|
|
|
|
157 |
def _OnNew(self, event): |
def _OnNew(self, event): |
158 |
|
|
159 |
# clear all selections |
# clear all selections |
184 |
if newproj is not None: |
if newproj is not None: |
185 |
projfile.Replace(proj, newproj) |
projfile.Replace(proj, newproj) |
186 |
try: |
try: |
187 |
WriteProjFile(projfile) |
write_proj_file(projfile) |
188 |
except IOError, (errno, errstr): |
except IOError, (errno, errstr): |
189 |
self.__ShowError(projfile.GetFilename(), errstr) |
self.__ShowError(projfile.GetFilename(), errstr) |
190 |
self.availprojs.SetClientData(sel[0], [newproj, projfile]) |
self.availprojs.SetClientData(sel[0], [newproj, projfile]) |
191 |
|
|
192 |
|
self.__FillAvailList( selectProj = newproj.GetName()) |
193 |
|
|
194 |
def _OnAddToList(self, event): |
def _OnAddToList(self, event): |
195 |
|
|
196 |
proj = self.__GetProjection() |
proj = self.__GetProjection() |
197 |
if proj is not None: |
if proj is not None: |
198 |
self.__usrProjFile.Add(proj) |
self.__usrProjFile.Add(proj) |
199 |
try: |
try: |
200 |
WriteProjFile(self.__usrProjFile) |
write_proj_file(self.__usrProjFile) |
201 |
except IOError, (errno, errstr): |
except IOError, (errno, errstr): |
202 |
self.__ShowError(self.__userProjFile.GetFilename(), errstr) |
self.__ShowError(self.__userProjFile.GetFilename(), errstr) |
203 |
|
|
204 |
self.__FillAvailList() |
self.__FillAvailList( selectProj = proj.GetName()) |
205 |
|
|
206 |
def _OnProjAvail(self, event): |
def _OnProjAvail(self, event): |
207 |
self.__DoOnProjAvail() |
self.__DoOnProjAvail() |
214 |
path = dlg.GetPath() |
path = dlg.GetPath() |
215 |
|
|
216 |
try: |
try: |
217 |
projFile = ReadProjFile(path) |
projFile = read_proj_file(path) |
218 |
for proj in projFile.GetProjections(): |
for proj in projFile.GetProjections(): |
219 |
self.__usrProjFile.Add(proj) |
self.__usrProjFile.Add(proj) |
220 |
WriteProjFile(self.__usrProjFile) |
write_proj_file(self.__usrProjFile) |
221 |
except IOError, (errno, errstr): |
except IOError, (errno, errstr): |
222 |
self.__ShowError(dlg.GetPath(), errstr) |
self.__ShowError(dlg.GetPath(), errstr) |
223 |
|
|
244 |
projFile.Add(proj) |
projFile.Add(proj) |
245 |
|
|
246 |
try: |
try: |
247 |
WriteProjFile(projFile) |
write_proj_file(projFile) |
248 |
except IOError, (errno, errstr): |
except IOError, (errno, errstr): |
249 |
self.__ShowError(dlg.GetPath(), errstr) |
self.__ShowError(dlg.GetPath(), errstr) |
250 |
|
|
279 |
projfile.Remove(proj) |
projfile.Remove(proj) |
280 |
|
|
281 |
try: |
try: |
282 |
WriteProjFile(projfile) |
write_proj_file(projfile) |
283 |
except IOError, (errno, errstr): |
except IOError, (errno, errstr): |
284 |
self.__ShowError(projfile.GetFilename(), errstr) |
self.__ShowError(projfile.GetFilename(), errstr) |
285 |
|
|
377 |
if proj is None: |
if proj is None: |
378 |
# user selected <None> |
# user selected <None> |
379 |
self.projname.Clear() |
self.projname.Clear() |
380 |
|
self.projfilepath.SetLabel(_("Projection File: ")) |
381 |
else: |
else: |
382 |
|
|
383 |
if projfile is not None: |
if projfile is not None: |
384 |
self.projfilepath.SetLabel(projfile.GetFilename()) |
self.projfilepath.SetLabel(_("Projection File: ") + |
385 |
|
os.path.basename(projfile.GetFilename())) |
386 |
else: |
else: |
387 |
# only None if the currently used projection is selected |
# only None if the currently used projection is selected |
388 |
self.projfilepath.SetLabel("") |
self.projfilepath.SetLabel(_("Projection File: ")) |
389 |
|
|
390 |
self.projname.SetValue(proj.GetName()) |
self.projname.SetValue(proj.GetName()) |
391 |
|
|
481 |
|
|
482 |
return None |
return None |
483 |
|
|
484 |
def __FillAvailList(self, selectCurrent = False): |
def __FillAvailList(self, selectCurrent = False, selectProj = None): |
485 |
"""Populate the list of available projections. |
"""Populate the list of available projections. |
486 |
|
|
487 |
selectCurrent -- if True, select the projection used by |
selectCurrent -- if True, select the projection used by |
488 |
the receiver, otherwise select nothing. |
the receiver, otherwise select nothing. |
489 |
|
selectProj -- if set, select the projection found under the |
490 |
|
specified name. This overwrites any other |
491 |
|
selection estimate. |
492 |
""" |
""" |
493 |
|
|
494 |
self.availprojs.Clear() |
self.availprojs.Clear() |
495 |
|
|
496 |
# |
# |
|
# We add the current projection to the list first so that |
|
|
# we are sure that it's at index 0. That way we can |
|
|
# set the selection with confidence. The problem is the |
|
|
# the list is automatically sorted when an item is appended |
|
|
# and the index of where it was inserted is not returned. |
|
|
# |
|
|
proj = self.receiver.GetProjection() |
|
|
if proj is not None: |
|
|
self.availprojs.Append(_("%s (current)") % proj.GetName(), |
|
|
[proj, None]) |
|
|
if selectCurrent: |
|
|
self.availprojs.SetSelection(0) |
|
|
self.availprojs.SetFirstItem(0) |
|
|
|
|
|
# |
|
497 |
# the list can never be empty. there will always be |
# the list can never be empty. there will always be |
498 |
# at least this one item |
# at least this one item |
499 |
# |
# |
500 |
self.availprojs.Append("<None>", (None, None)) |
self.availprojs.Append("<None>", (None, None)) |
501 |
|
|
502 |
# proj is only None when <None> should be selected |
projfile = get_system_proj_files() |
|
if proj is None and selectCurrent: |
|
|
self.availprojs.SetSelection(0) |
|
|
self.availprojs.SetFirstItem(0) |
|
|
|
|
|
projfile = GetSystemProjFiles() |
|
503 |
projfile = projfile[0] |
projfile = projfile[0] |
504 |
for proj in projfile.GetProjections(): |
for proj in projfile.GetProjections(): |
505 |
self.availprojs.Append(proj.GetName(), [proj, projfile]) |
self.availprojs.Append(proj.GetName(), [proj, projfile]) |
506 |
self.__sysProjFile = projfile |
self.__sysProjFile = projfile |
507 |
|
|
508 |
projfile = GetUserProjFiles() |
projfile = get_user_proj_files() |
509 |
projfile = projfile[0] |
projfile = projfile[0] |
510 |
for proj in projfile.GetProjections(): |
for proj in projfile.GetProjections(): |
511 |
self.availprojs.Append(proj.GetName(), [proj, projfile]) |
self.availprojs.Append(proj.GetName(), [proj, projfile]) |
512 |
self.__usrProjFile = projfile |
self.__usrProjFile = projfile |
513 |
|
|
514 |
for proj, name, clazz in self.projPanels: |
# |
515 |
self.projchoice.Append(name, [clazz, None]) |
# We add the current projection to the list at last. |
516 |
|
# Since the list is resorted immediately a following FindString() |
517 |
|
# determines the index correctly. |
518 |
|
# |
519 |
|
proj = self.receiver.GetProjection() |
520 |
|
if proj is not None: |
521 |
|
proj_item = _("%s (current)") % proj.GetName() |
522 |
|
self.availprojs.Append(proj_item, [proj, None]) |
523 |
|
if selectCurrent: |
524 |
|
self.availprojs.SetSelection( |
525 |
|
self.availprojs.FindString(proj_item) |
526 |
|
) |
527 |
|
else: |
528 |
|
if selectCurrent: |
529 |
|
self.availprojs.SetSelection( |
530 |
|
self.availprojs.FindString("<None>") |
531 |
|
) |
532 |
|
if selectProj: |
533 |
|
self.availprojs.SetSelection( |
534 |
|
self.availprojs.FindString(selectProj) |
535 |
|
) |
536 |
|
|
537 |
|
|
538 |
|
|
539 |
def __set_properties(self): |
def __set_properties(self): |
540 |
|
|
551 |
self.topBox = wxBoxSizer(wxVERTICAL) |
self.topBox = wxBoxSizer(wxVERTICAL) |
552 |
self.sizer_panel = wxBoxSizer(wxVERTICAL) |
self.sizer_panel = wxBoxSizer(wxVERTICAL) |
553 |
sizer_6 = wxBoxSizer(wxHORIZONTAL) |
sizer_6 = wxBoxSizer(wxHORIZONTAL) |
554 |
|
self.sizer_mainbttns = wxBoxSizer(wxHORIZONTAL) |
555 |
self.sizer_mainctrls = wxBoxSizer(wxHORIZONTAL) |
self.sizer_mainctrls = wxBoxSizer(wxHORIZONTAL) |
556 |
self.sizer_edit = wxStaticBoxSizer(wxStaticBox(self.panel_edit, -1, _("Edit")), wxHORIZONTAL) |
self.sizer_edit = wxStaticBoxSizer(wxStaticBox(self.panel_edit, -1, _("Edit")), wxHORIZONTAL) |
557 |
sizer_11 = wxBoxSizer(wxVERTICAL) |
sizer_11 = wxBoxSizer(wxVERTICAL) |
570 |
grid_sizer_1.Add(20, 20, 0, wxEXPAND, 0) |
grid_sizer_1.Add(20, 20, 0, wxEXPAND, 0) |
571 |
grid_sizer_1.Add(self.availprojs, 1, wxALL|wxEXPAND|wxADJUST_MINSIZE, 4) |
grid_sizer_1.Add(self.availprojs, 1, wxALL|wxEXPAND|wxADJUST_MINSIZE, 4) |
572 |
grid_sizer_1.Add(sizer_15, 0, wxALL|wxEXPAND, 4) |
grid_sizer_1.Add(sizer_15, 0, wxALL|wxEXPAND, 4) |
573 |
grid_sizer_1.Add(self.projfilepath, 0, wxALL|wxADJUST_MINSIZE, 4) |
grid_sizer_1.Add(self.projfilepath, 0, wxEXPAND|wxALL|wxADJUST_MINSIZE, 4) |
574 |
grid_sizer_1.AddGrowableRow(1) |
grid_sizer_1.AddGrowableRow(1) |
575 |
grid_sizer_1.AddGrowableCol(0) |
grid_sizer_1.AddGrowableCol(0) |
576 |
|
|
578 |
sizer_13.Add(self.label_2, 0, wxALL|wxALIGN_CENTER_VERTICAL, 4) |
sizer_13.Add(self.label_2, 0, wxALL|wxALIGN_CENTER_VERTICAL, 4) |
579 |
sizer_13.Add(self.projname, 1, wxALL, 4) |
sizer_13.Add(self.projname, 1, wxALL, 4) |
580 |
self.sizer_projctrls.Add(sizer_13, 0, wxEXPAND, 0) |
self.sizer_projctrls.Add(sizer_13, 0, wxEXPAND, 0) |
581 |
sizer_14.Add(self.label_3, 0, wxALL, 4) |
sizer_14.Add(self.label_3, 0, wxALL|wxALIGN_CENTER_VERTICAL, 4) |
582 |
sizer_14.Add(self.projchoice, 1, wxALL|wxEXPAND|wxADJUST_MINSIZE, 4) |
sizer_14.Add(self.projchoice, 1, wxALL|wxALIGN_CENTER_VERTICAL, 4) |
583 |
self.sizer_projctrls.Add(sizer_14, 0, wxEXPAND, 0) |
self.sizer_projctrls.Add(sizer_14, 0, wxEXPAND, 0) |
584 |
self.sizer_edit.Add(self.sizer_projctrls, 1, wxEXPAND, 0) |
self.sizer_edit.Add(self.sizer_projctrls, 1, wxEXPAND, 0) |
585 |
sizer_11.Add(self.button_new, 0, wxALL|wxEXPAND, 4) |
sizer_11.Add(self.button_new, 0, wxEXPAND|wxALL, 4) |
586 |
sizer_11.Add(self.button_save, 0, wxALL|wxEXPAND, 4) |
sizer_11.Add(self.button_add, 0, wxEXPAND|wxALL, 4) |
587 |
sizer_11.Add(self.button_add, 0, wxALL|wxEXPAND, 4) |
sizer_11.Add(20, 20, 0, wxEXPAND, 0) |
588 |
|
sizer_11.Add(self.button_save, 0, wxEXPAND|wxALL|wxALIGN_BOTTOM, 4) |
589 |
self.sizer_edit.Add(sizer_11, 0, wxALL|wxEXPAND, 4) |
self.sizer_edit.Add(sizer_11, 0, wxALL|wxEXPAND, 4) |
590 |
|
|
591 |
sizer_6.Add(20, 20, 1, wxEXPAND, 0) |
sizer_6.Add(self.button_try, 0, wxRIGHT| wxEXPAND, 10) |
592 |
sizer_6.Add(self.button_try, 0, wxALL, 4) |
sizer_6.Add(self.button_revert, 0, wxRIGHT| wxEXPAND, 10) |
593 |
sizer_6.Add(20, 20, 1, 0, 0) |
sizer_6.Add(self.button_ok, 0, wxRIGHT| wxEXPAND, 10) |
594 |
sizer_6.Add(self.button_revert, 0, wxALL, 4) |
sizer_6.Add(self.button_close, 0, wxRIGHT| wxEXPAND, 10) |
|
sizer_6.Add(20, 20, 1, 0, 0) |
|
|
sizer_6.Add(self.button_ok, 0, wxALL, 4) |
|
|
sizer_6.Add(20, 20, 1, 0, 0) |
|
|
sizer_6.Add(self.button_close, 0, wxALL, 4) |
|
|
sizer_6.Add(20, 20, 1, wxEXPAND, 0) |
|
595 |
|
|
596 |
self.panel_1.SetAutoLayout(1) |
self.panel_1.SetAutoLayout(1) |
597 |
self.panel_1.SetSizer(grid_sizer_1) |
self.panel_1.SetSizer(grid_sizer_1) |
603 |
self.sizer_edit.Fit(self.panel_edit) |
self.sizer_edit.Fit(self.panel_edit) |
604 |
self.sizer_edit.SetSizeHints(self.panel_edit) |
self.sizer_edit.SetSizeHints(self.panel_edit) |
605 |
|
|
|
self.panel_buttons.SetAutoLayout(1) |
|
|
self.panel_buttons.SetSizer(sizer_6) |
|
|
sizer_6.Fit(self.panel_buttons) |
|
|
sizer_6.SetSizeHints(self.panel_buttons) |
|
|
|
|
606 |
self.sizer_mainctrls.Add(self.panel_1, 0, |
self.sizer_mainctrls.Add(self.panel_1, 0, |
607 |
wxALL|wxEXPAND|wxADJUST_MINSIZE, 0) |
wxALL|wxEXPAND|wxADJUST_MINSIZE, 0) |
608 |
self.sizer_mainctrls.Add(self.panel_edit, 1, |
self.sizer_mainctrls.Add(self.panel_edit, 1, |
609 |
wxALL|wxEXPAND|wxADJUST_MINSIZE, 0) |
wxALL|wxEXPAND|wxADJUST_MINSIZE, 0) |
610 |
|
|
611 |
|
self.sizer_mainbttns.Add(sizer_6, 0, |
612 |
|
wxALL|wxEXPAND|wxADJUST_MINSIZE, 10) |
613 |
|
|
614 |
self.topBox.Add(self.sizer_mainctrls, 1, wxALL|wxEXPAND, 4) |
self.topBox.Add(self.sizer_mainctrls, 1, wxALL|wxEXPAND, 4) |
615 |
self.topBox.Add(self.panel_buttons, 0, wxEXPAND, 0) |
self.topBox.Add(self.sizer_mainbttns, 0, wxALIGN_RIGHT|wxBOTTOM, 0) |
616 |
|
|
617 |
self.SetAutoLayout(1) |
self.SetAutoLayout(1) |
618 |
self.SetSizer(self.topBox) |
self.SetSizer(self.topBox) |
647 |
|
|
648 |
panelSizer = wxBoxSizer(wxVERTICAL) |
panelSizer = wxBoxSizer(wxVERTICAL) |
649 |
|
|
|
if childPanel is not None: |
|
|
panelSizer.Add(childPanel, 0, wxEXPAND, 0) |
|
|
|
|
650 |
sizer = wxBoxSizer(wxHORIZONTAL) |
sizer = wxBoxSizer(wxHORIZONTAL) |
651 |
sizer.Add(wxStaticText(self, -1, _("Ellipsoid:")), 0, wxALL, 4) |
sizer.Add(wxStaticText(self, -1, _("Ellipsoid:")), 0, |
652 |
sizer.Add(self.__ellps, 1, wxALL|wxEXPAND|wxADJUST_MINSIZE, 4) |
wxALL|wxALIGN_CENTER_VERTICAL, 4) |
653 |
|
sizer.Add(self.__ellps, 1, wxALL|wxALIGN_CENTER_VERTICAL, 4) |
654 |
panelSizer.Add(sizer, 0, wxALL|wxEXPAND, 4) |
panelSizer.Add(sizer, 0, wxALL|wxEXPAND, 4) |
655 |
|
|
656 |
|
if childPanel is not None: |
657 |
|
panelSizer.Add(childPanel, 0, wxEXPAND, 0) |
658 |
|
|
659 |
self.SetAutoLayout(1) |
self.SetAutoLayout(1) |
660 |
self.SetSizer(panelSizer) |
self.SetSizer(panelSizer) |
661 |
panelSizer.Fit(self) |
panelSizer.Fit(self) |
721 |
|
|
722 |
self.__latitude = wxTextCtrl(self, ID_TMPANEL_LAT) |
self.__latitude = wxTextCtrl(self, ID_TMPANEL_LAT) |
723 |
self.__longitude = wxTextCtrl(self, ID_TMPANEL_LONG) |
self.__longitude = wxTextCtrl(self, ID_TMPANEL_LONG) |
724 |
|
self.__scale = wxTextCtrl(self, ID_TMPANEL_SCALE) |
725 |
self.__falseEast = wxTextCtrl(self, ID_TMPANEL_FASLE_EAST) |
self.__falseEast = wxTextCtrl(self, ID_TMPANEL_FASLE_EAST) |
726 |
self.__falseNorth = wxTextCtrl(self, ID_TMPANEL_FALSE_NORTH) |
self.__falseNorth = wxTextCtrl(self, ID_TMPANEL_FALSE_NORTH) |
|
self.__scale = wxTextCtrl(self, ID_TMPANEL_SCALE) |
|
727 |
|
|
728 |
self._DoLayout() |
self._DoLayout() |
729 |
|
|
860 |
sizer.Add(wxStaticText(self, -1, |
sizer.Add(wxStaticText(self, -1, |
861 |
_("Latitude of second standard parallel:"))) |
_("Latitude of second standard parallel:"))) |
862 |
sizer.Add(self.__sspLatitude, 0, wxALL, 4) |
sizer.Add(self.__sspLatitude, 0, wxALL, 4) |
|
sizer.Add(wxStaticText(self, -1, _("Latitude of origin:"))) |
|
|
sizer.Add(self.__originLat, 0, wxALL, 4) |
|
863 |
sizer.Add(wxStaticText(self, -1, _("Central Meridian:"))) |
sizer.Add(wxStaticText(self, -1, _("Central Meridian:"))) |
864 |
sizer.Add(self.__meridian, 0, wxALL, 4) |
sizer.Add(self.__meridian, 0, wxALL, 4) |
865 |
|
sizer.Add(wxStaticText(self, -1, _("Latitude of origin:"))) |
866 |
|
sizer.Add(self.__originLat, 0, wxALL, 4) |
867 |
sizer.Add(wxStaticText(self, -1, _("False Easting:"))) |
sizer.Add(wxStaticText(self, -1, _("False Easting:"))) |
868 |
sizer.Add(self.__falseEast, 0, wxALL, 4) |
sizer.Add(self.__falseEast, 0, wxALL, 4) |
869 |
sizer.Add(wxStaticText(self, -1, _("False Northing:"))) |
sizer.Add(wxStaticText(self, -1, _("False Northing:"))) |
912 |
def __init__(self, parent, receiver): |
def __init__(self, parent, receiver): |
913 |
ProjPanel.__init__(self, parent) |
ProjPanel.__init__(self, parent) |
914 |
|
|
915 |
self.__choices = [(_("Radians"), "1"), |
self.__choices = [(_("Degrees"), "0.017453"), |
916 |
(_("Degrees"), "0.017453")] |
(_("Radians"), "1")] |
917 |
|
|
918 |
self.__scale = wxChoice(self, -1) |
self.__scale = wxChoice(self, -1) |
919 |
for choice, value in self.__choices: |
for choice, value in self.__choices: |
947 |
sizer = wxBoxSizer(wxHORIZONTAL) |
sizer = wxBoxSizer(wxHORIZONTAL) |
948 |
|
|
949 |
sizer.Add(wxStaticText(self, -1, _("Source Data is in: ")), |
sizer.Add(wxStaticText(self, -1, _("Source Data is in: ")), |
950 |
0, wxALL, 4) |
0, wxALL|wxALIGN_CENTER_VERTICAL, 4) |
951 |
sizer.Add(self.__scale, 1, wxEXPAND|wxALL, 4) |
sizer.Add(self.__scale, 1, wxEXPAND|wxALL, 4) |
952 |
|
|
953 |
self.__scale.SetSelection(0) |
self.__scale.SetSelection(0) |