From f60cc834eee46febac7e1dd4f2c07f7419aefd7d Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Thu, 8 Nov 2012 20:54:49 +0000
Subject: [PATCH] kind "macro" -> attribute "Macro", value "Gmsh"

---
 Common/GmshMessage.cpp | 1 +
 Common/onelab.h        | 2 +-
 Fltk/onelabGroup.cpp   | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Common/GmshMessage.cpp b/Common/GmshMessage.cpp
index 0a8ae573f1..3cd9d08536 100644
--- a/Common/GmshMessage.cpp
+++ b/Common/GmshMessage.cpp
@@ -777,6 +777,7 @@ static void _setStandardOptions(onelab::parameter *p,
   if(fopt.count("ReadOnly")) p->setReadOnly(fopt["ReadOnly"][0] ? true : false);
   if(copt.count("Highlight")) p->setAttribute("Highlight", copt["Highlight"][0]);
   if(copt.count("AutoCheck")) p->setAttribute("AutoCheck", copt["AutoCheck"][0]);
+  if(copt.count("Macro")) p->setAttribute("Macro", copt["Macro"][0]);
 }
 
 static std::string _getParameterName(const std::string &key,
diff --git a/Common/onelab.h b/Common/onelab.h
index 98d24da460..7c25c56178 100644
--- a/Common/onelab.h
+++ b/Common/onelab.h
@@ -383,7 +383,7 @@ namespace onelab{
   // The string class. A string has a mutable "kind": we do not derive
   // specialized classes, because the kind should be changeable at runtime
   // (e.g. from a client-dependent mathematical expression to a table of
-  // values). Kinds currently recognized by Gmsh are: "file", "macro". Possible
+  // values). Kinds currently recognized by Gmsh are: "file". Possible
   // kinds could be "complex", "matrix m n", "hostname", client-dependent
   // mathematical expression, onelab mathematical expression (through mathex?),
   // ...
diff --git a/Fltk/onelabGroup.cpp b/Fltk/onelabGroup.cpp
index 638f5b0f2b..bff60f9f4b 100644
--- a/Fltk/onelabGroup.cpp
+++ b/Fltk/onelabGroup.cpp
@@ -1034,7 +1034,7 @@ Fl_Widget *onelabGroup::_addParameterWidget(onelab::string &p, Fl_Tree_Item *n,
                                             bool highlight, Fl_Color c)
 {
   // macro button
-  if(p.getKind() == "macro"){
+  if(p.getAttribute("Macro") == "Gmsh"){
     Fl_Button *but = new Fl_Button(1, 1, (3 * _itemWidth) / 2, 1);
     but->align(FL_ALIGN_INSIDE | FL_ALIGN_CLIP);
     but->callback(onelab_string_button_cb, (void*)n);
-- 
GitLab