21 |
ID_PROJ_PROJCHOICE = 4002 |
ID_PROJ_PROJCHOICE = 4002 |
22 |
ID_PROJ_ADDTOLIST = 4003 |
ID_PROJ_ADDTOLIST = 4003 |
23 |
ID_PROJ_NEW = 4004 |
ID_PROJ_NEW = 4004 |
|
ID_PROJ_TRY = 4005 |
|
24 |
ID_PROJ_REVERT = 4006 |
ID_PROJ_REVERT = 4006 |
|
ID_PROJ_OK = 4007 |
|
|
ID_PROJ_CLOSE = 4008 |
|
25 |
ID_PROJ_AVAIL = 4009 |
ID_PROJ_AVAIL = 4009 |
26 |
ID_PROJ_SAVE = 4010 |
ID_PROJ_SAVE = 4010 |
27 |
ID_PROJ_IMPORT = 4011 |
ID_PROJ_IMPORT = 4011 |
61 |
self.panel_1 = wxPanel(self, -1) |
self.panel_1 = wxPanel(self, -1) |
62 |
self.panel_edit = wxPanel(self, -1) |
self.panel_edit = wxPanel(self, -1) |
63 |
self.panel_buttons = wxPanel(self, -1) |
self.panel_buttons = wxPanel(self, -1) |
64 |
self.label_5 = wxStaticText(self.panel_1, -1, _("Available Projections:")) |
self.label_5 = wxStaticText(self.panel_1, -1, |
65 |
self.availprojs = wxListBox(self.panel_1, ID_PROJ_AVAIL, style=wxLB_EXTENDED|wxLB_SORT) |
_("Available Projections:")) |
66 |
|
self.availprojs = wxListBox(self.panel_1, ID_PROJ_AVAIL, |
67 |
|
style=wxLB_EXTENDED|wxLB_SORT) |
68 |
self.projfilepath = wxStaticText(self.panel_1, -1, "") |
self.projfilepath = wxStaticText(self.panel_1, -1, "") |
69 |
self.label_2 = wxStaticText(self.panel_edit, -1, _("Name:")) |
self.label_2 = wxStaticText(self.panel_edit, -1, _("Name:")) |
70 |
self.projname = wxTextCtrl(self.panel_edit, ID_PROJ_PROJNAME, "") |
self.projname = wxTextCtrl(self.panel_edit, ID_PROJ_PROJNAME, "") |
71 |
self.label_3 = wxStaticText(self.panel_edit, -1, _("Projection:")) |
self.label_3 = wxStaticText(self.panel_edit, -1, _("Projection:")) |
72 |
self.projchoice = wxChoice(self.panel_edit, ID_PROJ_PROJCHOICE) |
self.projchoice = wxChoice(self.panel_edit, ID_PROJ_PROJCHOICE) |
73 |
self.button_import = wxButton(self.panel_1, ID_PROJ_IMPORT, _("Import...")) |
self.button_import = wxButton(self.panel_1, ID_PROJ_IMPORT, |
74 |
self.button_export = wxButton(self.panel_1, ID_PROJ_EXPORT, _("Export...")) |
_("Import...")) |
75 |
|
self.button_export = wxButton(self.panel_1, ID_PROJ_EXPORT, |
76 |
|
_("Export...")) |
77 |
self.button_remove = wxButton(self.panel_1, ID_PROJ_REMOVE, _("Remove")) |
self.button_remove = wxButton(self.panel_1, ID_PROJ_REMOVE, _("Remove")) |
78 |
self.button_new = wxButton(self.panel_edit, ID_PROJ_NEW, _("New")) |
self.button_new = wxButton(self.panel_edit, ID_PROJ_NEW, _("New")) |
79 |
self.button_save = wxButton(self.panel_edit, ID_PROJ_SAVE,_("Save")) |
self.button_save = wxButton(self.panel_edit, ID_PROJ_SAVE,_("Save")) |
80 |
self.button_add = wxButton(self.panel_edit, ID_PROJ_ADDTOLIST, |
self.button_add = wxButton(self.panel_edit, ID_PROJ_ADDTOLIST, |
81 |
_("Add to List")) |
_("Add to List")) |
82 |
self.button_try = wxButton(self.panel_buttons, ID_PROJ_TRY, _("Try")) |
self.button_try = wxButton(self.panel_buttons, wxID_APPLY, _("Try")) |
83 |
self.button_revert = wxButton(self.panel_buttons, ID_PROJ_REVERT, _("Revert")) |
self.button_revert = wxButton(self.panel_buttons, ID_PROJ_REVERT, |
84 |
self.button_ok = wxButton(self.panel_buttons, ID_PROJ_OK, _("OK")) |
_("Revert")) |
85 |
self.button_close = wxButton(self.panel_buttons, ID_PROJ_CLOSE, _("Close")) |
self.button_ok = wxButton(self.panel_buttons, wxID_OK, _("OK")) |
86 |
|
self.button_ok.SetDefault() |
87 |
|
self.button_close = wxButton(self.panel_buttons, wxID_CANCEL, |
88 |
|
_("Close")) |
89 |
|
|
90 |
self.__set_properties() |
self.__set_properties() |
91 |
self.__do_layout() |
self.__do_layout() |
94 |
self.originalProjection = self.receiver.GetProjection() |
self.originalProjection = self.receiver.GetProjection() |
95 |
|
|
96 |
self.__DoOnProjAvail() |
self.__DoOnProjAvail() |
97 |
|
self.button_ok.SetFocus() |
98 |
|
self.availprojs.SetFocus() |
99 |
|
|
100 |
EVT_BUTTON(self, ID_PROJ_TRY, self._OnTry) |
EVT_BUTTON(self, wxID_APPLY, self.OnApply) |
101 |
EVT_BUTTON(self, ID_PROJ_REVERT, self._OnRevert) |
EVT_BUTTON(self, ID_PROJ_REVERT, self._OnRevert) |
102 |
EVT_BUTTON(self, ID_PROJ_OK, self._OnOK) |
EVT_BUTTON(self, wxID_OK, self.OnOK) |
103 |
EVT_BUTTON(self, ID_PROJ_CLOSE, self._OnClose) |
EVT_BUTTON(self, wxID_CANCEL, self.OnCancel) |
104 |
EVT_CHOICE(self, ID_PROJ_PROJCHOICE, self._OnProjChoice) |
EVT_CHOICE(self, ID_PROJ_PROJCHOICE, self._OnProjChoice) |
105 |
EVT_LISTBOX(self, ID_PROJ_AVAIL, self._OnProjAvail) |
EVT_LISTBOX(self, ID_PROJ_AVAIL, self._OnProjAvail) |
106 |
EVT_BUTTON(self, ID_PROJ_IMPORT, self._OnImport) |
EVT_BUTTON(self, ID_PROJ_IMPORT, self._OnImport) |
113 |
|
|
114 |
EVT_TEXT(self, ID_PROJ_PROJNAME, self._OnProjName) |
EVT_TEXT(self, ID_PROJ_PROJNAME, self._OnProjName) |
115 |
|
|
116 |
def _OnTry(self, event): |
|
117 |
|
def OnApply(self, event): |
118 |
self.__SetProjection() |
self.__SetProjection() |
119 |
self.haveTried = True |
self.haveTried = True |
120 |
|
|
121 |
|
def OnOK(self, event): |
122 |
|
self.__SetProjection() |
123 |
|
self.Close() |
124 |
|
|
125 |
|
def OnCancel(self, event): |
126 |
|
"""Cancel just closes the dialog, but we call it cancel so we |
127 |
|
can overload the functionality of wxDialog. |
128 |
|
""" |
129 |
|
self.Close() |
130 |
|
|
131 |
def _OnRevert(self, event): |
def _OnRevert(self, event): |
132 |
if self.haveTried: |
if self.haveTried: |
133 |
self.receiver.SetProjection(self.originalProjection) |
self.receiver.SetProjection(self.originalProjection) |
134 |
self.haveTried = False |
self.haveTried = False |
135 |
|
|
|
def _OnOK(self, event): |
|
|
self.__SetProjection() |
|
|
self.Close() |
|
|
|
|
|
def _OnClose(self, event): |
|
|
self.Close() |
|
136 |
|
|
137 |
def _OnNew(self, event): |
def _OnNew(self, event): |
138 |
|
|
606 |
wxPanel.__init__(self, parent, -1) |
wxPanel.__init__(self, parent, -1) |
607 |
|
|
608 |
self.__ellps = wxChoice(self, -1) |
self.__ellps = wxChoice(self, -1) |
609 |
self.ellpsData = [("bessel", _("Bessel 1841")), |
self.ellpsData = [("airy" , _("Airy")), |
610 |
|
("bessel", _("Bessel 1841")), |
611 |
("clrk66", _("Clarke 1866")), |
("clrk66", _("Clarke 1866")), |
612 |
("clrk80", _("Clarke 1880")), |
("clrk80", _("Clarke 1880")), |
613 |
("GRS80" , _("GRS 1980 (IUGG, 1980)")), |
("GRS80" , _("GRS 1980 (IUGG, 1980)")), |
764 |
self.receiver = receiver |
self.receiver = receiver |
765 |
|
|
766 |
self.__zone = wxSpinCtrl(self, ID_UTMPANEL_ZONE, "1", min=1, max=60) |
self.__zone = wxSpinCtrl(self, ID_UTMPANEL_ZONE, "1", min=1, max=60) |
767 |
|
self.__propButton = wxButton(self, ID_UTMPANEL_PROP, _("Propose")) |
768 |
self.__south = wxCheckBox(self, ID_UTMPANEL_SOUTH, |
self.__south = wxCheckBox(self, ID_UTMPANEL_SOUTH, |
769 |
_("Southern Hemisphere")) |
_("Southern Hemisphere")) |
|
self.__propButton = wxButton(self, ID_UTMPANEL_PROP, _("Propose")) |
|
770 |
|
|
771 |
self._DoLayout() |
self._DoLayout() |
772 |
|
|