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