From: guigues Date: Wed, 19 Mar 2008 14:58:13 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: r0.6.1~106 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=6d2f79e0ff9b1c0b2db0d7f3d164f4f62434f08d;p=bbtk.git *** empty log message *** --- diff --git a/kernel/install/CMakeLists.txt b/kernel/install/CMakeLists.txt index f9ebc07..ba7d6d7 100644 --- a/kernel/install/CMakeLists.txt +++ b/kernel/install/CMakeLists.txt @@ -46,7 +46,7 @@ IF(WIN32) INSTALL( FILES ${WXWIDGETS_ROOT_DIR}/lib/vc_dll/wxbase28d_vc_custom.dll DESTINATION bin/ ) INSTALL( FILES ${WXWIDGETS_ROOT_DIR}/lib/vc_dll/wxbase28d_odbc_vc_custom.dll DESTINATION bin/ ) INSTALL( FILES ${WXWIDGETS_ROOT_DIR}/lib/vc_dll/wxbase28d_net_vc_custom.dll DESTINATION bin/ ) -ENDIF(WIN32) + @@ -61,6 +61,7 @@ message("eed3 " ${iLST} ) ) ENDFOREACH(iLST) +ENDIF(WIN32) INSTALL( DIRECTORY ${BBTK_BINARY_DIR}/${BBTK_DOC_REL_PATH} diff --git a/kernel/src/bbtkInterpreter.cxx b/kernel/src/bbtkInterpreter.cxx index 2147d0c..674513f 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/18 12:51:26 $ - Version: $Revision: 1.46 $ + Date: $Date: 2008/03/19 14:58:13 $ + Version: $Revision: 1.47 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -302,57 +302,41 @@ bufferNb =0; /** * */ - void Interpreter::InterpretFile( const std::string& filename ) + Interpreter::ExitStatus Interpreter::InterpretFile( const std::string& filename ) { bbtkDebugMessageInc("Interpreter",9,"Interpreter::InterpretFile(\""<::iterator it =mFileName.begin(); it!=mFileName.end(); ++it) - { - std::cout << "A=== [" << (*it) << "]" << std::endl; - } -*/ bool insideComment = false; // for multiline comment while (mFile.size()>0) { -/* - for( std::vector::iterator it =mFileName.begin(); it!=mFileName.end(); ++it) - { - std::cout << "B=== [" << (*it) << "]" << std::endl; - } -*/ - - //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 ) + while (!mFile.back()->eof()) { + mLine.back()++; + char buf[500]; + mFile.back()->getline(buf,500); + std::string str(buf); + int size=str.length(); + if ( str[ size-1 ]==13 ) { - str.erase(size-1,1); + str.erase(size-1,1); } - - InterpretLine(str, insideComment); - + + InterpretLine(str, insideComment); + }//while - //if (mFile.size()>0) CloseCurrentFile(); } } catch (QuitException e) { + status = QUIT; } catch (bbtk::Exception e) { @@ -361,6 +345,7 @@ bufferNb =0; std::cerr << "* FILE : \""<::iterator it =mFileName.begin(); it!=mFileName.end(); ++it) - { - std::cout << "A=== [" << (*it) << "]" << std::endl; - } -*/ bool insideComment = false; // for multiline comment while (mFile.size()>0) { -/* - for( std::vector::iterator it =mFileName.begin(); it!=mFileName.end(); ++it) - { - std::cout << "B=== [" << (*it) << "]" << std::endl; - } -*/ - - //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 ) + while (!mFile.back()->eof()) { + mLine.back()++; + char buf[500]; + mFile.back()->getline(buf,500); + std::string str(buf); + + int size=str.length(); + if ( str[ size-1 ]==13 ) { - str.erase(size-1,1); + str.erase(size-1,1); } - - InterpretLine(str, insideComment); - - }//while - //if (mFile.size()>0) - CloseCurrentFile(); + + InterpretLine(str, insideComment); + + }//while + + CloseCurrentFile(); } } catch (QuitException e) - { - // std::cout << "**QuitException caught**"<& words) } catch (QuitException e) { + bbtkMessage("Interpreter",1,"Interpreter : Quit"<& m) @@ -115,13 +136,28 @@ namespace bbtk void SetDialogMode(DialogModeType t) { mExecuter->SetDialogMode(t); } - /// Runs the interpretation of a file - void InterpretFile( const std::string& filename); + /// Sets the bool that indicates wether we are in command line context + void SetCommandLine(bool v = true) { mCommandLine = v; } - /// Runs the interpretation of a buffer and deletes it ! - void InterpretBuffer( std::stringstream* buffer ); - /// Interprets a line (either from a file or typed interactively) + +#ifdef _USE_WXWIDGETS_ + /// Sets the WxConsole that created the interpreter (if any) + void SetWxConsole(WxConsole* c) { mWxConsole = c; } + /// Gets the WxConsole that created the interpreter (if any) + WxConsole* GetWxConsole() { return mWxConsole; } + /// Gets the WxConsole that created the interpreter (if any) - const + const WxConsole* GetWxConsole() const { return mWxConsole; } +#endif + + /// Gets the Executer + VirtualExec* GetExecuter() { return mExecuter; } + /// Gets the Executer (const) + const VirtualExec* GetExecuter() const { return mExecuter; } + + + protected: + /// Interprets a line void InterpretLine( const std::string& line, bool &insideComment ); /// Reads a line from prompt @@ -171,22 +207,7 @@ namespace bbtk int n, std::vector& commands ); - /// Sets the bool that indicates wether we are in command line context - void SetCommandLine(bool v = true) { mCommandLine = v; } - -#ifdef _USE_WXWIDGETS_ - /// Sets the WxConsole that created the interpreter (if any) - void SetWxConsole(WxConsole* c) { mWxConsole = c; } - /// Gets the WxConsole that created the interpreter (if any) - WxConsole* GetWxConsole() { return mWxConsole; } - /// Gets the WxConsole that created the interpreter (if any) - const - const WxConsole* GetWxConsole() const { return mWxConsole; } -#endif - /// Gets the Executer - VirtualExec* GetExecuter() { return mExecuter; } - /// Gets the Executer (const) - const VirtualExec* GetExecuter() const { return mExecuter; } private: 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; } //================================================================ diff --git a/kernel/src/bbtkWxConsole.h b/kernel/src/bbtkWxConsole.h index 87abef3..343ccd8 100644 --- a/kernel/src/bbtkWxConsole.h +++ b/kernel/src/bbtkWxConsole.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkWxConsole.h,v $ Language: C++ - Date: $Date: 2008/03/18 12:51:26 $ - Version: $Revision: 1.9 $ + Date: $Date: 2008/03/19 14:58:13 $ + Version: $Revision: 1.10 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -79,8 +79,8 @@ namespace bbtk { mInterpreter->SetDialogMode(t); } /// Runs the interpretation of a file - void InterpretFile( const std::string& filename) - { mInterpreter->InterpretFile(filename); } + void InterpretFile( const std::string& filename); + void OnMenuQuit(wxCommandEvent& event); void OnMenuAbout(wxCommandEvent& event); diff --git a/kernel/src/bbtkWxEditor.cxx b/kernel/src/bbtkWxEditor.cxx index 264f159..f178a89 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/19 08:03:59 $ - Version: $Revision: 1.4 $ + Date: $Date: 2008/03/19 14:58:13 $ + Version: $Revision: 1.5 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -349,8 +349,7 @@ namespace bbtk } std::stringstream* buffer = new std::stringstream(bbtk::wx2std(mwxInputText->GetValue())); - bool com = false; - mInterpreter->InterpretLine("reset",com); + mInterpreter->InterpretLine("reset"); try { mInterpreter->InterpretBuffer(buffer); diff --git a/packages/std/src/bbstdExecBbiCommand.cxx b/packages/std/src/bbstdExecBbiCommand.cxx index ae427d5..af65ae7 100755 --- a/packages/std/src/bbstdExecBbiCommand.cxx +++ b/packages/std/src/bbstdExecBbiCommand.cxx @@ -58,8 +58,8 @@ namespace bbstd ccommand[i]=34; } } - bool insideComment = false; // for multiline comment - I->InterpretLine( ccommand, insideComment); + + I->InterpretLine( ccommand ); pos1=pos2+1; pos2 = bbGetInputIn().find(";",pos2+1); diff --git a/packages/wx/src/bbwxCommandButton.cxx b/packages/wx/src/bbwxCommandButton.cxx index 9b39118..15021cb 100644 --- a/packages/wx/src/bbwxCommandButton.cxx +++ b/packages/wx/src/bbwxCommandButton.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbwxCommandButton.cxx,v $ Language: C++ - Date: $Date: 2008/03/19 12:26:09 $ - Version: $Revision: 1.4 $ + Date: $Date: 2008/03/19 14:58:14 $ + Version: $Revision: 1.5 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -111,8 +111,7 @@ namespace bbwx ccommand[i]=34; // " } } - bool insideComment = false; // for multiline comment - I->InterpretLine( ccommand, insideComment ); + I->InterpretLine( ccommand ); pos1=pos2+1; pos2 = commandstr.find(";",pos2+1); diff --git a/packages/wxvtk/bbs/appli/ExampleMIPWithControls.bbs b/packages/wxvtk/bbs/appli/ExampleMIPWithControls.bbs index a49a021..f7bb732 100644 --- a/packages/wxvtk/bbs/appli/ExampleMIPWithControls.bbs +++ b/packages/wxvtk/bbs/appli/ExampleMIPWithControls.bbs @@ -24,5 +24,5 @@ set MIP.Scale 200 #set MIP.Colour "0.5 0 0" set MIP.Title "MIP Controls" -set main.title "ExampleMIPWithControls" +set main.WinTitle "ExampleMIPWithControls" exec main