[GRASS-SVN] r57740 - in grass/trunk: display/d.northarrow gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Sep 18 10:29:48 PDT 2013


Author: annakrat
Date: 2013-09-18 10:29:48 -0700 (Wed, 18 Sep 2013)
New Revision: 57740

Modified:
   grass/trunk/display/d.northarrow/draw_n_arrow.c
   grass/trunk/display/d.northarrow/main.c
   grass/trunk/gui/wxpython/gui_core/widgets.py
Log:
d.northarrow: rename basic_compass to compass and fix gui

Modified: grass/trunk/display/d.northarrow/draw_n_arrow.c
===================================================================
--- grass/trunk/display/d.northarrow/draw_n_arrow.c	2013-09-18 16:57:50 UTC (rev 57739)
+++ grass/trunk/display/d.northarrow/draw_n_arrow.c	2013-09-18 17:29:48 UTC (rev 57740)
@@ -67,7 +67,7 @@
     	    D_pos_abs(x_pos - (tr + tl) / 2, y_pos - 55);
     	    D_text("N");
 	    break;
-    	case 'b':
+    	case 'c':
     	    D_pos_abs(x_pos - (tr + tl) / 2, y_pos - 48.5);
     	    D_text("N");
     	    break;
@@ -129,7 +129,7 @@
     case '9':
     	symbol_size = 17.;
     	break;
-    case 'b':
+    case 'c':
     	symbol_size = 80.;
     	break;
     case 'f':
@@ -142,7 +142,7 @@
     x0 = D_d_to_u_col(x_pos);
     y0 = D_d_to_u_row(y_pos);
 
-    if (n_arrow_num[0] == 'b')
+    if (n_arrow_num[0] == 'c')
 	strcpy(icon, "n_arrows/compass");
     else if (n_arrow_num[0] == 'f')
 	strcpy(icon, "n_arrows/fancy_compass");

Modified: grass/trunk/display/d.northarrow/main.c
===================================================================
--- grass/trunk/display/d.northarrow/main.c	2013-09-18 16:57:50 UTC (rev 57739)
+++ grass/trunk/display/d.northarrow/main.c	2013-09-18 17:29:48 UTC (rev 57740)
@@ -46,7 +46,7 @@
     n_arrow = G_define_option();
     n_arrow->key = "style";
     n_arrow->description = _("North arrow style");
-    n_arrow->options = "1a,1b,2,3,4,5,6,7a,7b,8a,8b,9,fancy_compass,basic_compass";
+    n_arrow->options = "1a,1b,2,3,4,5,6,7a,7b,8a,8b,9,fancy_compass,compass";
     n_arrow->answer = "1a";
     n_arrow->guisection = _("Style");
 

Modified: grass/trunk/gui/wxpython/gui_core/widgets.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/widgets.py	2013-09-18 16:57:50 UTC (rev 57739)
+++ grass/trunk/gui/wxpython/gui_core/widgets.py	2013-09-18 17:29:48 UTC (rev 57740)
@@ -1259,7 +1259,13 @@
 class NArrowsComboBox(PictureComboBox):
     """!ComboBox with north arrows for d.barscale."""
     def _getPath(self, name):
-        return os.path.join(os.getenv("GISBASE"), "etc", "gui", "images",
-                                      'symbols', 'n_arrows', 'n_arrow{name}.png'.format(name=name))
+        path = os.path.join(os.getenv("GISBASE"), "etc", "gui", "images",
+                                      'symbols', 'n_arrows')
+        try:
+            int(name[0])
+            return os.path.join(path, 'n_arrow{name}.png'.format(name=name))
+        except ValueError:
+            return os.path.join(path, '{name}.png'.format(name=name))
+
     def OnMeasureItem(self, item):
         return 32



More information about the grass-commit mailing list