112 |
return menu_bar |
return menu_bar |
113 |
|
|
114 |
def build_menu(self, menudesc): |
def build_menu(self, menudesc): |
115 |
"""Build and return a wxMenu from a menudescription""" |
"""Return a wxMenu built from the menu description menudesc""" |
116 |
wxmenu = wxMenu() |
wxmenu = wxMenu() |
117 |
last = None |
last = None |
118 |
for item in menudesc.items: |
for item in menudesc.items: |
|
# here the items must all be Menu instances themselves |
|
119 |
if item is None: |
if item is None: |
120 |
# a separator. Only add one if the last item was not a |
# a separator. Only add one if the last item was not a |
121 |
# separator |
# separator |
219 |
"""Run a modal message box with the given text, title and flags |
"""Run a modal message box with the given text, title and flags |
220 |
and return the result""" |
and return the result""" |
221 |
dlg = wxMessageDialog(self, text, title, flags) |
dlg = wxMessageDialog(self, text, title, flags) |
222 |
|
dlg.CenterOnParent() |
223 |
result = dlg.ShowModal() |
result = dlg.ShowModal() |
224 |
dlg.Destroy() |
dlg.Destroy() |
225 |
return result |
return result |
251 |
text = "(%10.10g, %10.10g)" % pos |
text = "(%10.10g, %10.10g)" % pos |
252 |
else: |
else: |
253 |
text = "" |
text = "" |
254 |
|
self.set_position_text(text) |
255 |
|
|
256 |
|
def set_position_text(self, text): |
257 |
|
"""Set the statusbar text showing the current position. |
258 |
|
|
259 |
|
By default the text is shown in field 0 of the status bar. |
260 |
|
Override this method in derived classes to put it into a |
261 |
|
different field of the statusbar. |
262 |
|
""" |
263 |
self.SetStatusText(text) |
self.SetStatusText(text) |
264 |
|
|
265 |
def save_modified_session(self, can_veto = 1): |
def save_modified_session(self, can_veto = 1): |
346 |
self.RunMessageBox("About", |
self.RunMessageBox("About", |
347 |
("Thuban is a program for\n" |
("Thuban is a program for\n" |
348 |
"exploring geographic data.\n" |
"exploring geographic data.\n" |
349 |
"Copyright (C) 2001 Intevation GmbH.\n" |
"Copyright (C) 2001, 2002 Intevation GmbH.\n" |
350 |
"Thuban is licensed under the GPL"), |
"Thuban is licensed under the GPL"), |
351 |
wxOK | wxICON_INFORMATION) |
wxOK | wxICON_INFORMATION) |
352 |
|
|