[GRASS-dev] Re: grass-dev Digest, Vol 41, Issue 49

On Sep 16, 2009, at 5:25 PM, grass-dev-request@lists.osgeo.org wrote:

Date: Wed, 16 Sep 2009 19:08:38 -0000
From: "GRASS GIS" <trac@osgeo.org>
Subject: [GRASS-dev] [GRASS GIS] #750: wxGUI: scalebar loses focus
To: undisclosed-recipients:;
Message-ID: <040.a968f51a41a425b4779ef44b0d9f7177@osgeo.org>
Content-Type: text/plain; charset="utf-8"

#750: wxGUI: scalebar loses focus
--------------------+-------------------------------------------------------
Reporter: hamish | Owner: grass-dev@lists.osgeo.org
    Type: defect | Status: new
Priority: minor | Milestone: 6.4.0
Component: wxGUI | Version: svn-develbranch6
Keywords: | Platform: Linux
     Cpu: x86-64 |
--------------------+-------------------------------------------------------
Hi,

in the wx Map Display window if you add a scalebar, drag it to the bottom
left, then add a raster legend, after that it is not possible to drag the
scalebar any more, even if you reselect add scalebar from the add overlay
menu. The legend gets dragged around instead.

??

Hamish

What is happening is not quite what it appears. The real problem is that both the scalebar and legend are "maps" because that is how GRASS draws them. The invisible "maps" are the same size as the screen. When you put both a legend and a scalebar on a real (i.e., visible) map and they overlay each other it is sometimes hard to grab the underlying element. If you move the legend out of the way, you can grab and move the scalebar.

There is probably a way to fix this but I didn't figure it out when I first did this, and it hasn't been high enough on the priority list to fix afterwards. What is needed is to somehow clip the graphic of the legend and scalebar so that it closely conforms to the element. However, this would also need to change size if the element changes size.

Michael

talking about legends - how about making the default size smaller - would that help?
I just went through a long assignment with many legends and settled at something like

d.legend mymap at=5,50,2,5

(at=5,50,2,5 is typed into wxGUI and conveniently stays there so
I just change the name of the map and move the legend wherever needed).
I always size the display window so that I have a white area next to the map
and put the legend there. That way I did not have the problem that you mention
with the scalebar.
It would be nice to have a sizing option for the scalebar too
(using at=... similar to the one for legend would work).
That way map elements could be all placed in the white area and won't
interfere with the map image.

Helena

On Sep 16, 2009, at 10:47 PM, Michael Barton wrote:

On Sep 16, 2009, at 5:25 PM, grass-dev-request@lists.osgeo.org wrote:

Date: Wed, 16 Sep 2009 19:08:38 -0000
From: "GRASS GIS" <trac@osgeo.org>
Subject: [GRASS-dev] [GRASS GIS] #750: wxGUI: scalebar loses focus
To: undisclosed-recipients:;
Message-ID: <040.a968f51a41a425b4779ef44b0d9f7177@osgeo.org>
Content-Type: text/plain; charset="utf-8"

#750: wxGUI: scalebar loses focus
--------------------+-------------------------------------------------------
Reporter: hamish | Owner: grass-dev@lists.osgeo.org
    Type: defect | Status: new
Priority: minor | Milestone: 6.4.0
Component: wxGUI | Version: svn-develbranch6
Keywords: | Platform: Linux
     Cpu: x86-64 |
--------------------+-------------------------------------------------------
Hi,

in the wx Map Display window if you add a scalebar, drag it to the bottom
left, then add a raster legend, after that it is not possible to drag the
scalebar any more, even if you reselect add scalebar from the add overlay
menu. The legend gets dragged around instead.

??

Hamish

What is happening is not quite what it appears. The real problem is that both the scalebar and legend are "maps" because that is how GRASS draws them. The invisible "maps" are the same size as the screen. When you put both a legend and a scalebar on a real (i.e., visible) map and they overlay each other it is sometimes hard to grab the underlying element. If you move the legend out of the way, you can grab and move the scalebar.

There is probably a way to fix this but I didn't figure it out when I first did this, and it hasn't been high enough on the priority list to fix afterwards. What is needed is to somehow clip the graphic of the legend and scalebar so that it closely conforms to the element. However, this would also need to change size if the element changes size.

Michael

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

On Sep 16, 2009, at 9:02 PM, Helena Mitasova wrote:

talking about legends - how about making the default size smaller -
would that help?
I just went through a long assignment with many legends and settled
at something like

d.legend mymap at=5,50,2,5

(at=5,50,2,5 is typed into wxGUI and conveniently stays there so
I just change the name of the map and move the legend wherever needed).
I always size the display window so that I have a white area next to
the map
and put the legend there. That way I did not have the problem that
you mention
with the scalebar.
It would be nice to have a sizing option for the scalebar too
(using at=... similar to the one for legend would work).
That way map elements could be all placed in the white area and won't
interfere with the map image.

These are both dependent on the underlying GRASS modules, d.legend and d.barscale.

There is no way to size d.barscale and it has limited customization.
d.legend can be sized. Right now, it initially displays at its default size (I don't know what that is exactly). You can change this in the legend options panel.

Michael

Helena

On Sep 16, 2009, at 10:47 PM, Michael Barton wrote:

On Sep 16, 2009, at 5:25 PM, grass-dev-request@lists.osgeo.org wrote:

Date: Wed, 16 Sep 2009 19:08:38 -0000
From: "GRASS GIS" <trac@osgeo.org>
Subject: [GRASS-dev] [GRASS GIS] #750: wxGUI: scalebar loses focus
To: undisclosed-recipients:;
Message-ID: <040.a968f51a41a425b4779ef44b0d9f7177@osgeo.org>
Content-Type: text/plain; charset="utf-8"

#750: wxGUI: scalebar loses focus
--------------------
+-------------------------------------------------------
Reporter: hamish | Owner: grass-dev@lists.osgeo.org
   Type: defect | Status: new
Priority: minor | Milestone: 6.4.0
Component: wxGUI | Version: svn-develbranch6
Keywords: | Platform: Linux
    Cpu: x86-64 |
--------------------
+-------------------------------------------------------
Hi,

in the wx Map Display window if you add a scalebar, drag it to the
bottom
left, then add a raster legend, after that it is not possible to
drag the
scalebar any more, even if you reselect add scalebar from the add
overlay
menu. The legend gets dragged around instead.

??

Hamish

What is happening is not quite what it appears. The real problem is
that both the scalebar and legend are "maps" because that is how
GRASS draws them. The invisible "maps" are the same size as the
screen. When you put both a legend and a scalebar on a real (i.e.,
visible) map and they overlay each other it is sometimes hard to
grab the underlying element. If you move the legend out of the way,
you can grab and move the scalebar.

There is probably a way to fix this but I didn't figure it out when
I first did this, and it hasn't been high enough on the priority
list to fix afterwards. What is needed is to somehow clip the
graphic of the legend and scalebar so that it closely conforms to
the element. However, this would also need to change size if the
element changes size.

Michael

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
grass-dev Info Page

On Sep 17, 2009, at 12:23 AM, Michael Barton wrote:

On Sep 16, 2009, at 9:02 PM, Helena Mitasova wrote:

talking about legends - how about making the default size smaller -
would that help?
I just went through a long assignment with many legends and settled
at something like

d.legend mymap at=5,50,2,5

(at=5,50,2,5 is typed into wxGUI and conveniently stays there so
I just change the name of the map and move the legend wherever needed).
I always size the display window so that I have a white area next to
the map
and put the legend there. That way I did not have the problem that
you mention
with the scalebar.
It would be nice to have a sizing option for the scalebar too
(using at=... similar to the one for legend would work).
That way map elements could be all placed in the white area and won't
interfere with the map image.

These are both dependent on the underlying GRASS modules, d.legend and d.barscale.

There is no way to size d.barscale and it has limited customization.
d.legend can be sized. Right now, it initially displays at its default size (I don't know what that is exactly). You can change this in the legend options panel.

yes - that is what I was doing.

What I have suggested was to change the DEFAULT size of the legend to something half the size-it is too big and unless you figure out that you can change the size
with at= (which most newcomers cannot) you are stuck, and for old users it would
be just more convenient (no need to figure out what those 4 numbers mean, I never
remember it correctly).

Helena

Michael

Helena

On Sep 16, 2009, at 10:47 PM, Michael Barton wrote:

On Sep 16, 2009, at 5:25 PM, grass-dev-request@lists.osgeo.org wrote:

Date: Wed, 16 Sep 2009 19:08:38 -0000
From: "GRASS GIS" <trac@osgeo.org>
Subject: [GRASS-dev] [GRASS GIS] #750: wxGUI: scalebar loses focus
To: undisclosed-recipients:;
Message-ID: <040.a968f51a41a425b4779ef44b0d9f7177@osgeo.org>
Content-Type: text/plain; charset="utf-8"

#750: wxGUI: scalebar loses focus
--------------------
+-------------------------------------------------------
Reporter: hamish | Owner: grass-dev@lists.osgeo.org
  Type: defect | Status: new
Priority: minor | Milestone: 6.4.0
Component: wxGUI | Version: svn-develbranch6
Keywords: | Platform: Linux
   Cpu: x86-64 |
--------------------
+-------------------------------------------------------
Hi,

in the wx Map Display window if you add a scalebar, drag it to the
bottom
left, then add a raster legend, after that it is not possible to
drag the
scalebar any more, even if you reselect add scalebar from the add
overlay
menu. The legend gets dragged around instead.

??

Hamish

What is happening is not quite what it appears. The real problem is
that both the scalebar and legend are "maps" because that is how
GRASS draws them. The invisible "maps" are the same size as the
screen. When you put both a legend and a scalebar on a real (i.e.,
visible) map and they overlay each other it is sometimes hard to
grab the underlying element. If you move the legend out of the way,
you can grab and move the scalebar.

There is probably a way to fix this but I didn't figure it out when
I first did this, and it hasn't been high enough on the priority
list to fix afterwards. What is needed is to somehow clip the
graphic of the legend and scalebar so that it closely conforms to
the element. However, this would also need to change size if the
element changes size.

Michael

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

On Sep 16, 2009, at 9:29 PM, helena wrote:

On Sep 17, 2009, at 12:23 AM, Michael Barton wrote:

On Sep 16, 2009, at 9:02 PM, Helena Mitasova wrote:

talking about legends - how about making the default size smaller -
would that help?
I just went through a long assignment with many legends and settled
at something like

d.legend mymap at=5,50,2,5

(at=5,50,2,5 is typed into wxGUI and conveniently stays there so
I just change the name of the map and move the legend wherever
needed).
I always size the display window so that I have a white area next to
the map
and put the legend there. That way I did not have the problem that
you mention
with the scalebar.
It would be nice to have a sizing option for the scalebar too
(using at=... similar to the one for legend would work).
That way map elements could be all placed in the white area and won't
interfere with the map image.

These are both dependent on the underlying GRASS modules, d.legend
and d.barscale.

There is no way to size d.barscale and it has limited customization.
d.legend can be sized. Right now, it initially displays at its
default size (I don't know what that is exactly). You can change
this in the legend options panel.

yes - that is what I was doing.

What I have suggested was to change the DEFAULT size of the legend to
something half the size-

That is easy enough to do in the wxpython code

it is too big and unless you figure out that
you can change the size
with at= (which most newcomers cannot) you are stuck, and for old
users it would
be just more convenient (no need to figure out what those 4 numbers
mean, I never
remember it correctly).

I agree with you that it's too big but left it at the default size with the assumption that it was set to that size because most of the devs wanted it that way. If others agree with us, I think making it smaller--or at least thinner--would be an improvement.

Michael

Helena

Michael

Helena

On Sep 16, 2009, at 10:47 PM, Michael Barton wrote:

On Sep 16, 2009, at 5:25 PM, grass-dev-request@lists.osgeo.org
wrote:

Date: Wed, 16 Sep 2009 19:08:38 -0000
From: "GRASS GIS" <trac@osgeo.org>
Subject: [GRASS-dev] [GRASS GIS] #750: wxGUI: scalebar loses focus
To: undisclosed-recipients:;
Message-ID: <040.a968f51a41a425b4779ef44b0d9f7177@osgeo.org>
Content-Type: text/plain; charset="utf-8"

#750: wxGUI: scalebar loses focus
--------------------
+-------------------------------------------------------
Reporter: hamish | Owner: grass-dev@lists.osgeo.org
Type: defect | Status: new
Priority: minor | Milestone: 6.4.0
Component: wxGUI | Version: svn-develbranch6
Keywords: | Platform: Linux
  Cpu: x86-64 |
--------------------
+-------------------------------------------------------
Hi,

in the wx Map Display window if you add a scalebar, drag it to the
bottom
left, then add a raster legend, after that it is not possible to
drag the
scalebar any more, even if you reselect add scalebar from the add
overlay
menu. The legend gets dragged around instead.

??

Hamish

What is happening is not quite what it appears. The real problem is
that both the scalebar and legend are "maps" because that is how
GRASS draws them. The invisible "maps" are the same size as the
screen. When you put both a legend and a scalebar on a real (i.e.,
visible) map and they overlay each other it is sometimes hard to
grab the underlying element. If you move the legend out of the way,
you can grab and move the scalebar.

There is probably a way to fix this but I didn't figure it out when
I first did this, and it hasn't been high enough on the priority
list to fix afterwards. What is needed is to somehow clip the
graphic of the legend and scalebar so that it closely conforms to
the element. However, this would also need to change size if the
element changes size.

Michael

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
grass-dev Info Page

Helena:

talking about legends - how about making the default size
smaller -

...

I just went through a long assignment with many legends and
settled at something like

d.legend mymap at=5,50,2,5

fine, all I ask is that this is done in the wxGUI level with
at=, not in main.c. Note by using at= you shut off automatic
font sizing for CELL maps. (in that case it does what the user asks it to, not what it thinks fits best)

other things rely on the existing behaviour. (d.rast.leg for
example)

after some time it could be "backported" to main.c and scripts
adjusted if everyone likes the new size, but for now please
stick to adjusting the default in the wxGUI caller.

Michael:

Right now, it initially displays at its default size
(I don't know what that is exactly).

the default in main.c is at=12,88,3,7

Helena:

would that help?

no, but we can still talk about it.

Helena:

It would be nice to have a sizing option for the scalebar too
(using at=... similar to the one for legend would work).

it already has at=x%,y% placement. You mean to specify its width/
distance as well? eh... that's automatically determined and it
works quite well so I'm not too excited to start "improving" it.

ps.map's one is at the other end: complete control and no
automation. d.scalebar is a hell of a lot easier to use and we
don't hear complaints.

That way map elements could be all placed in the white area
and won't interfere with the map image.

not sure why that can't happen already. Do you want a vertical
scalebar? perhaps put the white borders at the bottom and top
instead of the sides and create a horizontal legend?

(no need to figure out what those 4 numbers mean, I never
remember it correctly).

d.legend --help
[at=bottom,top,left,right]

(same as d.frame)

Hamish

On Sep 16, 2009, at 11:03 PM, Hamish wrote:

Helena:

talking about legends - how about making the default size
smaller -

...

I just went through a long assignment with many legends and
settled at something like

d.legend mymap at=5,50,2,5

fine, all I ask is that this is done in the wxGUI level with
at=, not in main.c. Note by using at= you shut off automatic
font sizing for CELL maps. (in that case it does what the user asks it to, not what it thinks fits best)

other things rely on the existing behaviour. (d.rast.leg for
example)

after some time it could be "backported" to main.c and scripts
adjusted if everyone likes the new size, but for now please
stick to adjusting the default in the wxGUI caller.

Michael:

Right now, it initially displays at its default size
(I don't know what that is exactly).

the default in main.c is at=12,88,3,7

Helena:

would that help?

no, but we can still talk about it.

Helena:

It would be nice to have a sizing option for the scalebar too
(using at=... similar to the one for legend would work).

it already has at=x%,y% placement. You mean to specify its width/
distance as well? eh... that's automatically determined and it
works quite well so I'm not too excited to start "improving" it.

ps.map's one is at the other end: complete control and no
automation. d.scalebar is a hell of a lot easier to use and we
don't hear complaints.

That way map elements could be all placed in the white area
and won't interfere with the map image.

not sure why that can't happen already. Do you want a vertical
scalebar? perhaps put the white borders at the bottom and top
instead of the sides and create a horizontal legend?

(no need to figure out what those 4 numbers mean, I never
remember it correctly).

d.legend --help
[at=bottom,top,left,right]

(same as d.frame) 6.5

Hamish

Once the map elements new bug is fixed in, I can easily add at=5,50,2,5 to the d.legend command in the wxgui as the new default (this could still be changed by the user subsequently). If everyone likes it we can keep it. It looked pretty good to me--except for the legend freezing and crashing the GUI. Need to trap that error and see what it is.

6.4 still works fine.

Michael

Michael wrote:

Once the map elements new bug is fixed in, I can easily
add at=5,50,2,5 to the d.legend command in the wxgui as the
new default (this could still be changed by the user
subsequently). If everyone likes it we can keep it. It looked
pretty good to me--

me too.

just check how it looks for CELL maps, I suspect it will be
too small and we'd need a type check + a different default
for smooth vs categorical legends. that would probably have
to happen in the C code.

or maybe 5,50,2,5 is ok for all types.
d.rast.leg has its own at= set for FP maps already.

Hamish

On Sep 17, 2009, at 2:29 AM, Hamish wrote:

Michael wrote:

Once the map elements new bug is fixed in, I can easily
add at=5,50,2,5 to the d.legend command in the wxgui as the
new default (this could still be changed by the user
subsequently). If everyone likes it we can keep it. It looked
pretty good to me--

me too.

just check how it looks for CELL maps,

that very much depends how many classes you have -
I have land use map with 6 classes where it works just fine and then
another one (the official USGS land cover) that has 20+
and for that it is certainly too small. I am not sure what the
typical number of classes in cell map would be.

Maybe others who work more with the CELL maps could provide more insight?

Helena

I suspect it will be
too small and we'd need a type check + a different default
for smooth vs categorical legends. that would probably have
to happen in the C code.

or maybe 5,50,2,5 is ok for all types.
d.rast.leg has its own at= set for FP maps already.

Hamish

> or maybe at=5,50,2,5 is ok for all types.

Hamish:

> just check how it looks for CELL maps,

Helena:

that very much depends how many classes you have -
I have land use map with 6 classes where it works just fine and
then another one (the official USGS land cover) that has 20+
and for that it is certainly too small. I am not sure what the
typical number of classes in cell map would be.

Maybe others who work more with the CELL maps could provide
more insight?

fundamentally it's undefined. You can use the thin=, lines=, and
use={DCELL} options to dial in as many categories as you like.

The d.rast.leg case is the one I am stuck finding a solution to; a long
list in a tall thin frame and you don't want the text falling off the
right edge of the display. It's in GRASS 7 so we can't just ignore it. :slight_smile:

It would be easy enough to add a -b flag to trigger a "bigger" default
legend, but I'm sort of iffy about complicating the user interface any
more than it already is. There is lots of control built in but it all
starts to get a bit convoluted after a while. I kind of suspect that
as the author of most of its logic I'm the only one who fully understands
all of its tricks and subtleties (there are many); and I consider that
situation to be a deep flaw in the program. (I did try to explain most
of it in the help page, but...)

?,
Hamish

I changed the default legend size to Helena's suggestion below. It looks pretty good in the tests I did with Spearfish data. But it needs folks to look at it under other circumstances too. Changed in develbranch_6 r39277

Michael
____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University

Phone: 480-965-6262
Fax: 480-965-7671
www: www.public.asu.edu/~cmbarton, http://csdc.asu.edu

On Sep 16, 2009, at 9:02 PM, Helena Mitasova wrote:

talking about legends - how about making the default size smaller -
would that help?
I just went through a long assignment with many legends and settled
at something like

d.legend mymap at=5,50,2,5

(at=5,50,2,5 is typed into wxGUI and conveniently stays there so
I just change the name of the map and move the legend wherever needed).
I always size the display window so that I have a white area next to
the map
and put the legend there. That way I did not have the problem that
you mention
with the scalebar.
It would be nice to have a sizing option for the scalebar too
(using at=... similar to the one for legend would work).
That way map elements could be all placed in the white area and won't
interfere with the map image.

Helena

On Sep 16, 2009, at 10:47 PM, Michael Barton wrote:

On Sep 16, 2009, at 5:25 PM, grass-dev-request@lists.osgeo.org wrote:

Date: Wed, 16 Sep 2009 19:08:38 -0000
From: "GRASS GIS" <trac@osgeo.org>
Subject: [GRASS-dev] [GRASS GIS] #750: wxGUI: scalebar loses focus
To: undisclosed-recipients:;
Message-ID: <040.a968f51a41a425b4779ef44b0d9f7177@osgeo.org>
Content-Type: text/plain; charset="utf-8"

#750: wxGUI: scalebar loses focus
--------------------
+-------------------------------------------------------
Reporter: hamish | Owner: grass-dev@lists.osgeo.org
   Type: defect | Status: new
Priority: minor | Milestone: 6.4.0
Component: wxGUI | Version: svn-develbranch6
Keywords: | Platform: Linux
    Cpu: x86-64 |
--------------------
+-------------------------------------------------------
Hi,

in the wx Map Display window if you add a scalebar, drag it to the
bottom
left, then add a raster legend, after that it is not possible to
drag the
scalebar any more, even if you reselect add scalebar from the add
overlay
menu. The legend gets dragged around instead.

??

Hamish

What is happening is not quite what it appears. The real problem is
that both the scalebar and legend are "maps" because that is how
GRASS draws them. The invisible "maps" are the same size as the
screen. When you put both a legend and a scalebar on a real (i.e.,
visible) map and they overlay each other it is sometimes hard to
grab the underlying element. If you move the legend out of the way,
you can grab and move the scalebar.

There is probably a way to fix this but I didn't figure it out when
I first did this, and it hasn't been high enough on the priority
list to fix afterwards. What is needed is to somehow clip the
graphic of the legend and scalebar so that it closely conforms to
the element. However, this would also need to change size if the
element changes size.

Michael

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
grass-dev Info Page