61 |
self.panel_edit = wxPanel(self, -1) |
self.panel_edit = wxPanel(self, -1) |
62 |
self.panel_buttons = wxPanel(self, -1) |
self.panel_buttons = wxPanel(self, -1) |
63 |
self.label_5 = wxStaticText(self.panel_1, -1, _("Available Projections:")) |
self.label_5 = wxStaticText(self.panel_1, -1, _("Available Projections:")) |
64 |
self.availprojs = wxListBox(self.panel_1, ID_PROJ_AVAIL, style=wxLB_EXTENDED |wxLB_SORT) |
self.availprojs = wxListBox(self.panel_1, ID_PROJ_AVAIL, style=wxLB_EXTENDED|wxLB_SORT) |
65 |
self.projfilepath = wxStaticText(self.panel_1, -1, "") |
self.projfilepath = wxStaticText(self.panel_1, -1, "") |
66 |
self.label_2 = wxStaticText(self.panel_edit, -1, _("Name:")) |
self.label_2 = wxStaticText(self.panel_edit, -1, _("Name:")) |
67 |
self.projname = wxTextCtrl(self.panel_edit, ID_PROJ_PROJNAME, "") |
self.projname = wxTextCtrl(self.panel_edit, ID_PROJ_PROJNAME, "") |
385 |
|
|
386 |
return proj |
return proj |
387 |
|
|
388 |
def __FillAvailList(self): |
def __FillAvailList(self, selectCurrent = False): |
389 |
self.availprojs.Clear() |
self.availprojs.Clear() |
390 |
|
|
391 |
# |
# |
392 |
|
# We add the current projection to the list first so that |
393 |
|
# we are sure that it's at index 0. That way we can |
394 |
|
# set the selection with confidence. The problem is the |
395 |
|
# the list is automatically sorted when an item is appended |
396 |
|
# and the index of where it was inserted is not returned. |
397 |
|
# |
398 |
|
proj = self.receiver.GetProjection() |
399 |
|
if proj is not None: |
400 |
|
self.availprojs.Append(_("%s (current)") % proj.GetName(), |
401 |
|
[proj, None]) |
402 |
|
if selectCurrent: |
403 |
|
self.availprojs.SetSelection(0) |
404 |
|
self.availprojs.SetFirstItem(0) |
405 |
|
|
406 |
|
# |
407 |
# the list can never be empty. there will always be |
# the list can never be empty. there will always be |
408 |
# at least this one item |
# at least this one item |
409 |
# |
# |
426 |
self.availprojs.Append(proj.GetName(), [proj, projfile]) |
self.availprojs.Append(proj.GetName(), [proj, projfile]) |
427 |
self.__usrProjFile = projfile |
self.__usrProjFile = projfile |
428 |
|
|
|
# projfiles = GetSystemProjFiles() |
|
|
# for projfile in projfiles: |
|
|
# for proj in projfile.GetProjections(): |
|
|
# self.availprojs.Append(proj.GetName(), [proj, projfile]) |
|
|
# self.__sysProjFiles = projfiles |
|
|
|
|
|
# projfiles = GetUserProjFiles() |
|
|
# for projfile in projfiles: |
|
|
# for proj in projfile.GetProjections(): |
|
|
# self.availprojs.Append(proj.GetName(), [proj, projfile]) |
|
|
# self.__usrProjFiles = projfiles |
|
|
|
|
|
proj = self.receiver.GetProjection() |
|
|
if proj is not None: |
|
|
self.availprojs.Append(_("%s (current)") % proj.GetName(), |
|
|
[proj, None]) |
|
|
|
|
429 |
for proj, name, clazz in self.projPanels: |
for proj, name, clazz in self.projPanels: |
430 |
self.projchoice.Append(name, [clazz, None]) |
self.projchoice.Append(name, [clazz, None]) |
431 |
|
|
432 |
def __set_properties(self): |
def __set_properties(self): |
|
self.__FillAvailList() |
|
433 |
|
|
|
# begin wxGlade: ProjFrame.__set_properties |
|
434 |
self.SetTitle(_("Projections")) |
self.SetTitle(_("Projections")) |
435 |
self.availprojs.SetSelection(0) |
self.availprojs.SetSelection(0) |
436 |
self.projchoice.SetSelection(0) |
self.projchoice.SetSelection(0) |
437 |
# end wxGlade |
|
438 |
|
self.__FillAvailList(selectCurrent = True) |
439 |
|
|
440 |
self.projname.SetMaxLength(32) |
self.projname.SetMaxLength(32) |
441 |
|
|