Program: bbtk
Module: $RCSfile: bbtkBlackBox.cxx,v $
Language: C++
- Date: $Date: 2009/05/28 08:12:05 $
- Version: $Revision: 1.46 $
+ Date: $Date: 2009/05/28 14:22:09 $
+ Version: $Revision: 1.47 $
=========================================================================*/
/* ---------------------------------------------------------------------
if (this->bbGetDescriptor()->GetPackage())
{
- bbtkBlackBoxMessage("Help",1,"Black Box '"<<bbGetName()<<"' <"<<
+ bbtkBlackBoxMessage("help",1,"Black Box '"<<bbGetName()<<"' <"<<
this->bbGetDescriptor()->GetPackage()->GetName()
<<"::"<<this->bbGetDescriptor()->GetTypeName()<<">"<<std::endl);
}
else
{
- bbtkBlackBoxMessage("Help",1,"Black Box <::"<<this->bbGetDescriptor()->GetTypeName()<<">"<<std::endl);
+ bbtkBlackBoxMessage("help",1,"Black Box <::"<<this->bbGetDescriptor()->GetTypeName()<<">"<<std::endl);
}
/*
if (bbIsUpToDate())
{
- bbtkBlackBoxMessage("Help",1,"Up-to-date ["<<mMaxInputChangeTime<<","
+ bbtkBlackBoxMessage("help",1,"Up-to-date ["<<mMaxInputChangeTime<<","
<<mMinOutputChangeTime<<"]"<<std::endl);
}
else
{
- bbtkBlackBoxMessage("Help",1,"Out-of-date ["<<mMaxInputChangeTime<<","
+ bbtkBlackBoxMessage("help",1,"Out-of-date ["<<mMaxInputChangeTime<<","
<<mMinOutputChangeTime<<"]"<<std::endl);
}
*/
- // bbtkBlackBoxMessage("Help",1," "<<GetDescription()<<std::endl);
- // bbtkBlackBoxMessage("Help",1," By : "<<GetAuthor()<<std::endl);
+ // bbtkBlackBoxMessage("help",1," "<<GetDescription()<<std::endl);
+ // bbtkBlackBoxMessage("help",1," By : "<<GetAuthor()<<std::endl);
std::vector<std::string> iname;
std::vector<std::string> ivalue;
}
if (iname.size())
- bbtkBlackBoxMessage("Help",1," * Inputs : "<<std::endl);
+ bbtkBlackBoxMessage("help",1," * Inputs : "<<std::endl);
else
- bbtkBlackBoxMessage("Help",1," * No inputs"<<std::endl);
+ bbtkBlackBoxMessage("help",1," * No inputs"<<std::endl);
std::vector<std::string>::iterator i1,i2,i3,i4;
for (i1=iname.begin(),i2=ivalue.begin(),i3=iconn.begin(),i4=istatus.begin();
value += "'";
value.append(1+valuelmax-value.size(),' ');
if (i3->size())
- bbtkBlackBoxMessage("Help",1," '"<<name<<" = '"<<value<<" <-- '"
+ bbtkBlackBoxMessage("help",1," '"<<name<<" = '"<<value<<" <-- '"
<<*i3<<"'");
else
- bbtkBlackBoxMessage("Help",1," '"<<name<<" = '"<<value);
- bbtkBlackBoxMessage("Help",1," ["<<*i4<<"]"<<std::endl);
+ bbtkBlackBoxMessage("help",1," '"<<name<<" = '"<<value);
+ bbtkBlackBoxMessage("help",1," ["<<*i4<<"]"<<std::endl);
}
if (oname.size())
- bbtkBlackBoxMessage("Help",1," * Outputs : "<<std::endl);
+ bbtkBlackBoxMessage("help",1," * Outputs : "<<std::endl);
else
- bbtkBlackBoxMessage("Help",1," * No outputs"<<std::endl);
+ bbtkBlackBoxMessage("help",1," * No outputs"<<std::endl);
std::vector<std::vector<std::string> >::iterator i5;
value += "'";
value.append(1+valuelmax-value.size(),' ');
if (!(*i5).size())
- bbtkBlackBoxMessage("Help",1," '"<<name<<" = '"<<value);
+ bbtkBlackBoxMessage("help",1," '"<<name<<" = '"<<value);
else
{
std::string pref = " '"+name+" = '"+value;
for (i3=i5->begin();i3!=i5->end();++i3)
{
- bbtkBlackBoxMessage("Help",1,pref<<" --> '"<<*i3<<"'");
+ bbtkBlackBoxMessage("help",1,pref<<" --> '"<<*i3<<"'");
pref.replace(0,pref.size(),pref.size(),' ');
}
}
- bbtkBlackBoxMessage("Help",1," ["<<*i4<<"]"<<std::endl);
+ bbtkBlackBoxMessage("help",1," ["<<*i4<<"]"<<std::endl);
}
}
Program: bbtk
Module: $RCSfile: bbtkConfigurationFile.cxx,v $
Language: C++
- Date: $Date: 2009/03/24 13:42:59 $
- Version: $Revision: 1.30 $
+ Date: $Date: 2009/05/28 14:22:10 $
+ Version: $Revision: 1.31 $
=========================================================================*/
/* ---------------------------------------------------------------------
INVALID_FILE_SEPARATOR,
VALID_FILE_SEPARATOR);
- bbtkMessage("Config",1," ==> bin : '"<<mBin_path<<"'"<<std::endl);
- bbtkMessage("Config",1," ==> prefix : '"<<mInstall_path<<"'"<<std::endl);
- bbtkMessage("Config",1," ==> doc : '"<<mDoc_path<<"'"<<std::endl);
- bbtkMessage("Config",1," ==> bbs : '"<<mBbs_path<<"'"<<std::endl);
- bbtkMessage("Config",1," ==> data : '"<<mData_path<<"'"<<std::endl);
+ bbtkMessage("config",1," ==> bin : '"<<mBin_path<<"'"<<std::endl);
+ bbtkMessage("config",1," ==> prefix : '"<<mInstall_path<<"'"<<std::endl);
+ bbtkMessage("config",1," ==> doc : '"<<mDoc_path<<"'"<<std::endl);
+ bbtkMessage("config",1," ==> bbs : '"<<mBbs_path<<"'"<<std::endl);
+ bbtkMessage("config",1," ==> data : '"<<mData_path<<"'"<<std::endl);
if ( Utilities::FileExists( configXmlFullPathName ))
{
- bbtkMessage("Config",1, "ConfigurationFile : [" << configXmlFullPathName <<
+ bbtkMessage("config",1, "ConfigurationFile : [" << configXmlFullPathName <<
"] found in current directory" << std::endl);
//Read(configXmlFullPathName.c_str());
// traiter le fichier local
std::string filename = Utilities::MakeUserSettingsFullFileName("doc/help_contents.html");
if (!Utilities::FileExists(filename))
{
- bbtkDebugMessage("Config",1,
+ bbtkDebugMessage("config",1,
"* Creating [" << filename << "]" << std::endl);
// The path to the doc folder (=mInstall_path+"/"+mDoc_rel_path)
std::string doc_path = mInstall_path + "/"
FILE *fp;
char configXml[250];
sprintf (configXml , "%s/bbtk_config.xml", rootDirectory);
- bbtkDebugMessage("Config",1, "in CreateConfigXML[" << configXml << "]" << std::endl);
+ bbtkDebugMessage("config",1, "in CreateConfigXML[" << configXml << "]" << std::endl);
fp = fopen (configXml, "w");
fprintf(fp, "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");
fprintf(fp, "<config>\n");
sprintf(copyFile,"copy %s\\bbtk_config.xml.tmp \"%s\"\\bbtk_config.xml ",bbtk_path,rootDirectory );
int attribs = GetFileAttributes (rootDirectory);
- bbtkMessage("Config",1,std::hex << attribs << " " << FILE_ATTRIBUTE_DIRECTORY << std::endl);
+ bbtkMessage("config",1,std::hex << attribs << " " << FILE_ATTRIBUTE_DIRECTORY << std::endl);
if ( attribs != 0xFFFFFFFF)
{
if ((attribs & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY ) /// \TODO : check !
void ConfigurationFile::Read(const std::string& filename)
{
- bbtkDebugMessage("Config",1,"ConfigurationFile::Read(" <<filename << ")" << std::endl);
+ bbtkDebugMessage("config",1,"ConfigurationFile::Read(" <<filename << ")" << std::endl);
mConfig_xml_full_path = filename;
XMLResults* res = new XMLResults;
{
std::string mess = GetErrorMessage(res,filename);
delete res;
- bbtkDebugMessage("Config",1,mess<< std::endl);
+ bbtkDebugMessage("config",1,mess<< std::endl);
bbtkError(mess);
}
delete res;
- bbtkDebugMessage("Config",1,"OK" << std::endl);
+ bbtkDebugMessage("config",1,"OK" << std::endl);
int i,j;
//=========================================================================
bool ConfigurationFile::AddPackagePathsAndWrite( const std::string& path )
{
- bbtkDebugMessageInc("Config",9,
+ bbtkDebugMessageInc("config",9,
"ConfigurationFile::AddPackagePathsAndWrite("
<<path<<")"<<std::endl);
{
std::string mess = GetErrorMessage(res,Get_config_xml_full_path());
delete res;
- bbtkDebugMessage("Config",1,mess<< std::endl);
+ bbtkDebugMessage("config",1,mess<< std::endl);
bbtkError(mess);
}
delete res;
if ( err != eXMLErrorNone )
{
std::string mess = GetErrorMessage(res,Get_config_xml_full_path());
- bbtkDebugMessage("Config",1,mess<< std::endl);
+ bbtkDebugMessage("config",1,mess<< std::endl);
bbtkError(mess);
}
//=========================================================================
void ConfigurationFile::GetHelp(int level) const
{
- bbtkDebugMessageInc("Config",9,"ConfigurationFile::GetHelp("<<level
+ bbtkDebugMessageInc("config",9,"ConfigurationFile::GetHelp("<<level
<<")"<<std::endl);
const std::string config_xml_full_path = Get_config_xml_full_path();
const std::vector<std::string>bbs_paths = Get_bbs_paths();
const std::vector<std::string>package_paths = Get_package_paths();
- bbtkMessage("Help",level, "=============" << std::endl);
- bbtkMessage("Help",level, "Configuration" << std::endl);
- bbtkMessage("Help",level, "=============" << std::endl);
- bbtkMessage("Help",level, "bbtk_config.xml : [" << config_xml_full_path << "]" << std::endl);
- bbtkMessage("Help",level, "Documentation Path : [" << url << "]" << std::endl);
- bbtkMessage("Help",level, "Data Path : [" << data_path << "]" << std::endl);
- bbtkMessage("Help",level, "Temp Directory : [" << default_temp_dir << "]" << std::endl);
- bbtkMessage("Help",level, "File Separator : [" << file_separator << "]" << std::endl);
+ bbtkMessage("help",level, "=============" << std::endl);
+ bbtkMessage("help",level, "Configuration" << std::endl);
+ bbtkMessage("help",level, "=============" << std::endl);
+ bbtkMessage("help",level, "bbtk_config.xml : [" << config_xml_full_path << "]" << std::endl);
+ bbtkMessage("help",level, "Documentation Path : [" << url << "]" << std::endl);
+ bbtkMessage("help",level, "Data Path : [" << data_path << "]" << std::endl);
+ bbtkMessage("help",level, "Temp Directory : [" << default_temp_dir << "]" << std::endl);
+ bbtkMessage("help",level, "File Separator : [" << file_separator << "]" << std::endl);
std::vector<std::string>::const_iterator i;
- bbtkMessage("Help",level, "BBS Paths " << std::endl);
+ bbtkMessage("help",level, "BBS Paths " << std::endl);
for (i = bbs_paths.begin(); i!=bbs_paths.end(); ++i )
{
- bbtkMessage("Help",level,"--- ["<<*i<<"]"<<std::endl);
+ bbtkMessage("help",level,"--- ["<<*i<<"]"<<std::endl);
}
- bbtkMessage("Help",level, "PACKAGE Paths : " << std::endl);
+ bbtkMessage("help",level, "PACKAGE Paths : " << std::endl);
for (i = package_paths.begin(); i!=package_paths.end(); ++i )
{
- bbtkMessage("Help",level,"--- ["<<*i<<"]"<<std::endl);
+ bbtkMessage("help",level,"--- ["<<*i<<"]"<<std::endl);
}
- bbtkDebugDecTab("Config",9);
+ bbtkDebugDecTab("config",9);
}
//=========================================================================
Program: bbtk
Module: $RCSfile: bbtkFactory.cxx,v $
Language: C++
- Date: $Date: 2009/05/28 08:12:05 $
- Version: $Revision: 1.43 $
+ Date: $Date: 2009/05/28 14:22:10 $
+ Version: $Revision: 1.44 $
=========================================================================*/
/* ---------------------------------------------------------------------
PackageMapType::const_iterator i;
for (i = mPackageMap.begin(); i!=mPackageMap.end(); ++i )
{
- bbtkMessage("Help",1, i->first << std::endl);
+ bbtkMessage("help",1, i->first << std::endl);
if (details) {
i->second->PrintBlackBoxes(false,adaptors);
}
PackageMapType::const_iterator i = mPackageMap.find(name);
if ( i != mPackageMap.end() )
{
- bbtkMessage("Help",1, "Package "<<i->first<<" ");
+ bbtkMessage("help",1, "Package "<<i->first<<" ");
if (i->second->GetVersion().length()>0)
- bbtkMessageCont("Help",1,"v" <<i->second->GetVersion());
+ bbtkMessageCont("help",1,"v" <<i->second->GetVersion());
if (i->second->GetAuthor().length()>0)
- bbtkMessageCont("Help",1,"- "<<i->second->GetAuthor());
+ bbtkMessageCont("help",1,"- "<<i->second->GetAuthor());
if (i->second->GetCategory().length()>0)
- bbtkMessageCont("Help",1,"- "<<i->second->GetCategory());
+ bbtkMessageCont("help",1,"- "<<i->second->GetCategory());
- bbtkMessageCont("Help",1,std::endl);
- bbtkIncTab("Help",1);
- bbtkMessage("Help",1,i->second->GetDescription()<<std::endl);
+ bbtkMessageCont("help",1,std::endl);
+ bbtkIncTab("help",1);
+ bbtkMessage("help",1,i->second->GetDescription()<<std::endl);
if (i->second->GetNumberOfBlackBoxes()>0)
{
- bbtkMessage("Help",1, "Black boxes : "<<std::endl);
+ bbtkMessage("help",1, "Black boxes : "<<std::endl);
i->second->PrintBlackBoxes(true,adaptors);
}
else
{
- bbtkMessage("Help",1, "No black boxes"<<std::endl);
+ bbtkMessage("help",1, "No black boxes"<<std::endl);
}
- bbtkDecTab("Help",1);
+ bbtkDecTab("help",1);
}
else
{
Program: bbtk
Module: $RCSfile: bbtkPackage.cxx,v $
Language: C++
- Date: $Date: 2009/05/28 12:18:51 $
- Version: $Revision: 1.28 $
+ Date: $Date: 2009/05/28 14:22:10 $
+ Version: $Revision: 1.29 $
=========================================================================*/
/* ---------------------------------------------------------------------
BlackBox::Pointer Package::NewBlackBox(const std::string& type,
const std::string& name) const
{
- bbtkDebugMessageInc("Kernel",8,"Package<"<<GetName()<<">::NewBlackBox(\""<<type<<"\",\""<<name<<"\")"<<bbtkendl);
+ bbtkDebugMessageInc("kernel",8,"Package<"<<GetName()<<">::NewBlackBox(\""<<type<<"\",\""<<name<<"\")"<<bbtkendl);
BlackBoxMapType::const_iterator i = mBlackBoxMap.find(type);
if (i == mBlackBoxMap.end())
{
- bbtkDebugDecTab("Kernel",8);
+ bbtkDebugDecTab("kernel",8);
return BlackBox::Pointer();
}
BlackBox::Pointer bb =i->second->NewBlackBox(name);
- bbtkDebugDecTab("Kernel",8);
+ bbtkDebugDecTab("kernel",8);
return bb;
}
const DataInfo& typeout,
const std::string& name) const
{
- bbtkDebugMessageInc("Kernel",8,"Package<"<<GetName()<<
+ bbtkDebugMessageInc("kernel",8,"Package<"<<GetName()<<
">::NewAdaptor("
<<typein<<","
<<typeout<<",\""
AdaptorMapType::const_iterator i = mAdaptorMap.find(key);
if (i == mAdaptorMap.end())
{
- bbtkDebugDecTab("Kernel",8);
+ bbtkDebugDecTab("kernel",8);
return BlackBox::Pointer();
}
BlackBox::Pointer bb =i->second.lock()->NewBlackBox(name);
- bbtkDebugDecTab("Kernel",8);
+ bbtkDebugDecTab("kernel",8);
return bb;
}
const DataInfo& typeout,
const std::string& name) const
{
- bbtkDebugMessageInc("Kernel",8,"Package<"<<GetName()<<
+ bbtkDebugMessageInc("kernel",8,"Package<"<<GetName()<<
">::NewWidgetAdaptor("
<<typein<<","
<<typeout<<",\""
AdaptorMapType::const_iterator i = mAdaptorMap.find(key);
if (i == mAdaptorMap.end())
{
- bbtkDebugDecTab("Kernel",8);
+ bbtkDebugDecTab("kernel",8);
return BlackBox::Pointer();
}
BlackBox::Pointer bb =i->second.lock()->NewBlackBox(name);
- bbtkDebugDecTab("Kernel",8);
+ bbtkDebugDecTab("kernel",8);
return bb;
}
const DataInfo& typeout,
std::string& adaptor) const
{
- bbtkDebugMessageInc("Kernel",8,"Package<"<<GetName()<<
+ bbtkDebugMessageInc("kernel",8,"Package<"<<GetName()<<
">::FindWidgetAdaptor("
<<typein<<","
<<typeout<<")"<<bbtkendl);
AdaptorMapType::const_iterator i = mAdaptorMap.find(key);
if (i == mAdaptorMap.end())
{
- bbtkDebugDecTab("Kernel",8);
+ bbtkDebugDecTab("kernel",8);
return false;
}
adaptor = i->second.lock()->GetTypeName();
- bbtkDebugDecTab("Kernel",8);
+ bbtkDebugDecTab("kernel",8);
return true;
}
const DataInfo& typeout,
std::string& adaptor) const
{
- bbtkDebugMessageInc("Kernel",8,"Package<"<<GetName()<<
+ bbtkDebugMessageInc("kernel",8,"Package<"<<GetName()<<
">::FindAdaptor("
<<typein<<","
<<typeout<<")"<<bbtkendl);
AdaptorMapType::const_iterator i = mAdaptorMap.find(key);
if (i == mAdaptorMap.end())
{
- bbtkDebugDecTab("Kernel",8);
+ bbtkDebugDecTab("kernel",8);
return false;
}
adaptor = i->second.lock()->GetTypeName();
- bbtkDebugDecTab("Kernel",8);
+ bbtkDebugDecTab("kernel",8);
return true;
}
/// Registers a black box descriptor in the package
bool Package::RegisterBlackBox(BlackBoxDescriptor::Pointer d)
{
- bbtkDebugMessageInc("Kernel",8,"Package<"<<GetName()<<">::RegisterBlackBox(\""<<d->GetTypeName()<<"\")"<<std::endl);
+ bbtkDebugMessageInc("kernel",8,"Package<"<<GetName()<<">::RegisterBlackBox(\""<<d->GetTypeName()<<"\")"<<std::endl);
BlackBoxMapType::iterator i = mBlackBoxMap.find(d->GetTypeName());
if (i!=mBlackBoxMap.end())
// If it is a default adaptor, also register it in the adaptors map
if ( d->GetKind() == BlackBoxDescriptor::DEFAULT_ADAPTOR )
{
- bbtkDebugMessage("Kernel",8,"Package<"<<GetName()<<">::RegisterBlackBox(\""<<d->GetTypeName()<<"\") : The box is an adaptor, inserting it in adaptors map ..."<<std::endl);
+ bbtkDebugMessage("kernel",8,"Package<"<<GetName()<<">::RegisterBlackBox(\""<<d->GetTypeName()<<"\") : The box is an adaptor, inserting it in adaptors map ..."<<std::endl);
TypeInfo typein = d->GetInputDescriptor("In")->GetTypeInfo();
TypeInfo typeout = d->GetOutputDescriptor("Out")->GetTypeInfo();
// If it is a default adaptor, also register it in the adaptors map
else if ( d->GetKind() == BlackBoxDescriptor::DEFAULT_GUI)
{
- bbtkDebugMessage("Kernel",8,"Package<"<<GetName()<<">::RegisterBlackBox(\""<<d->GetTypeName()<<"\") : The box is a widget adaptor, inserting it in adaptors map ..."<<std::endl);
+ bbtkDebugMessage("kernel",8,"Package<"<<GetName()<<">::RegisterBlackBox(\""<<d->GetTypeName()<<"\") : The box is a widget adaptor, inserting it in adaptors map ..."<<std::endl);
TypeInfo typeout = d->GetOutputDescriptor("Out")->GetTypeInfo();
DataInfo infoin(typeid(void),"");
}
- bbtkDebugDecTab("Kernel",8);
+ bbtkDebugDecTab("kernel",8);
return true;
}
/// Changes the name of a black box type
void Package::ChangeBlackBoxName( const std::string& oldname, const std::string& newname )
{
- bbtkDebugMessageInc("Kernel",8,"Package<"<<GetName()<<">::ChangeBlackBoxName(\""<<oldname<<"\",\""<<newname<<"\")"<<std::endl);
+ bbtkDebugMessageInc("kernel",8,"Package<"<<GetName()<<">::ChangeBlackBoxName(\""<<oldname<<"\",\""<<newname<<"\")"<<std::endl);
// Looking into the bb map
BlackBoxMapType::iterator i = mBlackBoxMap.find(oldname);
if (i == mBlackBoxMap.end())
{
- bbtkDebugDecTab("Kernel",8);
+ bbtkDebugDecTab("kernel",8);
bbtkError("ChangeBlackBoxName : The package <"<<GetName()<<"> does not contains the black box <"<<oldname<<">");
}
mBlackBoxMap[newname] = i->second;
mBlackBoxMap.erase(i);
- bbtkDebugDecTab("Kernel",8);
+ bbtkDebugDecTab("kernel",8);
}
//==========================================================================
{
std::string space;
space.append(lmax - ni->size() - ci->size(),' ');
- bbtkMessage("Help",1,*ni << space << *ci );
+ bbtkMessage("help",1,*ni << space << *ci );
std::string d(*di);
unsigned int dmax = 75 - lmax;
// while (d.size() > dmax )
// {
if (d.size()>dmax)
- bbtkMessage("Help",1,d.substr(0,dmax) << "..." << std::endl);
+ bbtkMessage("help",1,d.substr(0,dmax) << "..." << std::endl);
else
- bbtkMessage("Help",1,d << std::endl);
+ bbtkMessage("help",1,d << std::endl);
// d = d.substr(dmax,d.size());
// }
}
{
if ( i->second->GetKind() != BlackBoxDescriptor::STANDARD )
{
- bbtkMessage("Help",1,
+ bbtkMessage("help",1,
" "<<i->second->GetTypeName());
if ( i->second->GetKind() ==
BlackBoxDescriptor::DEFAULT_ADAPTOR )
{
- bbtkMessage("Help",1,
+ bbtkMessage("help",1,
" [default]");
}
if (description)
{
- bbtkMessage("Help",1,
+ bbtkMessage("help",1,
" : "<<i->second->GetDescription());
}
- bbtkMessage("Help",1,std::endl);
+ bbtkMessage("help",1,std::endl);
}
}
/*
i!=mAdaptorMap.end();
++i)
{
- bbtkMessage("Help",1,
+ bbtkMessage("help",1,
" "<<i->second->GetTypeName());
if (detail_level>0)
{
- bbtkMessage("Help",1,
+ bbtkMessage("help",1,
" : "<<i->second->GetDescription());
}
- bbtkMessage("Help",1,std::endl);
+ bbtkMessage("help",1,std::endl);
}
*/
}
/// Prints help on a black box
void Package::HelpBlackBox(const std::string& name, bool full) const
{
- bbtkDebugMessageInc("Kernel",8,"Package<"<<GetName()<<">::HelpBlackBox(\""
+ bbtkDebugMessageInc("kernel",8,"Package<"<<GetName()<<">::HelpBlackBox(\""
<<name<<"\")"<<bbtkendl);
BlackBoxMapType::const_iterator i = mBlackBoxMap.find(name);
if (i == mBlackBoxMap.end())
{
- bbtkDebugDecTab("Kernel",8);
+ bbtkDebugDecTab("kernel",8);
bbtkError("The package <"<<GetName()<<"> does not contains the black box <"<<name<<">");
}
- // bbtkMessage("Help",1,"["<<GetName()<<"] ");
+ // bbtkMessage("help",1,"["<<GetName()<<"] ");
i->second->GetHelp(full);
- bbtkDebugDecTab("Kernel",8);
+ bbtkDebugDecTab("kernel",8);
}
//==========================================================================
/// Returns true iff the package contains the box of name boxname
bool Package::ContainsBlackBox(const std::string& name) const
{
- bbtkDebugMessageInc("Kernel",8,"Package<"<<GetName()<<">::HelpBlackBox(\""
+ bbtkDebugMessageInc("kernel",8,"Package<"<<GetName()<<">::HelpBlackBox(\""
<<name<<"\")"<<bbtkendl);
BlackBoxMapType::const_iterator i = mBlackBoxMap.find(name);
if (i == mBlackBoxMap.end())
{
- bbtkDebugDecTab("Kernel",8);
+ bbtkDebugDecTab("kernel",8);
return false;
}
- bbtkDebugDecTab("Kernel",8);
+ bbtkDebugDecTab("kernel",8);
return true;
}
//==========================================================================
int level,
bool relative_link ) const
{
- bbtkDebugMessageInc("Kernel",9,"Package<"<<GetName()<<">::CreateHtmlPage(\""
+ bbtkDebugMessageInc("kernel",9,"Package<"<<GetName()<<">::CreateHtmlPage(\""
<<filename<<"\")"<<bbtkendl);
//---------------------
//----------------------
// End
- bbtkDebugDecTab("Kernel",9);
+ bbtkDebugDecTab("kernel",9);
}
//==========================================================================
Program: bbtk
Module: $RCSfile: bbtkQt.cxx,v $
Language: C++
- Date: $Date: 2009/05/18 10:45:41 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2009/05/28 14:22:10 $
+ Version: $Revision: 1.3 $
=========================================================================*/
/* ---------------------------------------------------------------------
void Qt::CreateQtAppIfNeeded()
{
- if (QApplication::instance()==0)
+
+ if (QApplication::instance()==0)
{
+
if (mgQtApp != 0)
{
bbtkGlobalError("Qt::CreateQtAppIfNeeded() : INTERNAL ERROR ! (QCoreApplication::instance()==0) && (mgQtApp != 0)");
}
- bbtkDebugMessage("qt",1," --> Creating bbtk QApplication"<<std::endl);
+ bbtkDebugMessage("widget",1," --> Creating bbtk QApplication"<<std::endl);
char* aargv = const_cast<char*>(argv);
mgQtApp = new QApplication(argc,&aargv);
- // std::cout << ">>>> mgQtApp.exec()"<<std::endl;
-
- // mgQtApp->exec();
- // std::cout << "<<<< mgQtApp.exec()"<<std::endl;
- // wxApp::SetInstance(mgQtApp);
+ bbtkDebugMessage("widget",9," --> QApplication::instance = "<<QApplication::instance()<<std::endl);
- //int argc = 0;
- //wxEntry(argc,0);
+ /*
+ std::cout << ">>>> mgQtApp.exec()"<<std::endl;
+
+ mgQtApp->exec();
- // wxInitialize();
+ std::cout << "<<<< mgQtApp.exec()"<<std::endl;
+ */
}
}
Program: bbtk
Module: $RCSfile: bbtkQtBlackBox.cxx,v $
Language: C++
- Date: $Date: 2009/05/14 14:43:33 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2009/05/28 14:22:10 $
+ Version: $Revision: 1.3 $
=========================================================================*/
/* ---------------------------------------------------------------------
//==================================================================
void QtBlackBox::bbUserSetDefaultValues()
{
+ bbtkBlackBoxDebugMessage("widget",5,"QtBlackBox::bbUserSetDefaultValues()"<<std::endl);
+ bbmWindow = 0;
}
//==================================================================
}
//==================================================================
- //==================================================================
+ //==================================================================
void QtBlackBox::bbUserFinalizeProcessing()
{
+ bbtkBlackBoxDebugMessage("widget",5,"==> QtBlackBox::bbUserFinalizeProcessing()"<<std::endl);
+ bbDestroyWindow();
+ bbtkBlackBoxDebugMessage("widget",5,"<== QtBlackBox::bbUserFinalizeProcessing()"<<std::endl);
}
//==================================================================
+ //==================================================================
+ void QtBlackBox::bbSetWindow(QWidget* w)
+ {
+ bbtkBlackBoxDebugMessage("widget",9,"==> QtBlackBox::bbSetWindow("<<w<<")"<<std::endl);
+ if ((bbmWindow != 0)&&(w!=0))
+ {
+ std::cout << "ERRRRRRRROOOOR"<<std::endl;
+ }
+ bbmWindow = w;
+ }
+ //==================================================================
+
+ //==================================================================
+ void QtBlackBox::bbShowWindow()
+ {
+ if ((bbmWindow) && (!bbIsShown()))
+ {
+ bbtkBlackBoxDebugMessage("widget",3,"==> QtBlackBox::bbShowWindow()"
+ <<std::endl);
+ if (bbGetInputWinDialog())
+ {
+ bbmWindow->updateGeometry();
+ ((QDialog*)bbmWindow)->exec();
+ bbDestroyWindow();
+ }
+ else
+ {
+ bbmWindow->updateGeometry();
+ ((QDialog*)bbmWindow)->exec();
+ bbSetShown(true);
+ }
+ }
+ }
+ //==================================================================
+
+ //==================================================================
+ void QtBlackBox::bbDestroyWindow()
+ {
+ bbtkBlackBoxDebugMessage("widget",3,"==> QtBlackBox::bbDestroyWindow("<<bbmWindow<<")"<<std::endl);
+ if (bbGetWindow()!=NULL)
+ {
+ // wxWindow* w = bbGetWindow();
+ //bbSetWindow(0);
+ // WE SHOULD DESTROY THE WINDOW WITH THE Close METHOD
+ // HOWEVER I
+ //w->Close(true);
+ //
+ delete bbGetWindow();
+ bbSetShown(false);
+ }
+ bbtkBlackBoxDebugMessage("widget",3,"<== QtBlackBox::bbDestroyWindow("<<bbmWindow<<")"<<std::endl);
+
+ }
+ //==================================================================
+
//==================================================================
// void QtBlackBox::InitWindowManagerIfNeeded() { Qt::
void QtBlackBox::IncNbWindowsAlive() { Qt::IncNbWindowsAlive(); }
Program: bbtk
Module: $RCSfile: bbtkQtBlackBox.h,v $
Language: C++
- Date: $Date: 2009/04/08 07:56:11 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2009/05/28 14:22:10 $
+ Version: $Revision: 1.2 $
========================================================================*/
virtual void bbCreateFrameWindow();
//==================================================================
-
+ //==================================================================
+ QWidget* bbGetWindow() { return bbmWindow; }
+ void bbSetWindow(QWidget*) ;
+ bool bbWindowIsCreated() { return (bbGetWindow() != 0); }
+ //==================================================================
+
+
+ //==================================================================
+ virtual void bbShowWindow();
+ //==================================================================
+
+ //==================================================================
+ virtual void bbDestroyWindow();
+ //==================================================================
+
+ private:
+
+ QWidget* bbmWindow;
+
//==================================================================
// virtual void InitWindowManagerIfNeeded();
virtual void IncNbWindowsAlive();
int width, int height)
:
- QtBlackBoxDialogParent(box,parent)
+ QDialog(parent),
+ mBox(box)
// QDialog( parent )
{
- bbtkDebugMessage("qt",9,"QtBlackBoxDialog::QtBlackBoxDialog("<<
- bbGetBlackBox()->bbGetFullName()<<","<<parent<<","
- <<title<<","<<width<<"x"<<height<<")"<<std::endl);
+ bbtkDebugMessage("widget",9,"["<<
+ box->bbGetName()<<"] QtBlackBoxDialog("<<parent<<",\""
+ <<title<<"\","<<width<<"x"<<height<<")"<<std::endl);
+ Qt::IncNbWindowsAlive();
// Sets up the GUI inherited from Ui::bbtkQtblackBoxDialog
setupUi(this);
resize ( width , height );
setWindowTitle(title.c_str());
-
+ ///
+ box->bbSetWindow(this);
// Create the widget
box->bbUserCreateWidget(widget);
}
//=========================================================================
- //=========================================================================
- void QtBlackBoxDialog::bbShow()
- {
- if (bbIsShown()) return;
- bbtkDebugMessage("qt",5,"QtBlackBoxDialog::bbShow() ["
- <<bbGetBlackBox()->bbGetFullName()<<"]"<<std::endl);
- Parent::bbShow();
- updateGeometry();
- exec();
- // Show(false);
- //SetReturnCode( wxDialog::ShowModal() );
- bbDestroy();
- }
- //=========================================================================
-
- //=========================================================================
- void QtBlackBoxDialog::bbHide()
- {
- bbtkDebugMessage("qt",9,"QtBlackBoxDialog::bbHide()"<<std::endl);
- Parent::bbHide();
-
- //Hide();
- }
- //=========================================================================
-
- //=========================================================================
- void QtBlackBoxDialog::bbDestroy()
- {
- bbtkDebugMessage("qt",9,"QtBlackBoxDialog::bbDestroy()"<<std::endl);
- Parent::bbDestroy();
- //wxDialog::Destroy();
-
- }
- //=========================================================================
-
+
//=========================================================================
QtBlackBoxDialog::~QtBlackBoxDialog()
{
+ if (mBox.lock())
+ bbtkDebugMessage("widget",9,"["<<mBox.lock()->bbGetName()
+ <<"] $$$$$$$$$$$$$$$$$$$ ~QtBlackBoxDialog()"
+ <<std::endl);
+ else
+ bbtkDebugMessage("widget",9,"[DEAD] $$$$$$$$$$$$$$$$$$$$$ ~QtBlackBoxDialog()"<<std::endl);
+ //bbtkDebugMessage("widget",9,"WxFrame::~WxFrame()"<<std::endl);
+ if (mBox.lock()) mBox.lock()->bbSetWindow(0);
+ Qt::DecNbWindowsAlive();
}
//=========================================================================
#include "bbtkQtBlackBox.h"
-#include "bbtkWidgetBlackBoxWindow.h"
+
+#include <QDialog>
#include "ui_bbtkQtBlackBoxDialog.h"
-#include "bbtkQtBlackBoxDialogParent.h"
namespace bbtk
{
//=========================================================================
// QtBlackBoxDialog
//=========================================================================
- class QtBlackBoxDialog : public QtBlackBoxDialogParent,
- // WidgetBlackBoxWindow<QWidget>,
- // public QDialog,
+ class QtBlackBoxDialog : public QDialog,
private Ui::bbtkQtBlackBoxDialog
{
Q_OBJECT
public:
- typedef QtBlackBoxDialogParent Parent;
- // typedef WidgetBlackBoxWindow<QWidget> Parent;
- //QtBlackBoxDialog() : Parent(QtBlackBox::Pointer()) {}
QtBlackBoxDialog(QtBlackBox::Pointer box,
QWidget *parent,
const std::string& title,
int width, int height);
~QtBlackBoxDialog();
- void bbShow();
- void bbHide();
- void bbDestroy();
- bool bbIsDialog() { return true; }
+ private:
+ QtBlackBox::WeakPointer mBox;
};
//=========================================================================
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>bbtkQtBlackBoxDialog</class>
- <widget class="QDialog" name="bbtkQtBlackBoxDialog" >
- <property name="geometry" >
+ <widget class="QDialog" name="bbtkQtBlackBoxDialog">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<height>603</height>
</rect>
</property>
- <property name="sizePolicy" >
- <sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>1</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Dialog</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout" >
+ <layout class="QVBoxLayout" name="verticalLayout">
<item>
- <widget class="QWidget" native="1" name="widget" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
+ <widget class="QWidget" name="widget" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>1</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
- <layout class="QHBoxLayout" name="horizontalLayout" />
+ <layout class="QHBoxLayout" name="horizontalLayout"/>
</widget>
</item>
</layout>
Program: bbtk
Module: $RCSfile: bbtkWxBlackBox.cxx,v $
Language: C++
- Date: $Date: 2009/05/28 08:12:06 $
- Version: $Revision: 1.41 $
+ Date: $Date: 2009/05/28 14:22:11 $
+ Version: $Revision: 1.42 $
=========================================================================*/
/* ---------------------------------------------------------------------
void WxBlackBox::bbUserSetDefaultValues()
{
bbtkBlackBoxDebugMessage("widget",5,"WxBlackBox::bbUserSetDefaultValues()"<<std::endl);
- // bbSetWidgetEventHandler(0);
bbmWindow = 0;
}
//=========================================================================
Program: bbtk
Module: $RCSfile: bbqtLayoutLine.cxx,v $
Language: C++
- Date: $Date: 2009/05/14 16:21:19 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2009/05/28 14:22:15 $
+ Version: $Revision: 1.3 $
=========================================================================*/
/* ---------------------------------------------------------------------
// when window is shown
void LayoutLine::OnShowWidget()
{
+ /*
bbUserOnShowWidget("Widget1");
bbUserOnShowWidget("Widget2");
bbUserOnShowWidget("Widget3");
bbUserOnShowWidget("Widget7");
bbUserOnShowWidget("Widget8");
bbUserOnShowWidget("Widget9");
+ */
}
}//namespace bbqt
Program: bbtk
Module: $RCSfile: bbqtLayoutSplit.cxx,v $
Language: C++
- Date: $Date: 2009/05/14 16:21:19 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2009/05/28 14:22:15 $
+ Version: $Revision: 1.3 $
=========================================================================*/
/* ---------------------------------------------------------------------
// when window is shown
void LayoutSplit::OnShowWidget()
{
+ /*
bbUserOnShowWidget("Widget1");
bbUserOnShowWidget("Widget2");
bbUserOnShowWidget("Widget3");
bbUserOnShowWidget("Widget7");
bbUserOnShowWidget("Widget8");
bbUserOnShowWidget("Widget9");
+ */
}