]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx
no message
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsWxGUIEditorGraphic / wxBlackBoxEditionDialog.cxx
index 850b9edde5dbbe91a3618dd3a07baaa409b257e0..646ee5b6d4c933c7835eefcc77b7688fad41a342 100644 (file)
@@ -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())
@@ -228,6 +231,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