if(port->getValue()!="")
{
- txtValue->SetValue(crea::std2wx(port->getValue()));
+ std::string text = port->getValue();
+ if(text.length()>0)
+ addDoubleQuotes(text);
+ txtValue->SetValue(crea::std2wx(text));
}
if(port->isConnected())
//TOFIX Search a better alternative
if(text!="--No editable--" && text!="--Port Connected--")
{
+ //JPRG: When executing, add double quotes if necessary
+ if(text.length()>0)
+ {
+ addDoubleQuotes(text);
+ }
_model->setValueToInputPort(i,text);
}
}
}
if( closeok==1 ){
- _parent->SaveTempActualDiagram();
+ _parent->SaveTempActualDiagram("edit values");
Close(true);
}
}
//=========================================================================
+ //=========================================================================
+
+ void wxBlackBoxEditionDialog::addDoubleQuotes(std::string &text)
+ {
+
+ //We add the double quotes at the beginning
+ if(text[0] != '"' )
+ text = "\"" + text;
+
+ //We add the double quotes at the end
+ if(text[text.length()-1] != '"')
+ text+= "\"";
+
+ }
+
+
+ //=========================================================================
+ void wxBlackBoxEditionDialog::removeDoubleQuotes(std::string &text)
+ {
+ if(text[0]== '"' )
+ text.replace(0, 1,"");
+ if(text[text.length()-1] == '"')
+ text.replace(text.length()-1, 1,"");
+
+ }
+
+
+
} // EO namespace bbtk
// EOF