40 |
|
|
41 |
class MainWindow(wxFrame): |
class MainWindow(wxFrame): |
42 |
|
|
43 |
def __init__(self, parent, ID, application, interactor): |
def __init__(self, parent, ID, title, application, interactor, |
44 |
wxFrame.__init__(self, parent, ID, 'Thuban', |
initial_message = None, size = wxSize(-1, -1)): |
45 |
wxDefaultPosition, wxSize(400, 300)) |
wxFrame.__init__(self, parent, ID, title, wxDefaultPosition, size) |
46 |
|
|
47 |
self.application = application |
self.application = application |
48 |
self.interactor = interactor |
self.interactor = interactor |
49 |
|
|
50 |
self.CreateStatusBar() |
self.CreateStatusBar() |
51 |
self.SetStatusText("This is the wxPython-based " |
if initial_message: |
52 |
"Graphical User Interface for exploring geographic data") |
self.SetStatusText(initial_message) |
53 |
|
|
54 |
self.identify_view = None |
self.identify_view = None |
55 |
|
|
524 |
"""Return true if a layer is selected in the context""" |
"""Return true if a layer is selected in the context""" |
525 |
return context.mainwindow.has_selected_layer() |
return context.mainwindow.has_selected_layer() |
526 |
|
|
527 |
|
def _has_tree_window_shown(context): |
528 |
|
"""Return true if the tree window is shown""" |
529 |
|
return context.mainwindow.get_open_dialog("session_tree") is None |
530 |
|
|
531 |
# File menu |
# File menu |
532 |
_method_command("new_session", "&New Session", "NewSession") |
_method_command("new_session", "&New Session", "NewSession") |
533 |
_method_command("open_session", "&Open Session", "OpenSession") |
_method_command("open_session", "&Open Session", "OpenSession") |
534 |
_method_command("save_session", "&Save Session", "SaveSession") |
_method_command("save_session", "&Save Session", "SaveSession") |
535 |
_method_command("save_session_as", "Save Session &As", "SaveSessionAs") |
_method_command("save_session_as", "Save Session &As", "SaveSessionAs") |
536 |
_method_command("show_session_tree", "Show Session &Tree", "ShowSessionTree") |
_method_command("show_session_tree", "Show Session &Tree", "ShowSessionTree", |
537 |
|
sensitive = _has_tree_window_shown) |
538 |
_method_command("exit", "&Exit", "Exit") |
_method_command("exit", "&Exit", "Exit") |
539 |
|
|
540 |
# Help menu |
# Help menu |