1 |
# Copyright (C) 2001 by Intevation GmbH |
# Copyright (C) 2001, 2002 by Intevation GmbH |
2 |
# Authors: |
# Authors: |
3 |
# Jan-Oliver Wagner <[email protected]> |
# Jan-Oliver Wagner <[email protected]> |
4 |
# Bernhard Herzog <[email protected]> |
# Bernhard Herzog <[email protected]> |
30 |
|
|
31 |
import main |
import main |
32 |
from command import registry, Command |
from command import registry, Command |
33 |
from messages import SELECTED_SHAPE |
from messages import SELECTED_SHAPE, VIEW_POSITION |
34 |
|
|
35 |
|
|
36 |
# the directory where the toolbar icons are stored |
# the directory where the toolbar icons are stored |
111 |
|
|
112 |
# Create the map canvas |
# Create the map canvas |
113 |
canvas = view.MapCanvas(self, -1, interactor) |
canvas = view.MapCanvas(self, -1, interactor) |
114 |
|
canvas.Subscribe(VIEW_POSITION, self.view_position_changed) |
115 |
self.canvas = canvas |
self.canvas = canvas |
116 |
|
|
117 |
self.init_dialogs() |
self.init_dialogs() |
224 |
def get_open_dialog(self, name): |
def get_open_dialog(self, name): |
225 |
return self.dialogs.get(name) |
return self.dialogs.get(name) |
226 |
|
|
227 |
|
def view_position_changed(self): |
228 |
|
pos = self.canvas.CurrentPosition() |
229 |
|
if pos is not None: |
230 |
|
text = "(%10.10g, %10.10g)" % pos |
231 |
|
else: |
232 |
|
text = "" |
233 |
|
self.SetStatusText(text) |
234 |
|
|
235 |
def save_modified_session(self, can_veto = 1): |
def save_modified_session(self, can_veto = 1): |
236 |
"""If the current session has been modified, ask the user |
"""If the current session has been modified, ask the user |
237 |
whether to save it and do so if requested. Return the outcome of |
whether to save it and do so if requested. Return the outcome of |
313 |
wxOK | wxICON_INFORMATION) |
wxOK | wxICON_INFORMATION) |
314 |
|
|
315 |
def AddLayer(self): |
def AddLayer(self): |
316 |
dlg = wxFileDialog(self, "Select a session file", ".", "", "*.*", |
dlg = wxFileDialog(self, "Select a data file", ".", "", "*.*", |
317 |
wxOPEN) |
wxOPEN) |
318 |
if dlg.ShowModal() == wxID_OK: |
if dlg.ShowModal() == wxID_OK: |
319 |
filename = dlg.GetPath() |
filename = dlg.GetPath() |