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): |