russell: thuban/Thuban/UI mainwindow.py,1.137,1.138

Bernhard Herzog bh at intevation.de
Thu Jan 20 19:33:25 CET 2005


cvs at intevation.de writes:

> --- mainwindow.py	11 Jan 2005 16:52:40 -0000	1.137
> +++ mainwindow.py	20 Jan 2005 17:55:23 -0000	1.138
> @@ -340,6 +340,19 @@
>              text = "(%10.10g, %10.10g)" % pos
>          else:
>              text = ""
> +            map = self.canvas.Map()
> +            for layer in map.layers:
> +                bbox = layer.LatLongBoundingBox()
> +                if bbox:
> +                    left, bottom, right, top = bbox
> +                    if not (-180 <= left <= 180 and
> +                        -180 <= right <= 180 and
> +                        -90 <= top <= 90 and
> +                        -90 <= bottom <= 90):
> +                        text = ("Select '"+layer.title+"' and pick a " +
> +                            "projection using Layer/Projection...")
> +                        break
> +

Why is this it in view_position_changed?  That method is called for
*every* mouse move!  AFAICT, this branch is only executed when the mouse
leaves the canvas window, so it's not that often, but the
view_position_changed does is not the right place to put this code.  I
don't have a better solution at hand, but the view_position_changed is
only there to update the current position.  If other information is to
be shown in the status bar it should be handled in a different way and
by other methods.

The status bar widget supports some kind of stack of texts.  maybe that
can be used to distinguis between short-lived information such as the
mouse position and more permanent information such as the hint about the
projections.

   Bernhard

-- 
Intevation GmbH                                 http://intevation.de/
Skencil                                           http://skencil.org/
Thuban                                  http://thuban.intevation.org/




More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)