43 |
|
|
44 |
import labeldialog |
import labeldialog |
45 |
|
|
46 |
from messages import LAYER_SELECTED, SHAPES_SELECTED, VIEW_POSITION |
from messages import LAYER_SELECTED, SHAPES_SELECTED, VIEW_POSITION, \ |
47 |
|
SCALE_CHANGED |
48 |
|
|
49 |
|
|
50 |
# |
# |
278 |
delegated_methods = {"SelectLayer": "selection", |
delegated_methods = {"SelectLayer": "selection", |
279 |
"SelectShapes": "selection", |
"SelectShapes": "selection", |
280 |
"SelectedLayer": "selection", |
"SelectedLayer": "selection", |
281 |
"HasSelectedLayer": "selection"} |
"HasSelectedLayer": "selection", |
282 |
|
"HasSelectedShapes": "selection", |
283 |
|
"SelectedShapes": "selection"} |
284 |
|
|
285 |
def __init__(self, parent, winid): |
def __init__(self, parent, winid): |
286 |
wxWindow.__init__(self, parent, winid) |
wxWindow.__init__(self, parent, winid) |
477 |
self.scale = scale |
self.scale = scale |
478 |
self.offset = offset |
self.offset = offset |
479 |
self.full_redraw() |
self.full_redraw() |
480 |
|
self.issue(SCALE_CHANGED, scale) |
481 |
|
|
482 |
def proj_to_win(self, x, y): |
def proj_to_win(self, x, y): |
483 |
"""\ |
"""\ |
532 |
if bbox is not None: |
if bbox is not None: |
533 |
proj = self.map.GetProjection() |
proj = self.map.GetProjection() |
534 |
if proj is not None: |
if proj is not None: |
535 |
|
bbox = proj.ForwardBBox(bbox) |
536 |
|
|
537 |
|
if bbox is not None: |
538 |
|
self.FitRectToWindow(bbox) |
539 |
|
|
540 |
|
def FitSelectedToWindow(self): |
541 |
|
layer = self.selection.SelectedLayer() |
542 |
|
shapes = self.selection.SelectedShapes() |
543 |
|
|
544 |
|
bbox = layer.ShapesBoundingBox(shapes) |
545 |
|
if bbox is not None: |
546 |
|
proj = self.map.GetProjection() |
547 |
|
if proj is not None: |
548 |
bbox = proj.ForwardBBox(bbox) |
bbox = proj.ForwardBBox(bbox) |
549 |
|
|
550 |
if bbox is not None: |
if bbox is not None: |