[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


Comment:

 annakrat:
 > 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
 discovered.

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


 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
 symbol)


 >> "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? :)

 martinl:
 > 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.

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

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


 martinl:
 > (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
 desirable.



 Hamish

-- 
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