}
}
+ void GBoxModel::addColons(std::string &text)
+ {
+ std::string character("&&2P&&");
+ size_t pos;
+ pos = text.find(character);
+ while(pos != std::string::npos)
+ {
+ //We replace the character "&&2P&&" with ":" for all the string
+ text.replace(pos, character.length(),":");
+ pos = text.find(character, pos);
+ }
+ }
+
+ void GBoxModel::removeColons(std::string &text)
+ {
+ std::string character(":");
+ size_t pos;
+ pos = text.find(character);
+ while(pos != std::string::npos)
+ {
+ //We replace the character ":" with "&&2P&&" for all the string
+ text.replace(pos, character.length(),"&&2P&&");
+ pos = text.find(character, pos);
+ }
+ }
+
//=========================================================================
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())
//=========================================================================
+ //=========================================================================
+
+ 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