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

GRASS GIS trac at osgeo.org
Mon Sep 16 22:42:03 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:  svn-trunk                
 Keywords:  decorations, d.barscale, d.legend, d.northarrow  |    Platform:  All                      
      Cpu:  All                                              |  
Changes (by hamish):

  * keywords:  decorations, d.barscale, d.legend => decorations,
               d.barscale, d.legend, d.northarrow
  * version:  unspecified => svn-trunk


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

 Yes, I don't mind at all if right click opens a context menu, it could
 be a nice time-saver, but I think it should be available in another way
 too. IIUC the idea is to right-click on the menubar icon? If so I don't
 think that's something I would ever try if not told about it, but maybe
 I should try that more & there's a world of functionality I've never

 but maybe I don't understand the suggestion, ie what's being right-

 an idea for a single barscale or north arrow would be to keep the menu-
 bar icon depressed when active as a push-button, and clicking to raise
 it again would turn it off. Like how a bold or italics button works in a
 word processor. the help page could instruct to use command layers to add
 a second legend for the rare times people would like to do that.

 so single click on the menubar icon calls the d.* module with --ui, then
 when the user presses ok the decoration is drawn on the monitor, and
 the menubar icon remains depressed. right clicking on the depressed icon
 would get you back to the module --ui (if command line options were
 remembered you can do full command line + '--ui' to get pre-seeded menus
 using the recently-used option settings; or at least that works in G6).
 left clicking on the depressed menubar icon removes it from the display
 and raises the button again.

 second legends, barscales, and north arrows could be added as command
 layers with an mini-tutorial in the help pages on how to do that.

 what do you think? could the at= option survive for the second entry into
 the module UI? (e.g. if you like the placement but want to change the
 color when the backdrop raster is replaced by one of similar hue to the

 >> "glass pane" slide.
 > 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).

 that is excellent news, thanks. (you mentioned it before and I forgot? :)

 > Instead of making wrapper for adding north arrow (it will also require
 > to hide north arrow related options when adding barscale in wxGUI) what
 > about splitting this functionality into two separate modules,
 > ie. d.barscale and d.northarrow?

 sure, done.

 > I completely agree. I just thought there is some reason that it's one

 barscale and north arrows were in one module simply because they shared
 of the same placement, color, & text options and it saved some time to
 maintain the code once. but it makes sense to split them out, the
 color had problems trying to be two things at once anyway.

 > (it will introduce limitation, you will be able to add only one
 > decoration of given type). The question is if we want to allow the
 > user to add multiple barscales, northarrows or legends.

 multiple barscales can be useful for showing both miles and km, and of
 course allowing both a barscale and a northarrow at the same time is


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

More information about the grass-dev mailing list