]> Creatis software - bbtk.git/commitdiff
Final (?) fix of "include *" pb
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Fri, 14 Mar 2008 14:58:53 +0000 (14:58 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Fri, 14 Mar 2008 14:58:53 +0000 (14:58 +0000)
kernel/src/bbtkInterpreter.cxx
kernel/src/bbtkInterpreter.h
kernel/src/bbtkWxConsole.cxx

index d791462c9464d2a338f819fd01317aada1a88b8b..22bd9fb69d3a20d0805876730979521c247c1065 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.cxx,v $ $
   Language:  C++
-  Date:      $Date: 2008/03/11 12:27:21 $
-  Version:   $Revision: 1.43 $
+  Date:      $Date: 2008/03/14 14:58:53 $
+  Version:   $Revision: 1.44 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -50,6 +50,7 @@ namespace bbtk
 #endif
     mCommandLine(false)
   {
+bufferNb =0;  
     bbtk::MessageManager::RegisterMessageType("Echo","Level>0 : Prints the 'echo' commands of the user.\n\tLevel>1 : Prints the command being interpreted",1);
     bbtk::MessageManager::RegisterMessageType("Interpreter","Messages of the interpreter",0);
     bbtkDebugMessageInc("Interpreter",9,"Interpreter::Interpreter()" <<std::endl);
@@ -306,32 +307,42 @@ std::cout << "=========================================~Interpreter()" << std::e
   void Interpreter::InterpretFile( const std::string& filename )
   {
     bbtkDebugMessageInc("Interpreter",9,"Interpreter::InterpretFile(\""<<filename<<"\")"<<std::endl);
-
+  //  std::cout << "==========================================Entree InterpretFile ["<<filename<<"] try SwitchToFile "<<std::endl;
     bool exm = mCommandLine;
     mCommandLine = false;
 
     try 
     {
       SwitchToFile(filename);
-      /*
-      printf("EED Interpreter::InterpretFile 0001\n" );
-int ii,ssize = mFileName.size();
-for (ii=0;ii<ssize;ii++)
-{
-       printf("EED RRR Interpreter::InterpretFile %s\n", mFileName[ii].c_str() );
-}
-      */
+
+/*
+      for( std::vector<std::string>::iterator it =mFileName.begin(); it!=mFileName.end(); ++it)
+      {
+         std::cout << "A=== [" << (*it) << "]" << std::endl;
+      }
+*/      
       bool insideComment = false; // for multiline comment
       while (mFile.size()>0) 
       {
-       //printf("EED --- %s --- Interpreter::InterpretFile \n", mFileName[0].c_str() );
-         while ((mFile.size()>0) && 
-                (!mFile.back()->eof()))
+/*
+         for( std::vector<std::string>::iterator it =mFileName.begin(); it!=mFileName.end(); ++it)
          {
-            mLine.back()++;
+            std::cout << "B=== [" << (*it) << "]" << std::endl;
+         }
+*/      
+//printf("EED --- %s --- Interpreter::InterpretFile \n", mFileName[0].c_str() );
+       //printf("EED --- %s --- Interpreter::InterpretFile \n", mFileName[0].c_str() );
+
+         //while ((mFile.size()>0) && !mFile.back()->eof() ) 
+         //{
+//      std::cout << "mFile.size() "<< mFile.size() << " mFileName.back() [" << mFileName.back() << "]" <<  std::endl;
+        
+        while (!mFile.back()->eof()) {
+                    mLine.back()++;
             char buf[500];
             mFile.back()->getline(buf,500);
             std::string str(buf);
+// std::cout << " in InterpretFile mFile.back()->getline [" << str << "]" << std::endl;    
             int size=str.length();
             if ( str[ size-1 ]==13  )
             {
@@ -339,7 +350,9 @@ for (ii=0;ii<ssize;ii++)
             }
       
             InterpretLine(str, insideComment);
-           //printf("EED Interpreter::InterpretFile %s\n", str.c_str() );
+
+//printf("EED Interpreter::InterpretFile %s\n", str.c_str() );
+
          }
         //if (mFile.size()>0) 
         CloseCurrentFile();
@@ -670,10 +683,10 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
     pos = s.find(ss,0);
     char* cr = "\n";
     while ( pos != std::string::npos )
-   {
+    {
       s.replace(pos,2,cr,1);
       pos = s.find(ss, pos-1);
-   }
+    }
   }
   //=======================================================================
 
@@ -782,39 +795,56 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
     // It's a user intended message.
     // Please don't remove it.
     bbtkMessage("Interpreter",1,
-               "look for : [" << name
-                 << "]" << std::endl);
+        "look for : [" << name
+        << "]" << std::endl);
     script_paths = ConfigurationFile::GetInstance().Get_bbs_paths();
 
     std::string upath;
     pkgname = Utilities::ExtractScriptName(name,upath);
 
+    bbtkMessage("Interpreter",1,
+               "extract : pkgname [" << pkgname
+                << "] upath [" << upath << "]" << std::endl);
     bool fullnameGiven = false; 
     bool foundFile     = false;
 
     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;
+      //if (upath.size()!=0) // avoid troubles for "*"
+      
       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)
         {
-           if ((*i).substr((*i).size()-4, 4) != ".bbs")
-              continue;      // ignore non .bbs files
-          std::string command("include ");
-          command += *i;
-          //  LoadScript(*i,name);
-          bool tmp;
-          InterpretLine(command,tmp);
+// 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";
            nbBssFiles++;
         }
         if (nbBssFiles==0)
            bbtkMessage("Interpreter",2,
                       "WARNING : No '.bbs' file found in [" 
                       << upath << "]" << std::endl);
+        else
+           SwitchToStream(stream);
         return;
       }
 
@@ -845,32 +875,41 @@ 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",1,"   [" <<fullDirectoryName 
+             bbtkMessage("Interpreter",1,"   [" <<fullDirectoryName 
                      <<"] : doesn't exist" <<std::endl);
           continue;  // try next path
         }
         foundFile = true;
 
-               Filenames.clear();
+        Filenames.clear();
         int nbFiles = Utilities::Explore(fullDirectoryName, false, Filenames);
 
         nbBssFiles = 0;
         for (std::vector<std::string>::iterator i = Filenames.begin(); i!= Filenames.end(); ++i)
         {
 //EEDprintf("EED Interpreter::SwitchToFile %s\n",(*i).c_str() );
-           if ((*i).substr((*i).size()-4, 4) != ".bbs")
-              continue;      // ignore non .bbs files
-          std::string command("include ");
-          command += *i;
-          bool tmp;
-          InterpretLine(command,tmp);
-          //           LoadScript(*i,name);
+// 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";
            nbBssFiles++;
         }
         if (nbBssFiles==0)
-         bbtkMessage("Interpreter",1,
+           bbtkMessage("Interpreter",1,
                      "WARNING : No '.bbs' file found in [" 
                      << fullDirectoryName << "]" << std::endl);
+        else 
+           SwitchToStream(stream);
 
         //break; // a directory was found; we stop iterating
        // LG : No! We want all files included !
@@ -897,7 +936,7 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
       int l = fullPathScriptName.size();
 
       if (l!=0) {
-      
+
       if (l>4)
       {
          if (fullPathScriptName.substr(l-4, 4) != ".bbs")
@@ -910,21 +949,19 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
          fullPathScriptName = fullPathScriptName + ".bbs";   
       }
 
-        if ( Utilities::FileExists(fullPathScriptName))
-        {
-          foundFile = true;
-        }
-      } // endif l != 0
-    }
-    else 
-
-      // =============================================================== iterate on the paths
+      if ( Utilities::FileExists(fullPathScriptName))
       {
+        foundFile = true;
+      }
+    } // endif l != 0
+  }
+  else
+      // =============================================================== iterate on the paths
+  {
       std::string path;
       std::vector<std::string>::iterator i;
       for (i=script_paths.begin();i!=script_paths.end();++i)
       {
-
         path = *i;
        // we *really* want '.' to be the current working directory
         if (path == ".") {
@@ -934,10 +971,7 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
           path = currentDir;
         }
 
-       // fullPathScriptName = Utilities::MakePkgnameFromPath(path, name, true); //pkgname);
-
-           fullPathScriptName = Utilities::MakePkgnameFromPath(path, name, true);
-
+       fullPathScriptName = Utilities::MakePkgnameFromPath(path, name, true);
 
       // Check if library exists
         if ( ! Utilities::FileExists(fullPathScriptName) )
@@ -945,12 +979,12 @@ 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,
+             bbtkMessage("Interpreter",2,
                      "   [" <<fullPathScriptName <<"] : doesn't exist" 
                      <<std::endl);
           continue;  // try next path
         }
-       bbtkMessage("Interpreter",2,
+           bbtkMessage("Interpreter",2,
                    "   [" <<fullPathScriptName 
                    <<"] : found" <<std::endl);
         foundFile = true;
@@ -977,39 +1011,78 @@ 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;
+    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;
+
+    if (mFileName.size()>0 )// && (mFile.size()>0) )  // NO!!!
+    {
+   // 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);
+}
+
   //=======================================================================
 
   void Interpreter::LoadScript( std::string fullPathScriptName,
                                std::string includeScriptName)
   {
-//EED printf("EED Interpreter::LoadScript >>01\n");
-       Utilities::replace( fullPathScriptName , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
+//std::cout << "--------------------------EED Interpreter::LoadScript >>01\n" << std::endl;
+     Utilities::replace( fullPathScriptName , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
 
-       bool okScriptExist=false;
-       int iStrScript,sizeVecStricpt=mFileName.size();
-       for ( iStrScript=0;iStrScript<sizeVecStricpt;iStrScript++)
-       {
+     bool okScriptExist=false;
+     int iStrScript,sizeVecStricpt=mFileName.size();
+     for ( iStrScript=0;iStrScript<sizeVecStricpt;iStrScript++)
+     {
 //EED printf("  EED %d Interpreter::LoadScript %s __>>__ %s\n", iStrScript,mFileName[iStrScript].c_str(),fullPathScriptName.c_str() );
-               if (mFileName[iStrScript] == fullPathScriptName )
-               {
-                 //                    printf("  EED %d Interpreter::LoadScript iguales\n",iStrScript ); 
-                       okScriptExist=true;
-               } // if
-       } // for
-
-    if (find(mFileName.begin(),mFileName.end(),fullPathScriptName)!=mFileName.end()) 
-//    if (okScriptExist==true) 
-      {
+
+        if (mFileName[iStrScript] == fullPathScriptName )
+        {
+           printf("  EED %d Interpreter::LoadScript iguales\n",iStrScript );
+           okScriptExist=true;
+        } // if
+     } // for
+
+     if (find(mFileName.begin(),mFileName.end(),fullPathScriptName)!=mFileName.end())
+//    if (okScriptExist==true)
+     {
 //EED printf("EED Interpreter::LoadScript Exit method\n");
-       bbtkMessage("Interpreter",1,"file '"<<fullPathScriptName
+           bbtkMessage("Interpreter",1,"file '"<<fullPathScriptName
                    <<"' already open : I do not open it once more to prevent recursive inclusion"<<std::endl);
-       return;
-      }
+        return;
+     }
 
     std::ifstream* s;
     s = new std::ifstream;
     s->open(fullPathScriptName.c_str());
-    if (!s->good()) 
+    if (!s->good())
     {
         bbtkError("Could not open file ["<<fullPathScriptName<<"]");
         return;
@@ -1042,18 +1115,21 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
     }
 
     bbtkDebugMessage("Interpreter",9," Closing file '"<<mFileName.back()<<"'"<<std::endl);
-    mFile.back()->close();
+
+    std::ifstream* file = dynamic_cast<std::ifstream*>(mFile.back());
+    if (file!=0) file->close();
+
     delete mFile.back();
     mFile.pop_back();
     mFileName.pop_back();
     mIncludeFileName.pop_back();
-       mLine.pop_back();
+    mLine.pop_back();
 /*EED3
-       bbtkDebugMessage("Interpreter",9," Closing file '"<<mFileName[0]<<"'"<<std::endl);
-       mFile[0]->close();
+    bbtkDebugMessage("Interpreter",9," Closing file '"<<mFileName[0]<<"'"<<std::endl);
+    mFile[0]->close();
     delete mFile[0];
     mFile.erase( mFile.begin() );
-       mFileName.erase( mFileName.begin() );
+    mFileName.erase( mFileName.begin() );
     mIncludeFileName.erase( mIncludeFileName.begin() );
     mLine.erase( mLine.begin() );
 */
@@ -1077,6 +1153,8 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
 
     while (mFile.size() != 0) 
     {
+       CloseCurrentFile();
+    /*
       mFile.back()->close();
       delete mFile.back();
       mFile.pop_back();
@@ -1085,6 +1163,7 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
       mFileName.pop_back();
       mIncludeFileName.pop_back();
       mLine.pop_back();
+*/
     }
     bbtkDebugMessage("Interpreter",9,"EO Interpreter::CloseAllFiles()"
                       <<std::endl);
index eb8e09c07b118d567b3dd2804c05276aa2d820bd..a5e66f424f3ec0e18ce7c3a903ed2f1414c489cc 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.h,v $ $
   Language:  C++
-  Date:      $Date: 2008/03/07 08:40:14 $
-  Version:   $Revision: 1.13 $
+  Date:      $Date: 2008/03/14 14:58:53 $
+  Version:   $Revision: 1.14 $
 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -135,6 +135,9 @@ namespace bbtk
     /// Switch to the interpretation of a file
     void SwitchToFile( const std::string& filename );
 
+   /// Switch to the interpretation of a stringstream
+    void SwitchToStream( std::stringstream* stream );
+
     /// Closes the currently open file
     void CloseCurrentFile();
 
@@ -202,8 +205,8 @@ namespace bbtk
     bbtk::WxConsole* mWxConsole;
 #endif
 
-    /// Vector of open files 
-    std::vector<std::ifstream*> mFile;
+    /// Vector of open files / buffers (can be stringstream)
+    std::vector<std::istream*> mFile;
 
     /// Vector of names of open files with full path (as open)
     std::vector<std::string> mFileName;
@@ -223,13 +226,11 @@ namespace bbtk
     /// The history of commands
     std::deque< char* > mHistory;
 
+   int bufferNb;
   };
   // EO class Interpreter
 
 
-
-
-
   // The "Quit" exception
   struct QuitException : public bbtk::Exception
   {
index 45e1581405f1324339abcdf31cd35462f6aa314f..a218586269b5ac855af6bd207b1f613982312dca 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxConsole.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/03/11 12:27:21 $
-  Version:   $Revision: 1.12 $
+  Date:      $Date: 2008/03/14 14:58:53 $
+  Version:   $Revision: 1.13 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -40,7 +40,6 @@
 namespace bbtk
 {
 
-
 // On Windows when compiling a dll, wx prevents the compilation
 // of the class wxStreamToTextRedirector (why ? it is a nightmare...)
 // The blocking symbol is wxHAS_TEXT_WINDOW_STREAM.
@@ -197,10 +196,10 @@ namespace bbtk
 //EED    wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
 //    mwxNotebook = new wxNotebook(this,-1,wxDefaultPosition, wxDefaultSize, 0);
     mwxNotebook = new wxAuiNotebook(this,  
-                                                               -1, 
-                                                               wxPoint(0, 0), 
-                                                               wxSize(500,500),
-                                                               wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER);
+                                    -1,
+                                    wxPoint(0, 0),
+                                    wxSize(500,500),
+                                    wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER);
     
     mwxPageCommand = new wxPanel(mwxNotebook,-1);    
     mwxNotebook->AddPage( mwxPageCommand, _T("Command"));
@@ -242,17 +241,17 @@ namespace bbtk
 
     mwxTextHistory = 
       new wxTextCtrl(mwxPageCommand,
-                    ID_Text_History,
-                    _T(""),wxDefaultPosition,
-                    wxDefaultSize, //HistorySize,
-                    wxTE_READONLY |
-                    wxTE_MULTILINE );
+                     ID_Text_History,
+                     _T(""),wxDefaultPosition,
+                     wxDefaultSize, //HistorySize,
+                     wxTE_READONLY |
+                     wxTE_MULTILINE );
  
     wxFont* FixedFont = new wxFont(10,
-                                  wxFONTFAMILY_MODERN,
-                                  wxFONTSTYLE_NORMAL,
-                                  wxFONTWEIGHT_NORMAL,
-                                  false);
+                                   wxFONTFAMILY_MODERN,
+                                   wxFONTSTYLE_NORMAL,
+                                   wxFONTWEIGHT_NORMAL,
+                                   false);
 
    mwxTextHistoryAttr = new wxTextAttr;
    mwxTextHistoryAttr->SetFont(*FixedFont);
@@ -336,7 +335,7 @@ namespace bbtk
     //                        wxDefaultPosition,
     //                        wxSize(0,0),
     //                        wxFRAME_TOOL_WINDOW) ;//wxMINIMIZE_BOX);
-    
+
     Wx::SetTopWindow(top);
 
     //    top->Show();
@@ -398,26 +397,27 @@ namespace bbtk
     try 
     {
       bool insideComment = false;
-      //printf("WxConsole::CommandString 04 \n");
-          mInterpreter->InterpretLine( wx2std(line), insideComment );
-          //printf("WxConsole::CommandString 05 \n");
+
+printf("WxConsole::CommandString 04 \n");
+      mInterpreter->InterpretLine( wx2std(line), insideComment );
+printf("WxConsole::CommandString 05 \n");
     }
     catch (bbtk::QuitException)
     {
-          Close(true); 
+       Close(true); 
     }
     catch (bbtk::Exception e) 
     {
-          e.Print();
+       e.Print();
     }
     catch (std::exception& e) 
     {
-          std::cout << "* ERROR : "<<e.what()<<" (not in bbtk)"<<std::endl;
+       std::cout << "* ERROR : "<<e.what()<<" (not in bbtk)"<<std::endl;
     }
     catch (...)
     {
-          std::cout << "* UNDEFINED ERROR (not a bbtk nor a std exception)"
-                         << std::endl;
+       std::cout << "* UNDEFINED ERROR (not a bbtk nor a std exception)"
+                 << std::endl;
     }
     //printf("WxConsole::CommandString 06 \n");
   }
@@ -437,8 +437,8 @@ namespace bbtk
   {
     
     wxMessageBox(_T("  bbi\nThe Black Box Toolkit interpreter\n(c) CREATIS-LRMN 2007"),
-                _T("About ..."), wxOK | wxICON_INFORMATION, 
-                this);
+                 _T("About ..."), wxOK | wxICON_INFORMATION,
+                 this);
   }
   //================================================================
 
@@ -459,8 +459,8 @@ namespace bbtk
   {
     
     wxMessageBox(_T("  Creating blackbox"),
-                _T("Creating blackbox ..."), wxOK | wxICON_INFORMATION, 
-                this);
+                 _T("Creating blackbox ..."), wxOK | wxICON_INFORMATION,
+                 this);
   }
   //================================================================
   
@@ -529,7 +529,7 @@ namespace bbtk
       }
     else 
       {
-       //      std::cout << "ERROR html"<<std::endl;
+         // std::cout << "ERROR html"<<std::endl;
       }
   } 
 
@@ -538,23 +538,15 @@ namespace bbtk
   //================================================================  
   wxPanel* WxConsole::CreateBtnsCtrlPanel(wxWindow *parent)
   {
-         wxPanel *btnsCtrlPanel        = new wxPanel(parent,-1);
-         wxBoxSizer *btnsSizer         = new wxBoxSizer(wxHORIZONTAL);
-         
-         wxButton *btnInclude  = new wxButton( btnsCtrlPanel,-1,_T("Include")  );
-         wxButton *btnReset    = new wxButton( btnsCtrlPanel,-1,_T("Reset")            );
-         wxButton *btnConfig   = new wxButton( btnsCtrlPanel,-1,_T("Config")           );
-         wxButton *btnGraphS   = new wxButton( btnsCtrlPanel,-1,_T("Graph S.") );
-         wxButton *btnGraphD   = new wxButton( btnsCtrlPanel,-1,_T("Graph D.") );
-         wxButton *btnHelp     = new wxButton( btnsCtrlPanel,-1,_T("Help")             );
+     wxPanel *btnsCtrlPanel = new wxPanel(parent,-1);
+     wxBoxSizer *btnsSizer     = new wxBoxSizer(wxHORIZONTAL);
          
-         btnsSizer->Add( btnInclude    );
-         btnsSizer->Add( btnReset              );
-         btnsSizer->Add( btnConfig             );
-         btnsSizer->Add( btnGraphS     );
-         btnsSizer->Add( btnGraphD     );
-         btnsSizer->Add( btnHelp               );
-         btnsCtrlPanel->SetSizer(btnsSizer);
+     wxButton *btnInclude  = new wxButton( btnsCtrlPanel,-1,_T("Include")  );
+     wxButton *btnReset    = new wxButton( btnsCtrlPanel,-1,_T("Reset")    );
+     wxButton *btnConfig   = new wxButton( btnsCtrlPanel,-1,_T("Config")   );
+     wxButton *btnGraphS   = new wxButton( btnsCtrlPanel,-1,_T("Graph S.") );
+     wxButton *btnGraphD   = new wxButton( btnsCtrlPanel,-1,_T("Graph D.") );
+     wxButton *btnHelp     = new wxButton( btnsCtrlPanel,-1,_T("Help")     );
 
          Connect(btnInclude->GetId()   , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxConsole::OnBtnInclude       );
          Connect(btnReset->GetId()             , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxConsole::OnBtnReset         );
@@ -570,20 +562,20 @@ namespace bbtk
   //================================================================  
   void WxConsole::OnBtnInclude(wxCommandEvent& event)
   {
-           std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
-           std::string stdDir = default_doc_dir+"/share/bbtk/bbs";
-           wxString defaultDir(stdDir.c_str(), wxConvUTF8);
-           
-               wxFileDialog dialog(this, _T("Choose a file"),defaultDir, _T(""), _T("*.bbs"), wxOPEN );
-               if (dialog.ShowModal() == wxID_OK)
-               {
-//                     std::string command(_T("include "));
-//                     std::string pathfilename                = (const char *)(dialog.GetFilename().mb_str());
-                       wxString command(_T("include "));
-                       wxString pathfilename = dialog.GetPath();
-                       command += pathfilename;
-                       CommandString( command );
-               }
+     std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
+     std::string stdDir = default_doc_dir+"/share/bbtk/bbs";
+     wxString defaultDir(stdDir.c_str(), wxConvUTF8);
+
+     wxFileDialog dialog(this, _T("Choose a file"),defaultDir, _T(""), _T("*.bbs"), wxOPEN );
+     if (dialog.ShowModal() == wxID_OK)
+     {
+        // std::string command(_T("include "));
+        // std::string pathfilename = (const char *)(dialog.GetFilename().mb_str());
+        wxString command(_T("include "));
+        wxString pathfilename = dialog.GetPath();
+        command += pathfilename;
+        CommandString( command );
+     }
 
   }
   //================================================================  
@@ -593,7 +585,7 @@ namespace bbtk
   void WxConsole::OnBtnReset(wxCommandEvent& event)
   {
 printf("WxConsole::OnBtnReset 01 \n");
-         CommandString(_T("reset"));
+     CommandString(_T("reset"));
 printf("WxConsole::OnBtnReset 02 \n");
   }
   //================================================================  
@@ -602,7 +594,7 @@ printf("WxConsole::OnBtnReset 02 \n");
   //================================================================  
   void WxConsole::OnBtnConfig(wxCommandEvent& event)
   {
-         CommandString(_T("config"));
+     CommandString(_T("config"));
   }
   //================================================================  
 
@@ -611,21 +603,21 @@ printf("WxConsole::OnBtnReset 02 \n");
   //================================================================  
   void WxConsole::OnBtnGraphS(wxCommandEvent& event)
   {
-         CommandString(_T("graph"));
+     CommandString(_T("graph"));
   }
   //================================================================  
 
   //================================================================  
   void WxConsole::OnBtnGraphD(wxCommandEvent& event)
   {
-         CommandString(_T("graph . 1"));
+     CommandString(_T("graph . 1"));
   }
   //================================================================  
 
   //================================================================  
   void WxConsole::OnBtnHelp(wxCommandEvent& event)
   {
-         CommandString(_T("help"));
+     CommandString(_T("help"));
   }
   //================================================================