Subject: fvwmrc_convert: use new MenuStyle command style

From: Julian Gilbey <[email-masked]>
Date: Sun, 14 Mar 1999 02:26:02 +0000 (GMT)

This one uses the new form of the MenuStyle command, and makes the
relevant part of the code much nicer.  Just pipe this mail into patch
whilst in the utils directory ;-)  It's a patch against the latest
version of fvwmrc_convert (at least, the 2.2 version with my previous
patches applied 8-)  It's now 41 lines shorter; how many patches can
say that?!

   Julian

--- fvwmrc_convert.orig	Sun Mar 14 01:52:21 1999
+++ fvwmrc_convert	Sun Mar 14 02:21:04 1999
@@ -75,13 +75,6 @@
 	stdforecolor="";            dflt["stdforecolor"] = "black";
 	stdbackcolor="";            dflt["stdbackcolor"] = "grey70";
 
-	menuforecolor="";           dflt["menuforecolor"] = "black";
-	menubackcolor="";           dflt["menubackcolor"] = "grey70";
-	menustipplecolor="";        dflt["menustipplecolor"] = "grey40";
-	font="";                    dflt["font"] = "-adobe-helvetica-medium-r-*-*-18-*-*-*-*-*-iso8859-1";
-	mwmmenus="";                dflt["mwmmenus"] = "fvwm";
-	menustyle=FALSE;
-
 	inpopup=FALSE;
 	infunction=FALSE;
 	prefix="";
@@ -136,62 +129,32 @@
 
 ########## Menu Colors, Style and Font ###########
 /^[ \t]*MenuForeColor[ \t]*/	{
-        dflt["menuforecolor"]=menuforecolor=$2;
-	printf ("#!%s (new command=MenuStyle)\n", $0);
-	if (menubackcolor != "" && menuforecolor != "" && menustipplecolor != "" && font != "" && mwmmenus != "" && !menustyle) {
-           printf ("\n#Set the foreground, background and stipple color and font for menus\n");
-	   printf ("MenuStyle   %s %s %s %s %s\n", menuforecolor, menubackcolor, menustipplecolor, font, mwmmenus);
-	   menustyle=TRUE;
-	} else
-	   menustyle=FALSE;
-        next;
+	printf ("#!%s\n", $0);
+	printf ("MenuStyle * Foreground %s\n", $2);
+	next;
 }
 
 /^[ \t]*MenuBackColor[ \t]*/	{
-        dflt["menubackcolor"]=menubackcolor=$2;
-	printf ("#!%s (new command=MenuStyle)\n", $0);
-	if (menubackcolor != "" && menuforecolor != "" && menustipplecolor != "" && font != "" && mwmmenus != "" && !menustyle) {
-           printf ("\n#Set the foreground, background and stipple color and font for menus\n");
-	   printf ("MenuStyle   %s %s %s %s %s\n", menuforecolor, menubackcolor, menustipplecolor, font, mwmmenus);
-	   menustyle=TRUE;
-        } else
-	   menustyle=FALSE;
-        next;
+	printf ("#!%s\n", $0);
+	printf ("MenuStyle * Background %s\n", $2);
+	next;
 }
 
 /^[ \t]*MenuStippleColor[ \t]*/	{
-        dflt["menustipplecolor"]=menustipplecolor=$2;
-	printf ("#!%s (new command=MenuStyle)\n", $0);
-	if (menubackcolor != "" && menuforecolor != "" && menustipplecolor != "" && font != "" && mwmmenus != "" && !menustyle) {
-           printf ("\n#Set the foreground, background and stipple color and font for menus\n");
-	   printf ("MenuStyle   %s %s %s %s %s\n", menuforecolor, menubackcolor, menustipplecolor, font, mwmmenus);
-	   menustyle=TRUE;
-        } else
-	   menustyle=FALSE;
-        next;
+	printf ("#!%s\n", $0);
+	printf ("MenuStyle * Greyed %s\n", $2);
+	next;
 }
 
 /^[ \t]*MWMMenus[ \t]*/		{
-        dflt["mwmmenus"]=mwmmenus="mwm";
-	printf ("#!%s (new command=MenuStyle)\n", $0);
-	if (menubackcolor != "" && menuforecolor != "" && menustipplecolor != "" && font != "" && mwmmenus != "" && !menustyle) {
-           printf ("\n#Set the foreground, background and stipple color and font for menus\n");
-	   printf ("MenuStyle   %s %s %s %s %s\n", menuforecolor, menubackcolor, menustipplecolor, font, mwmmenus);
-	   menustyle=TRUE;
-	} else
-	   menustyle=FALSE;
+	printf ("#!%s\n", $0);
+	printf ("MenuStyle * mwm\n");
 	next;
 }
 
 /^[ \t]*Font[ \t]*/		{
-        dflt["font"]=font=$2;
-	printf ("#!%s (new command=MenuStyle)\n", $0);
-	if (menubackcolor != "" && menuforecolor != "" && menustipplecolor != "" && font != "" && mwmmenus != "" && !menustyle) {
-           printf ("\n#Set the foreground, background and stipple color and font for menus\n");
-	   printf ("MenuStyle   %s %s %s %s %s\n", menuforecolor, menubackcolor, menustipplecolor, font, mwmmenus);
-	   menustyle=TRUE;
-	} else
-	   menustyle=FALSE;
+	printf ("#!%s\n", $0);
+	printf ("MenuStyle * Font %s\n", $2);
 	next;
 }
 
@@ -552,10 +515,6 @@
 }
 
 END {
-    if (!menustyle) {
-	printf ("\n#Set the foreground, background and stipple color and font for menus\n");
-	printf ("MenuStyle   %s %s %s %s %s\n", dflt["menuforecolor"], dflt["menubackcolor"], dflt["menustipplecolor"], dflt["font"], dflt["mwmmenus"]);
-    }
     if (!hilightcolor) {
 	printf ("\n#Set the foreground and background color for selected windows\n");
 	printf ("HilightColor   %s %s\n", dflt["hiforecolor"], dflt["hibackcolor"]);

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

  Julian Gilbey, Dept of Maths, QMW, Univ. of London. [email-masked]
             Debian GNU/Linux Developer.  [email-masked]
       -*- Finger [email-masked] for my PGP public key. -*-
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]