+ bool widok = true;
+ std::string widget,adaptor;
+ // try to find a widget adaptor
+ if (F->FindWidgetAdaptor(DataInfo(d->GetTypeInfo(),""),
+ d->GetDataInfo(),
+ adaptor))
+ {
+ // command to create the adaptor
+ (*s) << " new "<<adaptor<<" "<<i->first<<std::endl;
+ // Sets the label of the widget adaptor to the name of the input
+ (*s) << " set "<<i->first<<".Label "<<i->first<<std::endl;
+ // Sets the initial value of the widget to the value of the input
+ (*s) << " set "<<i->first<<".In \" "
+ <<box->bbGetInputAsString(i->first)<<"\""
+ << std::endl;
+ // store the input name
+ in.push_back(i->first);
+ (*s) << " connect "<<i->first<<".Widget layout.Widget"<<in.size()<<std::endl;
+ //<i->first<<"'"<<std::endl;
+ (*s) << " connect "<<i->first<<".BoxChange change.In"<<in.size()<<std::endl;
+ }
+ // try to find a two pieces adaptor
+ else if (F->FindWidgetAdaptor2(DataInfo(d->GetTypeInfo(),""),
+ d->GetDataInfo(),
+ widget,adaptor) )
+ {
+ // command to create the widget
+ (*s) << " new "<<widget<<" "<<i->first<<"Widget"<<std::endl;
+ // command to create the adaptor
+ (*s) << " new "<<adaptor<<" "<<i->first<<std::endl;
+ // connect the two
+ (*s) << " connect "<<i->first<<"Widget.Out "
+ <<i->first<<".In"<<std::endl;
+ // Sets the label of the widget adaptor to the name of the input
+ (*s) << " set "<<i->first<<"Widget.Label "<<i->first<<std::endl;
+ // Sets the initial value of the widget to the value of the input
+ (*s) << " set "<<i->first<<"Widget.In \" "
+ <<box->bbGetInputAsString(i->first)<<"\""<< std::endl;
+ // store the input name
+ in.push_back(i->first);
+ (*s) << " connect "<<i->first<<"Widget.Widget layout.Widget"<<in.size()<<std::endl;
+ //<i->first<<"'"<<std::endl;
+ (*s) << " connect "<<i->first<<"Widget.BoxChange change.In"<<in.size()<<std::endl;
+
+ }
+ // try to find an adaptor from string
+ // If found then can create a text input which
+ // will be automatically adapted
+ else if (F->FindAdaptor(DataInfo(typeid(std::string),""),
+ d->GetDataInfo(),
+ adaptor))
+ {
+ // command to create the adaptor
+ (*s) << " new InputText "<<i->first<<std::endl;
+ // Sets the label of the widget adaptor to the name of the input
+ (*s) << " set "<<i->first<<".Title "<<i->first<<std::endl;
+ // Sets the initial value of the widget to the value of the input
+ (*s) << " set "<<i->first<<".In \" "
+ <<box->bbGetInputAsString(i->first)<<"\""<< std::endl;
+ // store the input name
+ in.push_back(i->first);
+ (*s) << " connect "<<i->first<<".Widget layout.Widget"<<in.size()<<std::endl;
+ //<i->first<<"'"<<std::endl;
+ (*s) << " connect "<<i->first<<".BoxChange change.In"<<in.size()<<std::endl;
+
+ }
+ else
+ {
+ widok = false;
+ }
+ if (widok)
+ {
+ // command to create the output
+ (*s) << " output "<<i->first<<" "
+ <<i->first<<".Out "<<i->first<<std::endl;
+ // <<" Output of the widget which allows to set "
+
+ }
+ }
+ // Inputs for window properties
+ (*s) << " input WinTitle layout.WinTitle Title"<<std::endl;
+ (*s) << " input WinWidth layout.WinWidth Width"<<std::endl;
+ (*s) << " input WinHeight layout.WinHeight Height"<<std::endl;
+ (*s) << " input WinDialog layout.WinDialog Dialog"<<std::endl;
+ (*s) << " input WinHide layout.WinHide Hide"<<std::endl;
+
+
+
+ // Execute the box executes the layout
+ (*s) << " exec layout" << std::endl;
+ (*s) << "endefine" << std::endl;
+ // (*s) << "help "<< typeName<< std::endl;
+ // instanciate the box and connect it
+ (*s) << "new "<<typeName<<" "<<instanceName<<std::endl;
+ // connections
+ std::vector<std::string>::iterator j;
+ for (j=in.begin();j!=in.end();++j)
+ {
+ // connect
+ (*s) << "connect "<<instanceName<<"."<<*j<<" "
+ << boxname<<"."<<*j<<std::endl;
+ }
+ // That's all folks ! now execute the commands :
+ SwitchToStream(s);
+}
+//=======================================================================
+
+
+
+ //==========================================================================
+ void Interpreter::Debug(const std::string& name)
+ {
+ if ((name.length()==2)&&(name[0]=='-'))
+ {
+ if (name[1]=='D')
+ {
+ bbtk::StaticInitTime::PrintObjectListInfo = true;
+ }
+ if (name[1]=='C')
+ {
+ // int o = MessageManager::GetMessageLevel("debug");
+ // if (o<2) MessageManager::SetMessageLevel("debug",2);
+ mVirtualExecuter->GetFactory()->Check();
+ // MessageManager::SetMessageLevel("debug",o);
+ }
+ }
+ else
+ {
+ Object:: PrintObjectListInfo(name);
+ }