From f0d396e8c3585edca83571ed0eeacef1b72828f1 Mon Sep 17 00:00:00 2001 From: jean-pierre roux Date: Thu, 20 Mar 2008 11:04:57 +0000 Subject: [PATCH] std2wx related troubles. --- kernel/src/bbtkInterpreter.cxx | 67 ++++++--------------------------- kernel/src/bbtkWxEditor.cxx | 6 +-- kernel/src/bbtkWxGUICommand.cxx | 6 +-- kernel/src/bbtkWxGUIConsole.cxx | 11 ++++-- 4 files changed, 24 insertions(+), 66 deletions(-) diff --git a/kernel/src/bbtkInterpreter.cxx b/kernel/src/bbtkInterpreter.cxx index 690ddb8..39eb9ce 100644 --- a/kernel/src/bbtkInterpreter.cxx +++ b/kernel/src/bbtkInterpreter.cxx @@ -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& 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& 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::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& nbBssFiles = 0; for (std::vector::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& 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& // The following is *NOT* a debug time message : // It's a user intended message. // Please don't remove it. - bbtkMessage("Interpreter",2, - " [" <& 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::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::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); diff --git a/kernel/src/bbtkWxEditor.cxx b/kernel/src/bbtkWxEditor.cxx index a494269..138155a 100644 --- a/kernel/src/bbtkWxEditor.cxx +++ b/kernel/src/bbtkWxEditor.cxx @@ -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(); } diff --git a/kernel/src/bbtkWxGUICommand.cxx b/kernel/src/bbtkWxGUICommand.cxx index 929d07b..37c2af1 100644 --- a/kernel/src/bbtkWxGUICommand.cxx +++ b/kernel/src/bbtkWxGUICommand.cxx @@ -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); } diff --git a/kernel/src/bbtkWxGUIConsole.cxx b/kernel/src/bbtkWxGUIConsole.cxx index e60afd3..164e244 100644 --- a/kernel/src/bbtkWxGUIConsole.cxx +++ b/kernel/src/bbtkWxGUIConsole.cxx @@ -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 -- 2.45.1