[GRASS-SVN] r33846 - in grass/branches/develbranch_6: display/d.vect gui/wxpython/gui_modules lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Oct 12 07:10:30 EDT 2008


Author: martinl
Date: 2008-10-12 07:10:29 -0400 (Sun, 12 Oct 2008)
New Revision: 33846

Modified:
   grass/branches/develbranch_6/display/d.vect/main.c
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
   grass/branches/develbranch_6/lib/gis/parser.c
Log:
gisprompt: handle color transparency


Modified: grass/branches/develbranch_6/display/d.vect/main.c
===================================================================
--- grass/branches/develbranch_6/display/d.vect/main.c	2008-10-12 10:48:12 UTC (rev 33845)
+++ grass/branches/develbranch_6/display/d.vect/main.c	2008-10-12 11:10:29 UTC (rev 33846)
@@ -161,7 +161,7 @@
     color_opt->answer = DEFAULT_FG_COLOR;
     color_opt->label = _("Line color");
     color_opt->guisection = _("Colors");
-    color_opt->gisprompt = GISPROMPT_COLOR;
+    color_opt->gisprompt = "old_color,color,color_none";
     color_opt->description =
 	_("Either a standard GRASS color, R:G:B triplet, or \"none\"");
 
@@ -171,7 +171,7 @@
     fcolor_opt->answer = "200:200:200";
     fcolor_opt->label = _("Area fill color");
     fcolor_opt->guisection = _("Colors");
-    fcolor_opt->gisprompt = GISPROMPT_COLOR;
+    fcolor_opt->gisprompt = "old_color,color,color_none";
     fcolor_opt->description =
 	_("Either a standard GRASS color, R:G:B triplet, or \"none\"");
 
@@ -250,7 +250,7 @@
     lcolor_opt->answer = "red";
     lcolor_opt->label = _("Label color");
     lcolor_opt->guisection = _("Labels");
-    lcolor_opt->gisprompt = GISPROMPT_COLOR;
+    lcolor_opt->gisprompt = "old_color,color,color";
     lcolor_opt->description = _("Either a standard color name or R:G:B triplet");
 
     bgcolor_opt = G_define_option();
@@ -259,7 +259,7 @@
     bgcolor_opt->answer = "none";
     bgcolor_opt->guisection = _("Labels");
     bgcolor_opt->label = _("Label background color");
-    bgcolor_opt->gisprompt = GISPROMPT_COLOR;
+    bgcolor_opt->gisprompt = "old_color,color,color_none";
     bgcolor_opt->description =
 	_("Either a standard GRASS color, R:G:B triplet, or \"none\"");
 
@@ -269,7 +269,7 @@
     bcolor_opt->answer = "none";
     bcolor_opt->guisection = _("Labels");
     bcolor_opt->label = _("Label border color");
-    bcolor_opt->gisprompt = GISPROMPT_COLOR;
+    bcolor_opt->gisprompt = "old_color,color,color_none";
     bcolor_opt->description =
 	_("Either a standard GRASS color, R:G:B triplet, or \"none\"");
 

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2008-10-12 10:48:12 UTC (rev 33845)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2008-10-12 11:10:29 UTC (rev 33846)
@@ -1132,6 +1132,7 @@
                                 flag=wx.ADJUST_MINSIZE | wx.RIGHT | wx.LEFT | wx.TOP, border=5)
                 # GIS element entry
                 if p.get('prompt','') not in ('color',
+                                              'color_none',
                                               'dbcolumn',
                                               'dbtable',
                                               'layer') and \
@@ -1180,16 +1181,15 @@
                     which_sizer.Add(item=win, proportion=0,
                                     flag=wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT, border=5)
                 # color entry
-                elif p.get('prompt', '') == 'color':
-                    # Heuristic way of finding whether transparent is allowed
-                    handle_transparency =  'none' in p.get('description', '')
+                elif p.get('prompt', '') in ('color',
+                                             'color_none'):
                     default_color = (200,200,200)
                     label_color = _("Select Color")
                     if p.get('default','') != '':
                         default_color, label_color = color_resolve( p['default'] )
                     if p.get('value','') != '': # parameter previously set
                         default_color, label_color = color_resolve( p['value'] )
-                    if handle_transparency:
+                    if p.get('prompt', '') == 'color_none':
                         this_sizer = wx.BoxSizer(orient=wx.HORIZONTAL )
                     else:
                         this_sizer = which_sizer
@@ -1202,7 +1202,7 @@
                     # the selector proper and either a "transparent" button or None
                     p['wxId'] = [btn_colour.GetId(),]
                     btn_colour.Bind(csel.EVT_COLOURSELECT,  self.OnColorChange )
-                    if handle_transparency:
+                    if p.get('prompt', '') == 'color_none':
                         none_check = wx.CheckBox(which_panel, wx.ID_ANY, _("Transparent") )
                         if p.get('value','') != '' and p.get('value',[''])[0] == "none":
                             none_check.SetValue(True)

Modified: grass/branches/develbranch_6/lib/gis/parser.c
===================================================================
--- grass/branches/develbranch_6/lib/gis/parser.c	2008-10-12 10:48:12 UTC (rev 33845)
+++ grass/branches/develbranch_6/lib/gis/parser.c	2008-10-12 11:10:29 UTC (rev 33846)
@@ -624,7 +624,7 @@
 	Opt->key_desc = "name";
 	Opt->required = NO;
 	Opt->answer = DEFAULT_FG_COLOR;
-	Opt->gisprompt = GISPROMPT_COLOR;
+	Opt->gisprompt = "old_color,color,color";
 	Opt->label = _("Color");
 	Opt->description = _("Either a standard color name or R:G:B triplet");
 	break;
@@ -634,7 +634,7 @@
 	Opt->key_desc = "name";
 	Opt->required = NO;
 	Opt->answer = DEFAULT_BG_COLOR;
-	Opt->gisprompt = GISPROMPT_COLOR;
+	Opt->gisprompt = "old_color,color,color_none";
 	Opt->label = _("Background color");
 	Opt->description =
 	    _("Either a standard GRASS color, R:G:B triplet, or \"none\"");



More information about the grass-commit mailing list