Program: bbtk
Module: $RCSfile: bbwxCommandButton.cxx,v $
Language: C++
- Date: $Date: 2008/02/15 12:47:17 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2008/03/10 06:24:13 $
+ Version: $Revision: 1.3 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
- This software is distributed WITHOUT ANY WARRANTY; without even
+ This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
void CommandButtonWidget::OnCommandButton( wxEvent& )
{
- std::string commandstr(mBox->bbGetInputIn());
+ // Look for the interpreter
+ bbtk::Interpreter* I = 0;
+ if (mBox->bbGetParent() != 0)
+ {
+ bbtk::Factory* f =
+ ((bbtk::ComplexBlackBoxDescriptor*)mBox->bbGetParent()
+ ->bbGetDescriptor())->GetFactory();
+ if ((f != 0)&&
+ (f->GetExecuter()))
+ {
+ I = f->GetExecuter()->GetInterpreter();
+ }
+ }
+ if (I==0)
+ {
+ // bbtkError("ExecBbiCommand::DoProcess() : could not find interpreter");
+ I = new bbtk::Interpreter();
+ }
+
+ std::string commandstr(mBox->bbGetInputIn());
// bbtk::Interpreter::mGlobalInterpreter->InterpretLine( commandstr );
int i;
}
}
bool insideComment = false; // for multiline comment
- bbtk::Interpreter::mGlobalInterpreter->InterpretLine( ccommand, insideComment );
+ I->InterpretLine( ccommand, insideComment );
pos1=pos2+1;
pos2 = commandstr.find(";",pos2+1);