X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsWxGUIEditorGraphic%2FwxBlackBoxEditionDialog.cxx;h=8ee617b4c8e51891aee2c8add70c2406c25395fa;hb=713c6f1f54a2114c6e495aa6974d33b5718b46b5;hp=850b9edde5dbbe91a3618dd3a07baaa409b257e0;hpb=9877bb1bc1cbfc8b4ac0dbd45d443ba670c9d8d2;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx index 850b9ed..8ee617b 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx @@ -114,7 +114,10 @@ namespace bbtk 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()) @@ -189,6 +192,11 @@ namespace bbtk //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); } } @@ -228,6 +236,34 @@ printf("EED wxBlackBoxEditionDialog::onClickClose\n"); //========================================================================= + //========================================================================= + + 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