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
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 : "<<e.what()<<" (not in bbtk)"<<std::endl;
- }
- catch (...)
- {
- std::cout << "* UNDEFINED ERROR (not a bbtk nor a std exception)"
- << std::endl;
- }
+ if ( mInterpreter->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))
{
//EED std::cout << "bbi: include "<<filepath<<std::endl;
//EED I->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;
}
//================================================================