X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=kernel%2Fsrc%2FbbtkWxConsole.cxx;h=dc7dc1d337b33b4e321dee8d4b8814fb5bcda257;hb=6d2f79e0ff9b1c0b2db0d7f3d164f4f62434f08d;hp=943cfc19ec40f01eb87c4986c55a9c2458d22f87;hpb=2593029cb1c4a272c6502cc9abc82f980d479739;p=bbtk.git diff --git a/kernel/src/bbtkWxConsole.cxx b/kernel/src/bbtkWxConsole.cxx index 943cfc1..dc7dc1d 100644 --- a/kernel/src/bbtkWxConsole.cxx +++ b/kernel/src/bbtkWxConsole.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkWxConsole.cxx,v $ Language: C++ - Date: $Date: 2008/03/19 12:26:07 $ - Version: $Revision: 1.17 $ + Date: $Date: 2008/03/19 14:58:13 $ + Version: $Revision: 1.18 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -288,34 +288,28 @@ namespace bbtk mwxTextHistory->SetDefaultStyle(*mwxTextHistoryAttr); //printf("WxConsole::CommandString 03 \n"); - try - { - bool insideComment = false; - - mInterpreter->InterpretLine( wx2std(line), insideComment ); - } - catch (bbtk::QuitException) - { - Close(true); - } - catch (bbtk::Exception e) - { - e.Print(); - } - catch (std::exception& e) - { - std::cout << "* ERROR : "<InterpretLine( wx2std(line) ) == + Interpreter::QUIT ) + { + Close(true); + } + //printf("WxConsole::CommandString 06 \n"); } //================================================================ - + //================================================================ + /// Runs the interpretation of a file + void WxConsole::InterpretFile( const std::string& filename) + { + if ( mInterpreter->InterpretFile(filename) == + Interpreter::ERROR ) + { + Show(); + } + } + //================================================================ + //================================================================ void WxConsole::OnMenuQuit(wxCommandEvent& WXUNUSED(event)) { @@ -411,14 +405,13 @@ printf("EED WxConsole::OnMenuCreatePackage 06 \n"); //EED std::cout << "bbi: include "<InterpretFile( filepath ); - bool insideComment = false; // for multiline comment - I->InterpretLine( "exec freeze" ,insideComment ); - I->InterpretLine( "include *" ,insideComment ); - I->InterpretLine( "index "+doc_path+"/bbdoc/index-alpha.html Initials" ,insideComment ); - I->InterpretLine( "index "+doc_path+"/bbdoc/index-package.html Packages" ,insideComment ); - I->InterpretLine( "index "+doc_path+"/bbdoc/index-category.html Categories" ,insideComment ); - I->InterpretLine( "index "+doc_path+"/bbdoc/index-adaptors.html Adaptors",insideComment ); - + I->InterpretLine( "exec freeze"); + I->InterpretLine( "include *"); + I->InterpretLine( "index "+doc_path+"/bbdoc/index-alpha.html Initials"); + I->InterpretLine( "index "+doc_path+"/bbdoc/index-package.html Packages"); + I->InterpretLine( "index "+doc_path+"/bbdoc/index-category.html Categories"); + I->InterpretLine( "index "+doc_path+"/bbdoc/index-adaptors.html Adaptors"); + delete I; } //================================================================