[GRASS-dev] [GRASS GIS] #2080: wxGUI: changing properties of barscale or legend

GRASS GIS trac at osgeo.org
Mon Sep 16 06:26:43 PDT 2013

#2080: wxGUI: changing properties of barscale or legend
 Reporter:  martinl                            |       Owner:  grass-dev@…              
     Type:  enhancement                        |      Status:  new                      
 Priority:  normal                             |   Milestone:  7.0.0                    
Component:  wxGUI                              |     Version:  unspecified              
 Keywords:  decorations, d.barscale, d.legend  |    Platform:  All                      
      Cpu:  All                                |  

Comment(by annakrat):

 Replying to [ticket:2080 martinl]:
 > My suggestion is to avoid the first dialog. Clicking on decoration would
 launch properties dialog immediately. Right click shows contextual menu
 with one item 'Hide'. To show decoration you would go to the toolbar and
 to add selected decoration again. Or global contextual menu (which has
 currently only one item 'Copy to clipboard..') could have item to
 'Show/hide barscale', 'Show/hide legend', ...

 This sounds good to me. Right click is intuitive enough for me but usually
 the functionality is also accessible in another way (and now I have no
 idea how).

 Replying to [comment:2 hamish]:
 > I can't find a ticket for it right now in a search, but the other big
 issue with the GUI legends and barscales is the full-window "glass pane"
 slide. If you grab on one side of the decoration it works, on the other
 side it doesn't. the solution seems to be to render the graphic at=50,50,
 then crop away to ~15 pixels around the outer extent of the graphics so
 grabbing the top-"glass pane" will move the decoration you expect, not the
 one who's "glass pane" happens to be on top. ..or find some other method
 to overlay them on the map canvas.

 Actually, I found a solution for it recently but I haven't implemented it
 yet. PIL can trim the image automatically:

     imageBox = pilImage.getbbox()
     cropped = pilImage.crop(imageBox)

 so you just have to convert it to PIL (or load it directly from file) and
 back to wx. And place the legend or barscale on a reasonable place (not
 just 0, 0).

 > Another issue with the current method is that the north arrows (which
 should probably be presented separate to the barscales in the GUI (perhaps
 using wrapper scripts?) tend to get clipped off the edge of the
 transparent background layer they are rendered on when using the default
 placement. Otherwise I would have liked to swap the default GUI
 legend/barscale placement top-bottom.

 wrapper script seems to be a good idea

Ticket URL: <https://trac.osgeo.org/grass/ticket/2080#comment:3>
GRASS GIS <http://grass.osgeo.org>

More information about the grass-dev mailing list