]> Creatis software - bbtk.git/commitdiff
std2wx related troubles.
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Thu, 20 Mar 2008 11:04:57 +0000 (11:04 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Thu, 20 Mar 2008 11:04:57 +0000 (11:04 +0000)
kernel/src/bbtkInterpreter.cxx
kernel/src/bbtkWxEditor.cxx
kernel/src/bbtkWxGUICommand.cxx
kernel/src/bbtkWxGUIConsole.cxx

index 690ddb857146f1595533294900d60d224877f5dc..39eb9ce948a2b55632a69945b8677661df6f5c22 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.cxx,v $ $
   Language:  C++
-  Date:      $Date: 2008/03/20 09:51:28 $
-  Version:   $Revision: 1.48 $
+  Date:      $Date: 2008/03/20 11:04:57 $
+  Version:   $Revision: 1.49 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -311,6 +311,7 @@ bufferNb =0;
     try 
     {
       SwitchToFile(filename);
+
       bool insideComment = false; // for multiline comment
       while (mFile.size()>0) 
       {
@@ -914,7 +915,6 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
 
     if(pkgname == "*") // =========================================== load all boxes (e.g. std/boxes/*)
     {
-// std::cout << "JPR==================  * found, load all boxes " << std::endl;
       int nbBssFiles;
 
       std::stringstream* stream = new std::stringstream;
@@ -922,27 +922,17 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
       
       if (upath[0]=='/' || upath[1] == ':' ) // ==== absolute name, load all .bbs files
       {
-// std::cout << "JPR==================  absolute name, load all .bbs files " << std::endl;      
         int nbFiles = Utilities::Explore(upath, false, Filenames);
         nbBssFiles = 0;
         for (std::vector<std::string>::iterator i = Filenames.begin(); i!= Filenames.end(); ++i)
         {
-// std::cout << "JPR==================  iterate [" << *i << "]" << std::endl;
            int lgr = (*i).size();
           if (lgr < 5)
              continue;  // ignore non .bbs file
            if ((*i).substr(lgr-4, 4) != ".bbs")
              continue;
-          /*
-          if (lgr > 10) // 10 -> '-appli.bbs'
-          {    
-           if ((*i).substr(lgr-10, 10) == "-appli.bbs")
-              continue;      // ignore  '-appli.bbs' files
-          }
-          */
 
-       (*stream) << "include " << *i << "\n";
-//EED  InterpretFile(*i);
+          (*stream) << "include " << *i << "\n";
 
            nbBssFiles++;
         } // for vector
@@ -994,23 +984,13 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
         nbBssFiles = 0;
         for (std::vector<std::string>::iterator i = Filenames.begin(); i!= Filenames.end(); ++i)
         {
-// std::cout << "JPR==================  iterate [" << *i << "]" << std::endl;
            int lgr = (*i).size();
           if (lgr < 5)
              continue;  // ignore non .bbs file
            if ((*i).substr(lgr-4, 4) != ".bbs")
              continue;
-           /*
-          if (lgr > 10) // 10 -> '-appli.bbs'
-          {    
-           if ((*i).substr(lgr-10, 10) == "-appli.bbs")
-              continue;      // ignore  '-appli.bbs' files
-          }
-          */
-
-      (*stream) << "include " << *i << "\n";
-//EED    InterpretFile(*i);
 
+           (*stream) << "include " << *i << "\n";
            nbBssFiles++;
         } // for vector
                if (nbBssFiles==0){
@@ -1027,8 +1007,6 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
        return;
     }  // if *
 
-    //std::string::size_type slash_position = name.find_last_of("/\\");
-
     // if name starts with a / or a . or contains : user is assumed to have passed a relative/absolute name
     // (not only a plain script name)
     // we trust him, and try to expland the directory name
@@ -1089,9 +1067,9 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
         // The following is *NOT* a debug time message :
         // It's a user intended message.
         // Please don't remove it.
-             bbtkMessage("Interpreter",2,
-                     "   [" <<fullPathScriptName <<"] : doesn't exist" 
-                     <<std::endl);
+           bbtkMessage("Interpreter",2,
+                       "   [" <<fullPathScriptName <<"] : doesn't exist" 
+                       <<std::endl);
           continue;  // try next path
         }
            bbtkMessage("Interpreter",2,
@@ -1123,38 +1101,15 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
 
 void Interpreter::SwitchToStream( std::stringstream* stream )
 {
-//std::cout << "== 1 Entry in Interpreter::SwitchToStream " << std::endl;
-
-       mFile.push_back(stream);
-    //std::cout << " mFile.size() " << mFile.size() << std::endl;
+    mFile.push_back(stream);
     std::ostringstream buffer_name;
     bufferNb++;
-    buffer_name << "buffer_" ; // << bufferNb;
-    
-//    std::cout << " mFile.size() "     << mFile.size() << std::endl;
-//    std::cout << " mFileName.size() " << mFileName.size() << std::endl;
-//    std::cout << " mLine.size() "     << mLine.size() << std::endl;
-   // std::vector<std::string>::iterator j = mFileName.begin();
-   //    std::cout << "  mFileName.begin() succeeded"  << std::endl;
-   //    std::cout << "  mFileName[0] " <<   mFileName[0] << std::endl;
-       //std::cout << "  mFileName.begin() " <<   mFileName.begin() << std::endl;
-/*
-    for( std::vector<std::string>::iterator i = mFileName.begin(); i!= mFileName.end(); ++i)
-    {
-
-       std::cout <<   "Interpreter::SwitchToStream : mFileName [" <<  *i << "]" << std::endl;
-    }
-*/
-  //  std::cout << " mLine.back() " << mLine.back() << std::endl;
-   // std::cout << " mFileName.back() " <<  mFileName.back() << std::endl;
+    buffer_name << "buffer_" ;
 
-    if (mFileName.size()>0 )// && (mFile.size()>0) )  // NO!!!
+    if (mFileName.size()>0 )
     {
-   // std::cout << "  mFileName.back() " <<  mFileName.back() << std::endl;
-   // std::cout << "  mLine.back() " <<  mLine.back() << std::endl;
        buffer_name << mFileName.back() << "_" << mLine.back();
     }
-//std::cout << "3 in Interpreter::SwitchToStream buffer_name :[" << buffer_name.str() << "]" << std::endl;
     mFileName.push_back(buffer_name.str());
     mIncludeFileName.push_back(buffer_name.str());
     mLine.push_back(0);
index a494269472a848394259a7d95e410c52f4002ebd..138155a4622c1bc65e1d5882c1ad2a9b9fc3a9fd 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxEditor.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/03/20 09:51:29 $
-  Version:   $Revision: 1.6 $
+  Date:      $Date: 2008/03/20 11:04:57 $
+  Version:   $Revision: 1.7 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -416,7 +416,7 @@ namespace bbtk
      //             pos+1,
      //             (long)mwxInputText->GetValue().length())+1;
 
-     mwxPosition->SetLabel(wxString(mess));
+     mwxPosition->SetLabel(std2wx(mess));
      mwxPosition->Show();
     
   }
index 929d07bd84853f9a39dc7d8fc629050999bc4e73..37c2af12538797aa659d17b55a29b76d3836729e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUICommand.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/03/20 09:51:29 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2008/03/20 11:04:57 $
+  Version:   $Revision: 1.2 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -127,7 +127,7 @@ namespace bbtk
     if (command.length()==0) return;
 
     mwxTextCommand->SetValue(_T(""));
-    mwxTextCommand->Append(command);
+    mwxTextCommand->Append(std2wx(command));
     if (mUser) mUser->WxGUICommandEnter(command);
   }
 
index e60afd3d9e21791207ff70c5cf2e71bd8e125677..164e244016272a360f93b2c0252cee3f2c5c3e2a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUIConsole.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/03/20 09:51:29 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2008/03/20 11:04:57 $
+  Version:   $Revision: 1.2 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -210,7 +210,8 @@ namespace bbtk
   //================================================================
   void WxGUIConsole::OnButtonRun(wxCommandEvent& WXUNUSED(event))
   {
-    std::string filename = wx2std(mWxGUIHtmlBrowser->GetCurrentPage());
+//    wxString temp = mWxGUIHtmlBrowser->GetCurrentPage();
+    std::string filename = mWxGUIHtmlBrowser->GetCurrentPage();//wx2std(temp);
     size_t s = filename.length();
 
     Interpreter* I = new Interpreter;
@@ -220,7 +221,9 @@ namespace bbtk
        && (filename[s-3]=='b')
        && (filename[s-4]=='.'))
       {
-       SetStatusText(_T("Executing ")+filename);
+        std::string tmp("Executing ");
+        tmp += filename;
+       SetStatusText(std2wx(tmp));
        I->InterpretFile(filename);
       }
     else