101 |
|
|
102 |
self.init_dialogs() |
self.init_dialogs() |
103 |
|
|
104 |
EVT_CLOSE(self, self.OnClose) |
EVT_CLOSE(self, self._OnClose) |
105 |
|
|
106 |
def Subscribe(self, channel, *args): |
def Subscribe(self, channel, *args): |
107 |
"""Subscribe a function to a message channel. |
"""Subscribe a function to a message channel. |
389 |
def Exit(self): |
def Exit(self): |
390 |
self.Close(false) |
self.Close(false) |
391 |
|
|
392 |
def OnClose(self, event): |
def _OnClose(self, event): |
393 |
result = self.save_modified_session(can_veto = event.CanVeto()) |
result = self.save_modified_session(can_veto = event.CanVeto()) |
394 |
if result == wxID_CANCEL: |
if result == wxID_CANCEL: |
395 |
event.Veto() |
event.Veto() |
398 |
# wx's destroy event, but that isn't implemented for wxGTK |
# wx's destroy event, but that isn't implemented for wxGTK |
399 |
# yet. |
# yet. |
400 |
self.canvas.Unsubscribe(VIEW_POSITION, self.view_position_changed) |
self.canvas.Unsubscribe(VIEW_POSITION, self.view_position_changed) |
401 |
|
DockFrame._OnClose(self, event) |
402 |
self.Destroy() |
self.Destroy() |
403 |
|
|
404 |
def SetMap(self, map): |
def SetMap(self, map): |
524 |
def LayerTransparentFill(self): |
def LayerTransparentFill(self): |
525 |
layer = self.current_layer() |
layer = self.current_layer() |
526 |
if layer is not None: |
if layer is not None: |
527 |
layer.GetClassification().SetDefaultFill(Color.None) |
layer.GetClassification().SetDefaultFill(Color.Transparent) |
528 |
|
|
529 |
def LayerOutlineColor(self): |
def LayerOutlineColor(self): |
530 |
layer = self.current_layer() |
layer = self.current_layer() |
536 |
def LayerNoOutline(self): |
def LayerNoOutline(self): |
537 |
layer = self.current_layer() |
layer = self.current_layer() |
538 |
if layer is not None: |
if layer is not None: |
539 |
layer.GetClassification().SetDefaultLineColor(Color.None) |
layer.GetClassification().SetDefaultLineColor(Color.Transparent) |
540 |
|
|
541 |
def HideLayer(self): |
def HideLayer(self): |
542 |
layer = self.current_layer() |
layer = self.current_layer() |
611 |
title = "Legend: %s" % self.Map().Title() |
title = "Legend: %s" % self.Map().Title() |
612 |
dialog = self.CreateDock(name, -1, title, wxLAYOUT_LEFT) |
dialog = self.CreateDock(name, -1, title, wxLAYOUT_LEFT) |
613 |
legend.LegendPanel(dialog, None, self) |
legend.LegendPanel(dialog, None, self) |
614 |
|
dialog.Dock() |
615 |
|
|
616 |
dialog.GetPanel().SetMap(self.Map()) |
dialog.GetPanel().SetMap(self.Map()) |
617 |
dialog.Show() |
dialog.Show() |
717 |
_method_command("open_session", _("&Open Session"), "OpenSession") |
_method_command("open_session", _("&Open Session"), "OpenSession") |
718 |
_method_command("save_session", _("&Save Session"), "SaveSession") |
_method_command("save_session", _("&Save Session"), "SaveSession") |
719 |
_method_command("save_session_as", _("Save Session &As"), "SaveSessionAs") |
_method_command("save_session_as", _("Save Session &As"), "SaveSessionAs") |
720 |
_method_command("show_session_tree", _("Show Session &Tree"), "ShowSessionTree", |
_method_command("show_session_tree", _("Session &Tree"), "ShowSessionTree", |
721 |
sensitive = _has_tree_window_shown) |
sensitive = _has_tree_window_shown) |
722 |
|
_method_command("show_legend", _("Legend"), "ShowLegend", |
723 |
|
sensitive = _has_legend_shown) |
724 |
_method_command("exit", _("E&xit"), "Exit") |
_method_command("exit", _("E&xit"), "Exit") |
725 |
|
|
726 |
# Help menu |
# Help menu |
788 |
sensitive = _has_selected_layer) |
sensitive = _has_selected_layer) |
789 |
_method_command("layer_classifier", _("Classify"), "Classify", |
_method_command("layer_classifier", _("Classify"), "Classify", |
790 |
sensitive = _has_selected_layer) |
sensitive = _has_selected_layer) |
|
_method_command("show_legend", _("Show Legend"), "ShowLegend", |
|
|
sensitive = _has_legend_shown) |
|
791 |
|
|
792 |
# the menu structure |
# the menu structure |
793 |
main_menu = Menu("<main>", "<main>", |
main_menu = Menu("<main>", "<main>", |
794 |
[Menu("file", _("&File"), |
[Menu("file", _("&File"), |
795 |
["new_session", "open_session", None, |
["new_session", "open_session", None, |
796 |
"save_session", "save_session_as", None, |
"save_session", "save_session_as", None, |
797 |
"show_session_tree", None, |
"show_session_tree", |
798 |
"show_legend", None, |
"show_legend", None, |
799 |
"exit"]), |
"exit"]), |
800 |
Menu("map", _("&Map"), |
Menu("map", _("&Map"), |