From 4c9583068f75a2d91202f96c396c5ef73e04eb4b Mon Sep 17 00:00:00 2001 From: guigues Date: Tue, 11 Mar 2008 12:27:21 +0000 Subject: [PATCH] Fixed crash with Interpreter without WxConsole (case of RUN button of WxBrowser) Removed unwanted debug messages --- kernel/src/bbtkFactory.cxx | 6 ++++-- kernel/src/bbtkInterpreter.cxx | 21 +++++++++------------ kernel/src/bbtkWxBrowser.cxx | 6 +++++- kernel/src/bbtkWxConsole.cxx | 18 +++++++++--------- 4 files changed, 27 insertions(+), 24 deletions(-) diff --git a/kernel/src/bbtkFactory.cxx b/kernel/src/bbtkFactory.cxx index 9a6010b..6b40793 100644 --- a/kernel/src/bbtkFactory.cxx +++ b/kernel/src/bbtkFactory.cxx @@ -4,8 +4,8 @@ Program: bbtk Module: $RCSfile: bbtkFactory.cxx,v $ Language: C++ -Date: $Date: 2008/03/10 06:24:12 $ -Version: $Revision: 1.29 $ +Date: $Date: 2008/03/11 12:27:21 $ +Version: $Revision: 1.30 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de @@ -80,12 +80,14 @@ namespace bbtk //=================================================================== void Factory::Reset() { + /* printf("EED kkkkkkkkkkkkkkkkkkkkkkkk Factory::Reset() \n"); printf("EED kkkkkkkkkkkkkkkkkkkkkkkk Factory::Reset() \n"); printf("EED kkkkkkkkkkkkkkkkkkkkkkkk Factory::Reset() \n"); printf("EED kkkkkkkkkkkkkkkkkkkkkkkk Factory::Reset() \n"); printf("EED kkkkkkkkkkkkkkkkkkkkkkkk Factory::Reset() \n"); printf("EED kkkkkkkkkkkkkkkkkkkkkkkk Factory::Reset() \n"); + */ bbtkDebugMessageInc("Kernel",7,"Factory::Reset()"<0) { -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())) -//EED3 (!mFile[0]->eof())) { mLine.back()++; char buf[500]; mFile.back()->getline(buf,500); -//EED3 mFile[0]->getline(buf,500); - std::string str(buf); int size=str.length(); if ( str[ size-1 ]==13 ) @@ -342,7 +339,7 @@ printf("EED --- %s --- Interpreter::InterpretFile \n", mFileName[0].c_str() ); } 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(); @@ -995,7 +992,7 @@ void Interpreter::SplitLine ( const std::string& str, std::vector& //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 ); + // printf(" EED %d Interpreter::LoadScript iguales\n",iStrScript ); okScriptExist=true; } // if } // for diff --git a/kernel/src/bbtkWxBrowser.cxx b/kernel/src/bbtkWxBrowser.cxx index 3f158ca..745bcda 100644 --- a/kernel/src/bbtkWxBrowser.cxx +++ b/kernel/src/bbtkWxBrowser.cxx @@ -59,7 +59,8 @@ namespace bbtk //======================================================================== WxBrowser::WxBrowser ( wxWindow *parent, wxSize size ) : - wxPanel ( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL) + wxPanel ( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL), + mWxConsole(0) { wxPanel* panel = this; @@ -251,8 +252,11 @@ namespace bbtk && (filename[s-3]=='b') && (filename[s-4]=='.')) { + std::cout << "stat"<SetStatusText(_T("Executing ")+mwxURL->GetValue()); + std::cout << "int"<InterpretFile(filename); + std::cout << "eoint"< ") + line + _T("\n"); mwxTextHistoryAttr->SetTextColour(*wxRED); mwxTextHistory->SetDefaultStyle(*mwxTextHistoryAttr); mwxTextHistory->AppendText(s); // send to standard console also -printf("WxConsole::CommandString 02 \n"); - printf("%s",wx2std(s).c_str()); + //printf("WxConsole::CommandString 02 \n"); + // printf("%s",wx2std(s).c_str()); //EED mwxTextCommand->Clear(); mwxTextCommand->SetValue(_T("")); mwxTextCommand->Append(line); @@ -394,13 +394,13 @@ printf("WxConsole::CommandString 02 \n"); mwxTextHistoryAttr->SetTextColour(*wxBLACK); mwxTextHistory->SetDefaultStyle(*mwxTextHistoryAttr); -printf("WxConsole::CommandString 03 \n"); + //printf("WxConsole::CommandString 03 \n"); try { bool insideComment = false; -printf("WxConsole::CommandString 04 \n"); + //printf("WxConsole::CommandString 04 \n"); mInterpreter->InterpretLine( wx2std(line), insideComment ); -printf("WxConsole::CommandString 05 \n"); + //printf("WxConsole::CommandString 05 \n"); } catch (bbtk::QuitException) { @@ -419,7 +419,7 @@ printf("WxConsole::CommandString 05 \n"); std::cout << "* UNDEFINED ERROR (not a bbtk nor a std exception)" << std::endl; } -printf("WxConsole::CommandString 06 \n"); + //printf("WxConsole::CommandString 06 \n"); } //================================================================ -- 2.45.1