]> Creatis software - bbtkGEditor.git/commitdiff
no message
authordavila <>
Wed, 30 May 2012 17:18:01 +0000 (17:18 +0000)
committerdavila <>
Wed, 30 May 2012 17:18:01 +0000 (17:18 +0000)
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBoxModel.cxx
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBoxModel.h
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.h

index 1c03431f0efd776eadf5e63ee36590aef1877d07..c7b2c0caa47cf23b1483173f07f1a6680c9ee728 100644 (file)
@@ -199,6 +199,32 @@ namespace bbtk
                }
        }
 
+       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);
+                       }
+       }
+
        //=========================================================================
 
 
index 8c05ad7ed48f358007c49895b6e042ea68a3edaa..5b6d898362a158a032f38a1d5693e60c857bd5e3 100644 (file)
@@ -96,6 +96,10 @@ namespace bbtk
                // Updates the position and finally the view of inputs and outputs
                void updatePorts();
 
+
+               void addColons(std::string &text);
+               void removeColons(std::string &text);
+
        private:
 
                //Private Attributes
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
index 9abd697a40d8de3ecbd7b7b56379993f44bbdea0..c6a6b11327b8747dde47d6e0eab506138762d09f 100644 (file)
@@ -90,6 +90,10 @@ namespace bbtk
                wxTextCtrl* _boxName;
 
                GBlackBoxModel *_model;
+               
+               
+               void addDoubleQuotes(std::string &text);
+               void removeDoubleQuotes(std::string &text);
        
        protected: