#-----------------------------------------------------------------------------
# The samples
+
+#----JFGA ---- Por default.
+SET(USE_WT OFF)
+
+
# WARNING
# Install the creaTools first
# then build the 'samples' as a separate project
TARGET_LINK_LIBRARIES(bbi bbtk)
INSTALL_TARGETS(/bin/ bbi)
+
+SET(SOURCES
+ bbiWeb
+ )
+
+ADD_EXECUTABLE(bbiWeb.wt MACOSX_BUNDLE ${SOURCES})
+TARGET_LINK_LIBRARIES(bbiWeb.wt bbtk)
+INSTALL_TARGETS(/bin/ bbiWeb.wt)
+
+
+
+
debug = ( parser.Found(_T("d")) );
quiet = ( parser.Found(_T("q")) );
help = ( parser.Found(_T("h")) );
- graphical_dialog = ( parser.Found(_T("g")) );
+ graphical_dialog = ( parser.Found(_T("wxcommandlineg")) );
text_dialog = ( parser.Found(_T("t")) );
no_console = ( parser.Found(_T("N")) );
// main frame
bool wxBBIApp::OnInit( )
{
+//Borrame
+//FILE *ff; ff = fopen ("/tmp/wt.log","a+"); fprintf(ff,"EED wxBBIApp::OnInit\n"); fclose(ff);
+
// std::cout << "OnInit"<<std::endl;
wxApp::OnInit();
#ifdef __WXGTK__
if (cmd.debug) bbtk::MessageManager::SetMessageLevel("all",9);
+//Borrame
+//printf ("EED bbi wxBBIApp::OnInit .....................\n");
+//cmd.input_file.push_back("/home/davila/Borrame/testwt.bbs");
+
+
bbtk::WxGUIConsole *I = new bbtk::WxGUIConsole(0,_T("bbi"),wxSize(800,600));
SetTopWindow(I);
if (cmd.console) I->Show(true);
I->SetInputs(cmd.param_map);
bool help_on_script = cmd.help && (cmd.input_file.size() > 0);
- if (help_on_script) I->SetNoExecMode(true);
- if (cmd.graphical_dialog) I->SetDialogMode(bbtk::VirtualExec::GraphicalDialog);
- if (cmd.text_dialog) I->SetDialogMode(bbtk::VirtualExec::TextDialog);
+ if (help_on_script) I->SetNoExecMode(true);
+ if (cmd.graphical_dialog) I->SetDialogMode(bbtk::VirtualExec::GraphicalDialog);
+ if (cmd.text_dialog) I->SetDialogMode(bbtk::VirtualExec::TextDialog);
std::vector<std::string>::const_iterator i;
bool error = false;
// you need to use the linker option "/subsystem:console" and the following code:
int main(int argc, char* argv[])
{
+
+//Borrame
+//FILE *ff; ff = fopen ("/tmp/wt.log","a+"); fprintf(ff,"EED main C\n"); fclose(ff);
+
return WinMain(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), SW_SHOWNORMAL);
}
int main(int argc, char* argv[])
{
+
+//Borrame
+//FILE *ff; ff = fopen ("/tmp/wt.log","a+"); fprintf(ff,"EED main A\n"); fclose(ff);
+
wxMessageOutput::Set( new wxMessageOutputBest );
wxCmdLineParser parser(cmdLineDesc,argc,argv);
std::cout << "BBI (Black Box Interpreter) - bbtk "
<< bbtk::GetVersion()<< " - (c) Creatis 2007"
<< std::endl;
+//Borrame
+//FILE *ff; ff = fopen ("/tmp/wt.log","a+"); fprintf(ff,"EED main B\n"); fclose(ff);
bbtk::Interpreter::Pointer I = bbtk::Interpreter::New();
if (argc==1)
--- /dev/null
+/*
+# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+# pour la Santé)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+# Previous Authors : Laurent Guigues, Jean-Pierre Roux
+# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+#
+# This software is governed by the CeCILL-B license under French law and
+# abiding by the rules of distribution of free software. You can use,
+# modify and/ or redistribute the software under the terms of the CeCILL-B
+# license as circulated by CEA, CNRS and INRIA at the following URL
+# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+# or in the file LICENSE.txt.
+#
+# As a counterpart to the access to the source code and rights to copy,
+# modify and redistribute granted by the license, users are provided only
+# with a limited warranty and the software's author, the holder of the
+# economic rights, and the successive licensors have only limited
+# liability.
+#
+# The fact that you are presently reading this means that you have had
+# knowledge of the CeCILL-B license and that you accept its terms.
+# ------------------------------------------------------------------------
+*/
+
+
+#include <stdio.h>
+
+
+//=========================================================================
+#include <bbtkInterpreter.h>
+#include <wx/cmdline.h>
+#include "bbtkWtBlackBox.h"
+
+int main(int argc, char* argv[])
+{
+
+ printf("bbiWeb...A argc=%d \n",argc);
+
+//bbtk::MessageManager::SetMessageLevel("all",9);
+printf("bbiWeb: [0]: %s \n",argv[0]);
+printf("bbiWeb: [1]: %s \n",argv[1]);
+printf("bbiWeb: [2]: %s \n",argv[2]);
+printf("bbiWeb: [3]: %s \n",argv[3]);
+printf("bbiWeb: [4]: %s \n",argv[4]);
+ printf("bbiWeb...B\n");
+
+
+ bbtk::WtBlackBox::wtServerData::argc = argc;
+ bbtk::WtBlackBox::wtServerData::argv = argv;
+
+
+
+//Borrame
+//FILE *ff; ff = fopen ("/tmp/bbi.wt.log","a+"); fprintf(ff,"EED main bbiWeb\n"); fclose(ff);
+
+
+ bbtk::Interpreter::Pointer I = bbtk::Interpreter::New();
+ printf("bbiWeb...C\n");
+
+ std::string fileName = argv[0];
+ std::size_t pos = fileName.find("_");
+ fileName = fileName.substr (pos+1);
+ pos = fileName.find(".wt");
+ fileName = fileName.erase (pos);
+ fileName = "bbs/"+fileName;
+
+printf("bbiWeb fileName %s\n", fileName.c_str() );
+// std::string fileName("/var/www/testwtdbg/docroot/.bbtk/tmp/demoPresentacion1Boton02.bbs");
+
+
+
+
+ printf("bbiWeb...D\n");
+ I->InterpretFile(fileName);
+ printf("bbiWeb...E\n");
+
+ return 0;
+}
ADD_CUSTOM_COMMAND(
OUTPUT ${BBFY_CXX_OUT}
COMMAND
- export LD_LIBRARY_PATH=${LD_LIBRARY_PATH} && ${BBTK_BBFY} ${xmlfile} ${BBTK_PACKAGE_NAME} ${CMAKE_CURRENT_BINARY_DIR}/ -q
+ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH} && echo $ENV{LD_LIBRARY_PATH} && ${BBTK_BBFY} ${xmlfile} ${BBTK_PACKAGE_NAME} ${CMAKE_CURRENT_BINARY_DIR}/ -q
DEPENDS ${xmlfile}
${BBTK_BBFY_DEPENDENCY}
)
)
SET(SOURCES ${SOURCES} ${MOC_SOURCES} ${UI_SOURCES})
ENDIF(QT_FOUND)
+
+# JFGA 03/12/2014 -- Temporal configuration of WT
+# *********Missing if conditional Wt********
+ #find_package(Boost COMPONENTS system thread signals)
+ #find_library(wt wt)
+ #find_library(wtext wtext)
+ #find_library(wthttp wthttp)
+ INCLUDE_DIRECTORIES(/usr/local/lib/)
+
+
ENDIF(BBTK_USE_QT)
#-----------------------------------------------------------------------------
# lib definition
ADD_LIBRARY(bbtk SHARED ${SOURCES} ${SOURCES_H})
#-----------------------------------------------------------------------------
-TARGET_LINK_LIBRARIES(bbtk ${BBTK_LINK_LIBRARIES} ${BOOST_LIBRARIES} ${crea_LIBRARIES})
+TARGET_LINK_LIBRARIES(bbtk ${BBTK_LINK_LIBRARIES} ${BOOST_LIBRARIES} ${crea_LIBRARIES} ${WT_LIBRARIES})
#-----------------------------------------------------------------------------
IF(UNIX)
SET_TARGET_PROPERTIES(bbtk PROPERTIES COMPILE_FLAGS -Wall)
}
*/
+
OutputConnectorMapType::const_iterator o;
for ( o = bbGetOutputConnectorMap().begin();
o != bbGetOutputConnectorMap().end(); ++o )
- {
- if (o->second->GetStatus()==UPTODATE)
+ {
+
+
+ if (o->first=="BoxChange")
+ {
+ o->second->SetStatus(UPTODATE);
+ }
+
+
+
+//EED 24/08/2015
+// EED CASPITAS 2
+ if (o->second->GetStatus()==UPTODATE)
+// if ((o->second->GetStatus()==UPTODATE) || (o->second->GetStatus()==OUTOFDATE))
+// if ((o->second->GetStatus()==UPTODATE) || (o->second->GetStatus()==MODIFIED))
{
o->second->SetStatus(OUTOFDATE);
o->second->SignalChange(GetThisPointer<BlackBox>(),o->first);
- }
- }
+ } // if
+ } // for
+
if ( ( bbBoxProcessModeIsReactive()
|| (c==bbGetInputConnectorMap().find("BoxExecute")->second))
&& (bbCanReact() ) )
bbtkBlackBoxDebugMessage("change",2,
"-> Execution triggered by Reactive mode or BoxExecute input change"<<std::endl);
bbGlobalAddToExecutionList( GetThisPointer<BlackBox>() );
- }
+ } // if
bbtkBlackBoxDebugMessage("change",5,
"<= BlackBox::bbSetStatusAndPropagate(input)"
<<std::endl);
//=========================================================================
void BlackBox::bbRecursiveExecute( Connection::Pointer caller )
{
+
bbtkBlackBoxDebugMessage("process",3,
"=> BlackBox::bbRecursiveExecute("
<<(caller?caller->GetFullName():"0")<<")"
IOStatus s=UPTODATE;
// IOStatus s=OUTOFDATE;
// IOStatus s=MODIFIED;
-
-
+
+
if ( ( bbBoxProcessModeIsManual()==false ) ||
( (bbBoxProcessModeIsManual()==true) && (bbLetRecursiveExecuteManualMode==true) ) )
{
bbSetExecuting(false);
bbGlobalSetSomeBoxExecuting(wasExecuting);
+
return;
}
//=========================================================================
<<std::endl);
bbmgGlobalProcessingExecutionList = false;
+
}
//=========================================================================
#include "bbtkUtilities.h"
#include "bbtkAtomicBlackBoxDescriptor.h"
#include "bbtkWxBlackBox.h"
+// JFGA 12/12/2014 Adding libraries for Wt
+//#include "bbtkWtBlackBox.h"
namespace bbtk
{
std::string usercol("#FFFFFF");
std::string ubbcol("#DDFFFF");
std::string wxbbcol("#EEFFFF");
-
+// JFGA 12/12/2014 Adding new variable
+// std::string wtbbcol("#CCFFFF");
// (s) << "<h3 class=\"subsection\">Inputs</h3>\n";
(s) << "<p><TABLE border=1 cellspacing=0 cellpadding=3>\n";
IOStatus mStatus;
/// The output changed signal
BlackBox::OutputChangeSignalType mChangeSignal;
-
-
};
//========================================================================
// ==> Set system paths
mBin_path = Utilities::GetExecutablePath();
+
/* EED 23 Mars 2009
#ifdef MACOSX
mInstall_path = mBin_path + "/../../../..";
}
#endif
+
///\TODO : better use ??
mInstall_path = mBin_path + "/..";
if (!Utilities::FileExists(mDot_bbtk_path)) mDot_bbtk_is_new = true;
Utilities::CreateDirectoryIfNeeded(mDot_bbtk_path);
+
mDoc_path = Utilities::MakeUserSettingsFullFileName("doc");
Utilities::CreateDirectoryIfNeeded(mDoc_path);
mTemp_path = Utilities::MakeUserSettingsFullFileName("tmp");
Utilities::CreateDirectoryIfNeeded(mTemp_path);
+
}
//=========================================================================
strcpy(bbtk_path, Utilities::GetExecutablePath().c_str()); // JPR
//strcpy(bbtk_path, "/usr/local/bin");
+
+ std::string str_home=Utilities::GetEnvHome();
+
+
// rootDirectory
char rootDirectory[200];
- sprintf( rootDirectory, "%s/.bbtk", getenv("HOME"));
+ sprintf( rootDirectory, "%s/.bbtk", str_home.c_str());
// configPath
char configPath[200];
}
- mFrom = from;
- mOriginalFrom = from;
- mTo = to;
- mOriginalTo = to;
- mInput = mOriginalInput = input;
- mOutput = mOriginalOutput = output;
+ mFrom = from;
+ mOriginalFrom = from;
+ mTo = to;
+ mOriginalTo = to;
+ mInput = mOriginalInput = input;
+ mOutput = mOriginalOutput = output;
// Lock this pointer !!!
//Pointer p = MakePointer(this,true);
#if(USE_WXWIDGETS)
Wx::ProcessPendingEvents();
#endif
+
// Create user package
Package::Pointer p =
bbtkDebugDecTab("kernel",9);
}
- //===================================================================
-// ups3 EED borrame
+ //===================================================================
std::string Factory::GetPackageNameOfaBlackBox(std::string boxType)
{
- std::string result="<void bbtk package name>";
+ std::string packageName="<void bbtk package name>";
PackageMapType::const_iterator i;
- for (i = mPackageMap.begin(); i!=mPackageMap.end(); ++i )
- {
- if ( i->second->ifBoxExist( boxType ) == true)
+
+ std::size_t found = boxType.find(":");
+ if (found!=std::string::npos)
+ {
+ packageName = boxType.substr(0,found);
+ } else {
+ for (i = mPackageMap.begin(); i!=mPackageMap.end(); ++i )
{
- result = i->first;
- }
- }
- return result;
+ if ( i->second->ifBoxExist( boxType ) == true)
+ {
+ packageName = i->first;
+ } // if ifBoxExist
+ } // for i
+
+ } // if found
+ return packageName;
}
+
+ //===================================================================
+ std::string Factory::GetTypeNameOfaBlackBox(std::string boxType)
+ {
+ std::string typeName="<void bbtk type name>";
+
+ std::size_t found = boxType.find(":");
+ if (found!=std::string::npos)
+ {
+ typeName = boxType.substr(found+1);
+ } else {
+ typeName=boxType;
+ } // if found
+ return typeName;
+ }
+
+
//===================================================================
BlackBox::Pointer Factory::NewBlackBox(const std::string& type,
const std::string& name) const
{
- bbtkDebugMessageInc("kernel",7,"Factory::NewBlackBox(\""
+ bbtkDebugMessageInc("kernel",7,"Factory::NewBlackBox(\""
<<type<<"\",\""<<name<<"\")"<<std::endl);
BlackBox::Pointer b;
PackageMapType::const_iterator i;
- for (i = mPackageMap.begin(); i!=mPackageMap.end(); ++i )
- {
- b = i->second->NewBlackBox(type,name);
- if (b) break;
- }
+
+ std::string tmp = type;
+ std::string packageName = ((bbtk::Factory*)this)->GetPackageNameOfaBlackBox(tmp);
+ std::string type2 = ((bbtk::Factory*)this)->GetTypeNameOfaBlackBox(tmp);
+ i = mPackageMap.find(packageName);
+ if (i != mPackageMap.end())
+ {
+ b = i->second->NewBlackBox(type2,name);
+ } else {
+ b =BlackBox::Pointer();
+ }
+
+/*
+ std::size_t found = type.find(":");
+ if (found!=std::string::npos)
+ {
+ std::string packageName = type.substr(0,found);
+ std::string type2 = type.substr(found+1);
+ i = mPackageMap.find(packageName);
+ if (i != mPackageMap.end())
+ {
+ b = i->second->NewBlackBox(type2,name);
+ } else {
+ b =BlackBox::Pointer();
+ }
+ } else {
+ for (i = mPackageMap.begin(); i!=mPackageMap.end(); ++i )
+ {
+ b = i->second->NewBlackBox(type,name);
+ if (b) break;
+ } // for i
+
+ } // if found :
+*/
+
+
if (!b)
- {
- bbtkError("black box type \""<<type<<"\" unknown");
- }
+ {
+ bbtkError("black box type \""<<type<<"\" unknown");
+ } // if !b
+
bbtkDebugDecTab("kernel",7);
return b;
/// Gets the executer who created the factory (if any) - const
// const Executer::Pointer GetExecuter() const { return mExecuter.lock(); }
- std::string GetPackageNameOfaBlackBox(std::string boxType);
+ std::string GetPackageNameOfaBlackBox(std::string boxType);
+ std::string GetTypeNameOfaBlackBox(std::string boxType);
private:
+
/// The map of packages
PackageMapType mPackageMap;
void CloseAllPackages();
void ClosePackage(PackageMapType::iterator& i);
+
+
};
// class Factory
( d->GetCreatorTypeInfo() == typeid(WxBlackBoxDescriptor)) )
continue;
#else
+// JFGA 12/12/2014 Adding WT options for compile with it.
+
+/*#if USE_WT
+
+ if ( ( d->GetCreatorTypeInfo() == typeid(AtomicBlackBoxDescriptor)) ||
+ ( d->GetCreatorTypeInfo() == typeid(WtBlackBoxDescriptor)) )
+ continue;
+
+
+#else
+*/
if ( ( d->GetCreatorTypeInfo() == typeid(AtomicBlackBoxDescriptor)) )
continue;
+//#endif
+
#endif
bool widok = true;
std::string widget,adaptor;
*/
-
}
//=======================================================================
//=======================================================================
void InterpreterVirtual::DoInterpretLine( const std::string& line )
- {
-
+ {
bbtkDebugMessage("interpreter",6,"==> InterpreterVirtual::DoInterpretLine(\""
<<line<<"\")"<<std::endl);
std::vector<std::string> words;
bbtkDebugMessage("interpreter",6,"<== InterpreterVirtual::DoInterpretLine(\""
<<line<<"\")"<<std::endl);
-
+
}
//=======================================================================
for (i=script_paths.begin();i!=script_paths.end();i++)
{
-printf("EED InterpreterVirtual::SwitchToFile jaja >> %s\n", (*i).c_str() );
+printf("EED InterpreterVirtual::SwitchToFile (1) >> %s\n", (*i).c_str() );
bbtkMessage("interpreter",1,
"--> Looking in '" << *i << "'" << std::endl);
j!= Filenames.end(); ++j)
{
-printf("EED InterpreterVirtual::SwitchToFile kkkkk >> %s\n", (*j).c_str() );
+printf("EED InterpreterVirtual::SwitchToFile (2) >> %s\n", (*j).c_str() );
int lgr = (*j).size();
if (lgr < 5) continue;
mDescription(description),
mVersion(version)
{
+
bbtkDebugMessage("object",2,"==> Package('"<<name<<"',...)"
<<bbtkendl);
+
std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
char c = default_doc_dir.c_str()[strlen(default_doc_dir.c_str())-1];
std::string url = default_doc_dir;
/// Returns the user settings dir, e.g. /home/username/.bbtk
std::string Utilities::GetUserSettingsDir()
{
-#if defined(__GNUC__)
- std::string str_home(getenv("HOME"));
-#elif defined(_WIN32)
- std::string str_home(getenv("USERPROFILE"));
-#endif
- std::string fullname = str_home + "/.bbtk";
+ std::string str_Home=Utilities::GetEnvHome();
+ std::string fullname = str_Home + "/.bbtk";
MakeValidFileName(fullname);
return fullname;
}
/// in user settings dir, e.g. /home/username/.bbtk/
std::string Utilities::MakeUserSettingsFullFileName(const std::string& name)
{
-#if defined(__GNUC__)
- std::string str_home(getenv("HOME"));
-#elif defined(_WIN32)
- std::string str_home(getenv("USERPROFILE"));
-#endif
+ std::string str_home=Utilities::GetEnvHome();
std::string fullname = str_home + "/.bbtk/" + name;
MakeValidFileName(fullname);
return fullname;
}
//=========================================================================
+
+std::string Utilities::GetEnvHome()
+{
+#if defined(__GNUC__)
+ std::string strHome;
+ char *envHome=getenv("HOME");
+ if (envHome!=NULL)
+ {
+ strHome=envHome;
+ } else {
+ strHome = "/var/www/testwtdbg/docroot";
+ } // if
+#elif defined(_WIN32)
+ std::string strHome( getenv("USERPROFILE") );
+#endif
+ return strHome;
+}
+
+
+
//TAD Arbol CFT
static bool loosematch(std::string stdLine,std::string stdOptions);
-
+
+ static std::string GetEnvHome();
};
--- /dev/null
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ # pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ # This software is governed by the CeCILL-B license under French law and
+ # abiding by the rules of distribution of free software. You can use,
+ # modify and/ or redistribute the software under the terms of the CeCILL-B
+ # license as circulated by CEA, CNRS and INRIA at the following URL
+ # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ # or in the file LICENSE.txt.
+ #
+ # As a counterpart to the access to the source code and rights to copy,
+ # modify and redistribute granted by the license, users are provided only
+ # with a limited warranty and the software's author, the holder of the
+ # economic rights, and the successive licensors have only limited
+ # liability.
+ #
+ # The fact that you are presently reading this means that you have had
+ # knowledge of the CeCILL-B license and that you accept its
+ terms.
+ # ------------------------------------------------------------------------ */
+
+
+/*=========================================================================
+ Program: bbtk
+ Module: $RCSfile: bbtkQt.cxx,v $
+ Language: C++
+ Date: $Date: 2012/11/16 08:49:01 $
+ Version: $Revision: 1.4 $
+=========================================================================*/
+
+
+#include "bbtkWt.h"
+#include "bbtkMessageManager.h"
+
+#ifdef USE_WT
+
+
+
+
+namespace bbtk
+{
+ //=========================================================================
+ class WtApp;
+ Wt::WApplication *createApplication(const Wt::WEnvironment& env);
+ //=========================================================================
+
+ //=========================================================================
+ static WtApp* mgWtApp = 0;
+ static Wt::WContainerWidget* mgTopWindow = 0;
+ static int mgNbWindowsAlive = 0;
+ //=========================================================================
+
+ //=========================================================================
+ // BBTKWXSIG
+ static WWt::Signal_type mgWtSignal;
+ // \BBTKWXSIG
+ //=========================================================================
+
+
+ //=========================================================================
+ // The wxApp class which is used when no user wxApp was created
+ // The application creates itself completly empty.
+// The default values for the port and address are port:8080 address 0.0.0.0
+ class WtApp : public Wt::WApplication
+ {
+ public:
+ WtApp(const Wt::WEnvironment& env);
+ ~WtApp();
+ static int WtWRun();
+ //WtWApplication *createApplication(const WtWEnvironment& env);
+
+ };
+
+ WtApp::WtApp(const Wt::WEnvironment& env):
+ Wt::WApplication(env)
+ {
+ //root()->addWidget(WWt::GetTopWindow());
+ // There is not additional configuration. The new WtApp must have the same behavior that one Wt::WApplication.
+
+ }
+
+ WtApp::~WtApp()
+ {
+
+ }
+/*
+ int WtApp::WtWRun()
+ {
+ char *argv[7] = {"./WtTest","--docroot",".","--http-address","0.0.0.0","--http-port","8080"};
+ int argc = 7;
+ return Wt::WRun(argc,argv,&createApplication);
+ }
+
+
+ Wt::WApplication *createApplication(const Wt::WEnvironment& env)
+ {
+ return new WtApp(env);
+ }
+*/
+
+
+
+ //=========================================================================
+
+ //=========================================================================
+ void WWt::CreateWtAppIfNeeded()
+ {
+ std::cout<<"CREATING APP IF NEEDED --------- DELETE ME ------- bbtkWt.cxx"<<std::endl;
+ if(Wt::WApplication::instance()==0)
+ {
+ if (mgWtApp != 0)
+ {
+ bbtkGlobalError("Wt::CreateWtAppIfNeeded() : INTERNAL ERROR ! (Wt::WApplication::instance()==0) && (mgWtApp != 0)");
+ }
+ bbtkDebugMessage("wt",1," --> Creating bbtk WtApp"<<std::endl);
+ //WtApp::WtWRun();
+ }
+ bbtkDebugMessage("process",2,"Create WtApp If needed debuging");
+ }
+ //=========================================================================
+
+ //=========================================================================
+ void WWt::DestroyWtAppIfNeeded()
+ {
+ if (mgWtApp!= 0)
+ {
+ // bbtkDebugMessage("wx",1," --> Destructing bbtk WxApp"<<std::endl);
+ //delete mgWxApp;
+ // mgWxApp = 0;
+ // Uninit wx
+ // wxUninitialize();
+ }
+ }
+ //=========================================================================
+
+
+ //=========================================================================
+ void WWt::ProcessPendingEvents()
+ {
+ /*
+ if (Wx::GetTopWindow() != 0)
+ {
+ Wx::GetTopWindow()->DestroyChildren();
+ }
+ */
+
+ /*
+ wxApp* a = (wxApp*)wxApp::GetInstance();
+ if (a==0) return;
+
+ std::cout << "$$$$$$$$$$$$$$ PROCESS PENDING "<<std::endl;
+ while (a->Pending())
+ a->Dispatch();
+ std::cout << "$$$$$$$$$$$$$$ PROCESS PENDING DONE"<<std::endl;
+ */
+ }
+
+
+ //=========================================================================
+ Wt::WContainerWidget* WWt::GetTopWindow()
+ {
+ return mgTopWindow;
+ }
+ //=========================================================================
+
+
+ // BBTKWXSIG
+ //=========================================================================
+ void WWt::AddSignalObserver(Slot_function_type f)
+ {
+ mgWtSignal.connect(f);
+ }
+ //=========================================================================
+ // \BBTKWXSIG
+
+
+ //=========================================================================
+ void WWt::SetTopWindow(Wt::WContainerWidget* w)
+ {
+ if ( mgTopWindow )
+ {
+ bbtkGlobalError("Wt::SetTopWindow : top window already set !");
+ }
+ //mgTopWindow = w;
+ }
+ //=========================================================================
+
+
+ //=========================================================================
+ void WWt::IncNbWindowsAlive()
+ {
+ mgNbWindowsAlive++;
+ bbtkDebugMessage("wt",2,"* Number of windows alive = "<<mgNbWindowsAlive
+ <<std::endl);
+ // BBTKWXSIG
+ mgWtSignal();
+ // \BBTKWXSIG
+ }
+ //=========================================================================
+
+ //=========================================================================
+ void WWt::DecNbWindowsAlive()
+ {
+ mgNbWindowsAlive--;
+ bbtkDebugMessage("wt",2,"* Number of windows alive = "<<mgNbWindowsAlive
+ <<std::endl);
+
+ // BBTKWXSIG
+ mgWtSignal();
+ // \BBTKWXSIG
+ }
+ //=========================================================================
+
+ //=========================================================================
+ int WWt::GetNbWindowsAlive()
+ {
+ return mgNbWindowsAlive;
+ }
+ //=========================================================================
+
+ //=========================================================================
+ bool WWt::IsSomeWindowAlive()
+ {
+ return (mgNbWindowsAlive!=0);
+ }
+ //=========================================================================
+
+
+ //=========================================================================
+ WWt::BusyCursor::BusyCursor()
+ {
+ // mCursor = 0;
+ if (Wt::WApplication::instance()!=0)
+ {
+ bbtkDebugMessage("wt",2,
+ "Wt::BusyCursor::BusyCursor() : creating new cursor"
+ <<std::endl);
+ //mCursor = new wxBusyCursor;
+ }
+ }
+ //=========================================================================
+ //=========================================================================
+ WWt::BusyCursor::~BusyCursor()
+ {
+ // if (mCursor)
+ // {
+ //delete mCursor;
+ //bbtkDebugMessage("wt",2,
+ // "Wt::BusyCursor::~BusyCursor() : deleting cursor"<<std::endl);
+ //}
+ }
+ //=========================================================================
+
+
+
+} // namespace bbtk
+
+#else
+//=======================================================================
+// WITHOUT WX
+//=========================================================================
+namespace bbtk
+{
+ //=========================================================================
+ WWt::BusyCursor::BusyCursor()
+ {
+ }
+ WWt::BusyCursor::~BusyCursor()
+ {
+ }
+ //=========================================================================
+
+} // namespace bbtk
+#endif
+
+
--- /dev/null
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ # pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ # This software is governed by the CeCILL-B license under French law and
+ # abiding by the rules of distribution of free software. You can use,
+ # modify and/ or redistribute the software under the terms of the CeCILL-B
+ # license as circulated by CEA, CNRS and INRIA at the following URL
+ # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ # or in the file LICENSE.txt.
+ #
+ # As a counterpart to the access to the source code and rights to copy,
+ # modify and redistribute granted by the license, users are provided only
+ # with a limited warranty and the software's author, the holder of the
+ # economic rights, and the successive licensors have only limited
+ # liability.
+ #
+ # The fact that you are presently reading this means that you have had
+ # knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+/*=========================================================================
+ Program: bbtk
+ Module: $RCSfile: bbtkQt.h,v $
+ Language: C++
+ Date: $Date: 2012/11/16 08:49:01 $
+ Version: $Revision: 1.3 $
+=========================================================================*/
+
+
+
+#ifndef __bbtkWt_h_INCLUDED__
+#define __bbtkWt_h_INCLUDED__
+
+//===========================================================================
+// SIGNAL/SLOT MECHANISM
+// FOR bbtk WINDOWS CREATION/DESTRUCTION OBSERVATION
+// BBTKWXSIG
+#include <boost/signal.hpp>
+#include <boost/bind.hpp>
+
+
+//TODO Include libs in the CMake escription
+#include <Wt/WApplication>
+#include <Wt/WEnvironment>
+#include <Wt/WContainerWidget>
+#include <Wt/WWidget>
+#include <Wt/WCheckBox>
+#include <Wt/WServer>
+#include <Wt/WText>
+#include <Wt/WPushButton>
+#include <Wt/WSlider>
+#include <Wt/WHBoxLayout>
+#include <Wt/WVBoxLayout>
+#include <Wt/WBorderLayout>
+#include <Wt/WLineEdit>
+#include <Wt/WComboBox>
+#include <Wt/WSelectionBox>
+#include <Wt/WGroupBox>
+#include <Wt/WRadioButton>
+#include <Wt/WButtonGroup>
+#include <Wt/WLayout>
+#include <Wt/WHBoxLayout>
+#include <Wt/WVBoxLayout>
+#include <Wt/WRadioButton>
+#include <Wt/Ext/Splitter>
+#include <Wt/WTabWidget>
+#include <Wt/WFileUpload>
+#include <Wt/WLength>
+
+//typedef boost::signals::trackable SignalObserver;
+// \BBTKWXSIG
+//===========================================================================
+
+
+//===========================================================================
+// Qt headers
+// DEFINIR LOS HEADERS Wt que se necesitan *-*-*-*-*-*-*-*-*-*
+/*
+#ifdef USE_WT
+#include "qwidget.h"
+// EO Qt headers
+
+#else //USE_QT
+
+// define QWidget
+typedef void QWidget;
+typedef void QBusyCursor;
+
+#endif // EO USE_WXWIDGETS
+
+//-*-*-*-* JFGA
+
+*/
+#ifdef USE_WT
+
+
+// Definition of some classes used in tehe code
+typedef Wt::WEnvironment WtWEnvironment;
+typedef Wt::WWidget WtWWidget;
+//typedef Wt::WContainerWidget WtWContainerWidget;
+typedef Wt::WApplication WtWApplication;
+typedef Wt::WString WtWString;
+
+
+
+#else // EO_USE_WT
+
+
+typedef void WtWidget;
+typedef void WtWContainerWidget;
+typedef void WtWApplication;
+typedef void WtBusyCursor;
+
+#endif // EO USE_WT
+
+
+//==========================================================================
+
+//===========================================================================
+#include "bbtkSystem.h"
+//===========================================================================
+
+
+
+
+
+namespace bbtk
+{
+
+ //==================================================================
+ /// Global wt handlers (cursor...)
+
+
+// BBTKWXSIG BBTK_ADD_BLACK_BOX_TO_PACKAGE(MyProjectWT,Testing)
+
+#define bbtkAddWtSignalObserver(METHOD) \
+ WWt::AddSignalObserver(boost::bind(&METHOD, this))
+// \BBTKWXSIG
+
+#define BBTK_BUSY_CURSOR bbtk::WWt::BusyCursor __bbtk_dummy_busy_cursor;
+
+ struct BBTK_EXPORT WWt
+ {
+ public:
+ // BBTKWXSIG
+ // The keyword 'signals' is also a macro in qt
+ // typedef boost::signals::trackable SignalObserver;
+ typedef boost::signals::trackable SignalObserver;
+ typedef boost::signal<void ()> Signal_type;
+ typedef Signal_type::slot_function_type Slot_function_type;
+ // \BBTKWXSIG
+
+ /*
+ static void ResetCursor();
+ static void BeginBusyCursor();
+ static void EndBusyCursor();
+ */
+
+ static void LoopUntilAllWindowsClose();
+
+ class BusyCursor
+ {
+ public:
+ BusyCursor();
+ ~BusyCursor();
+ //wxBusyCursor* mCursor; The wxBusyCursor is only for comunicate to the client/user that the program is busy.
+ };
+
+
+ static void ProcessPendingEvents();
+ /// Sets the parent of all bbtk windows
+ static void SetTopWindow(Wt::WContainerWidget*);
+ /// Returns the parent of all bbtk windows
+ static Wt::WContainerWidget* GetTopWindow();
+
+
+ static void IncNbWindowsAlive();
+ static void DecNbWindowsAlive();
+ static int GetNbWindowsAlive();
+ static bool IsSomeWindowAlive();
+
+
+ // BBTKWXSIG
+ static void AddSignalObserver(Slot_function_type);
+ // \BBTKWXSIG
+
+
+
+
+ //private:
+ static void CreateWtAppIfNeeded();
+ static void DestroyWtAppIfNeeded();
+
+ }; // struct Wt
+ //==================================================================
+
+#ifdef USE_WT
+
+
+ static std::string jScript;
+ //==================================================================
+ /// Conversion std::string to wxString
+ inline Wt::WString std2wt(const std::string& s)
+ {
+ // Wt::WString wt;
+/*
+ const char* my_string=s.c_str();
+ wxMBConvUTF8 *wxconv= new wxMBConvUTF8();
+ wx=wxString(wxconv->cMB2WC(my_string),wxConvUTF8);
+ delete wxconv;
+ // test if conversion works of not. In case it fails convert from Ascii
+ if(wx.length()==0)
+ wx=wxString(wxString::FromAscii(s.c_str()));
+*/
+ return Wt::WString::fromUTF8(s,false);
+ //return new Wt::WString(s);//wt;
+ }
+ //==================================================================
+
+ //==================================================================
+ /// Conversion wxString to std::string
+ inline std::string wt2std(const Wt::WString& s){
+ /* std::string s2;
+ if(s.wxString::IsAscii()) {
+ s2=s.wxString::ToAscii();
+ } else {
+ const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(s);
+ const char *tmp_str = (const char*) tmp_buf;
+ s2=std::string(tmp_str, strlen(tmp_str));
+ }
+
+ return s2;*/
+ return s.toUTF8();
+ }
+ //==================================================================
+#endif // EO _USE_WXWIDGETS
+
+
+
+
+
+} // namespace bbtk
+
+
+#endif // EO __bbtkWt_h_INCLUDED__
--- /dev/null
+
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ # pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ # This software is governed by the CeCILL-B license under French law and
+ # abiding by the rules of distribution of free software. You can use,
+ # modify and/ or redistribute the software under the terms of the CeCILL-B
+ # license as circulated by CEA, CNRS and INRIA at the following URL
+ # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ # or in the file LICENSE.txt.
+ #
+ # As a counterpart to the access to the source code and rights to copy,
+ # modify and redistribute granted by the license, users are provided only
+ # with a limited warranty and the software's author, the holder of the
+ # economic rights, and the successive licensors have only limited
+ # liability.
+ #
+ # The fact that you are presently reading this means that you have had
+ # knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+/*=========================================================================
+ Program: bbtk
+ Module: $RCSfile: bbtkWxBlackBox.cxx,v $
+ Language: C++
+ Date: $Date: 2012/11/16 08:49:01 $
+ Version: $Revision: 1.45 $
+=========================================================================*/
+
+
+
+#ifdef _USE_WT_
+
+/**
+ * \file
+ * \brief
+ */
+
+#include "bbtkWtBlackBox.h"
+#include "bbtkBlackBoxOutputConnector.h"
+
+
+//#include "bbtkWxContainerBlackBox.h"
+//#include <wx/dialog.h>
+
+//#include "bbtkData.h"
+//#include "bbtkFactory.h"
+
+
+
+
+namespace bbtk
+{
+
+
+/*
+ class jScript
+ {
+ public:
+ jScript();
+ std::string jScriptLine;
+ };
+*/
+ //=========================================================================
+ // wtData structure
+ //=========================================================================
+
+ // For the very first contruction of the application
+/* struct wtServerData
+ {
+ std::string docRoot;
+ std::string port;
+ std::string address;
+
+ };
+ */
+ struct wtData
+ {
+ Wt::WContainerWidget *parent;
+ WtBlackBox::Pointer b;
+ WtBlackBox *pbox;
+ Wt::WString title;
+ };
+
+/* jScript::jScript()
+ {
+ jScriptLine = "";
+ }
+*/
+// static bbtk::jScript* js = new bbtk::jScript();
+ static wtData myWtData;
+// static wtServerData loadedJS;
+ //static std::string* jss;
+
+
+
+ //=========================================================================
+ // javaScript Line
+ //=========================================================================
+ //Contains all the JS statements needed for the bbwt.
+
+ //=========================================================================
+ // WxFrame
+ //=========================================================================
+ // Application WT deployed
+ //==================================================================
+
+ class WtWFrame : public Wt::WApplication
+ {
+ public:
+ WtWFrame( const Wt::WEnvironment& env );
+ ~WtWFrame();
+ WtBlackBox::WeakPointer mBox;
+ };
+
+
+ WtWFrame::WtWFrame( const Wt::WEnvironment& env ):Wt::WApplication(env)
+ {
+ //std::cout<<"Adding JavaScript -- DELETE ME -- bbtkWtBlackBox.cxx"<<std::endl;
+ //this->require("/home/gonzalez/Documents/CREATOOLS/wt_library/wt/bbtk_wt_PKG/src/js/xtk.js");
+
+ //this->require("http://get.goXTK.com/xtk.js");
+ //this->useStyleSheet("css/demo.css");
+
+ //this->require("http://get.goXTK.com/xtk.js");
+ this->require( "resourcesXTK/xtk.js" );
+
+ // this->require("http://get.goXTK.com/xtk_edge.js");
+// this->require("http://get.goXTK.com/xtk_xdat.gui.js");
+ this->require( "resourcesXTK/xtk_xdat.gui.js" );
+
+ this->useStyleSheet("resourcesXTK/styleWT.css");
+ // std::cout<<"Cargado------------ "<<loadedJS<<std::endl;
+ mBox = myWtData.b;
+
+//EED -->
+ if(!myWtData.parent)
+ {
+ std::cout<<" SIN PADRE "<<std::endl;
+ if(myWtData.parent == 0){std::cout<<" PARENT 0 "<<std::endl;}
+ if(myWtData.parent == NULL){std::cout<<" PARENT NULL "<<std::endl;}
+ myWtData.parent = new Wt::WContainerWidget();
+ std::cout<<"Parent created -- DELETE ME -- bbtkWtBlackBox.cxx"<<std::endl;
+ }
+
+ Wt::WContainerWidget *myContainer = new Wt::WContainerWidget(myWtData.parent);
+ myContainer->setMinimumSize(800,500);
+ std::cout<<"Creando WebWIDGET DELETE ME ---- bbtkWtBlackBox.cxx.......50%"<<std::endl;
+ myWtData.b->bbUserCreateWidget(myContainer);
+
+ root()->addWidget(myWtData.parent);
+ //bbmWindow = myCont;
+ this->refresh();
+ //jss = WtBlackBox::jScript;
+ std::cout<<"Creando WebWIDGET DELETE ME ---- bbtkWtBlackBox.cxx........80%"<<std::endl;
+ std::cout<<"Creando WebWIDGET DELETE ME SCRIPT : ---"<<bbtk::jScript<<"......80%"<<std::endl;
+ //this->doJavaScript(bbtk::jScript);
+
+//EED
+ myWtData.pbox->bbwtUpdateInputs();
+// myWtData.pbox->bbwtProcess();
+
+
+ }
+ //==================================================================
+ //==================================================================
+ WtWFrame::~WtWFrame()
+ {
+ if (mBox.lock())
+ bbtkDebugMessage("widget",9,"["<<mBox.lock()->bbGetName()
+ <<"] $$$$$$$$$$$$$$$$$$$ ~W()"
+ <<std::endl);
+ else
+ bbtkDebugMessage("widget",9,"[DEAD] $$$$$$$$$$$$$$$$$$$$$ ~WtContainer()"<<std::endl);
+ bbtkDebugMessage("widget",9,"WtWFrame::~WtWFrame()"<<std::endl);
+ if (mBox.lock()) mBox.lock()->bbSetWindow(0);
+ WWt::DecNbWindowsAlive();
+ }
+
+
+
+
+ Wt::WApplication *createApplication(const Wt::WEnvironment& env)
+ {
+ return new WtWFrame(env);
+ }
+
+
+ //=========================================================================
+ // WxDialogWxBlackBox::Pointer box
+ //=========================================================================
+
+ //==================================================================
+ // Dialog window which is modal
+ /* class BBTK_EXPORT WxDialog : public wxDialog
+ {
+ public:
+ WxDialog(WxBlackBox::Pointer box,
+ wxWindow *parent,
+ wxString title,
+ wxSize size);
+ ~WxDialog();Wt::GetTopWindow()
+ void OnCloseWindow(wxCloseEvent& event);
+
+
+ WxBlackBox::WeakPointer mBox;
+ DECLARE_EVENT_TABLE();
+
+ };
+
+ BEGIN_EVENT_TABLE(WxDialog, wxDialog)
+ EVT_CLOSE(WxDialog::OnCloseWindow)
+ END_EVENT_TABLE();
+ //=========================================================================
+
+ //=========================================================================
+ WxDialog::WxDialog(WxBlackBox::Pointer b,
+ wxWindow *parent,
+ wxString title,
+ wxSize size)
+ :
+ wxDialog( parent,
+ -1,
+ title,
+ wxDefaultPosition,
+ size,
+ wxRESIZE_BORDER |
+ wxSYSTEM_MENU |
+ wxCLOSE_BOX |
+ wxMAXIMIZE_BOX |
+ wxMINIMIZE_BOX |
+ wxCAPTION
+ ),
+ mBox(b)
+ {
+ bbtkDebugMessage("widget",9,"WxDialog::WxDialog ["<<b->bbGetName()<<"]"
+ <<std::endl);WxBlackBox::Pointer box
+ Wx::IncNbWindowsAlive();
+ b->bbSetWindow(this);
+ // Insert the widget into the window
+ wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
+ b->bbUserCreateWidget(this);
+ wxWindow* widget = b->bbGetOutputWidget();
+ sizer->Add( widget, 1, wxALL|wxGROW, 2);
+ SetSizer(sizer);
+ Layout();
+ }
+ //==================================================================
+ //===========================organise=======================================
+ WxDialog::~WxDialog()
+ {
+ bbtkDebugMessage("widget",9,"WxDialog::~WxDialog()"<<std::endl);
+ //bbtkDebugMessage("widget",9,"WxFrame::~WxFrame()"<<std::endl);
+ // if (mBox.lock()) mBox.lock()->bbSetWindow(0);
+ // Wx::DecNbWindowsAlive();
+ }
+ //==================================================================
+ //==================================================================
+ void WxDialog::OnCloseWindow(wxCloseEvent& event)
+ {
+ bbtkDebugMessage("widget",9,"WxDialog::OnCloseWindow()"<<wxGUIEditorGraphicBBS:std::endl);
+ if (mBox.lock()) mBox.lock()->bbSetWindow(0); http://doodle.com/qx65tfxismf7d6ku5vxykghs/admin#table
+ Wx::DecNbWindowsAlive();
+ this->Destroy();
+ }
+ //==================================================================
+
+*/
+ //=========================================================================
+ // WxBlackBox
+ //=========================================================================
+
+ //=========================================================================
+ //=========================================================================
+ //=========================================================================
+ //=========================================================================
+ BBTK_BLACK_BOX_IMPLEMENTATION(WtBlackBox,WidgetBlackBox<Wt::WContainerWidget>);
+
+ //std::string WtBlackBox::wtServerData::docRoot = "/home/gonzalez/Documents/pruebaResources";
+ //std::string WtBlackBox::wtServerData::docRoot = "/usr/local/share/wtResources";
+ //std::string WtBlackBox::wtServerData::port = "8081";
+
+ std::string WtBlackBox::wtServerData::docRoot = "<void>";
+ std::string WtBlackBox::wtServerData::port = "<void>";
+ std::string WtBlackBox::wtServerData::address = "0.0.0.0";
+ int WtBlackBox::wtServerData::argc = 0;
+ char **WtBlackBox::wtServerData::argv = NULL;
+
+ //=========================================================================
+ //=========================================================================
+ void WtBlackBox::bbUserSetDefaultValues()
+ {
+ bbtkBlackBoxDebugMessage("widget",5,"WtBlackBox::bbUserSetDefaultValues()"<<std::endl);
+ bbmWindow = 0;
+ }
+ //=========================================================================
+
+ //=========================================================================
+ void WtBlackBox::bbUserInitializeProcessing()
+ {
+
+ }
+ //================================================================http://intranet-if.insa-lyon.fr/temps/5IF39.html==
+
+ //=========================================================================
+ void WtBlackBox::bbUserFinalizeProcessing()
+ {
+ bbtkBlackBoxDebugMessage("widget",5,"==> WtBlackBox::bbUserFinalizeProcessing()"<<std::endl);
+ bbDestroyWindow();
+ bbtkBlackBoxDebugMessage("widget",5,"<== WtBlackBox::bbUserFinalizeProcessing()"<<std::endl);
+ }
+ //==================================================================
+
+ //==================================================================
+ /// Callback for creating a Dialog window (modal)
+ void WtBlackBox::bbCreateDialogWindow()
+ {
+ bbtkBlackBoxDebugMessage("widget",3,
+ "==> WtBlackBox::bbCreateDialogWindow() - No Dialog must be created, it is a web app"
+ <<std::endl);
+
+ }
+ //=========================================================================
+
+ //==================================================================
+
+ //==================================================================
+ /// Callback for creating a Frame window
+ void WtBlackBox::bbCreateFrameWindow()
+ {
+
+ bbtkBlackBoxDebugMessage("widget",3,
+ "==> WtBlackBox::bbCreateFrameWindow() - parent = "
+ <<WWt::GetTopWindow()
+ <<std::endl);
+
+ //Setting necessary data for Wt server deployment
+ myWtData.parent = WWt::GetTopWindow();
+ myWtData.b = GetThisPointer<WtBlackBox>();
+ myWtData.title = std2wt( bbGetInputWinTitle() + " - bbtk (c) CREATIS");
+ myWtData.pbox = this;
+
+ //char *argv[7] = {"./WtTest","--docroot","/home/gonzalez/Documents/pruebaResources","--http-address","0.0.0.0","--http-port","8080"};
+ //int argc = 7;
+
+/*
+ char *argv[7] = {"./WtTest"
+,"--docroot",(char*)WtBlackBox::wtServerData::docRoot.c_str()
+,"--http-address",(char*)WtBlackBox::wtServerData::address.c_str()
+,"--http-port",(char*)WtBlackBox::wtServerData::port.c_str()
+};
+ int argc = 3;
+ std::cout<<" --- PUERTO :"<<WtBlackBox::wtServerData::port<<std::endl;
+*/
+
+/*
+char *argv[2] = {"./bbiWeb.wt","client"};
+int argc=2;
+*/
+
+
+ /* if(Wt::WServer::instance()->isRunning())
+ {
+ std::cout<<"Checking the existence of a Server deployed -DELETE THIS MESSAGE bbtkWTBlackBox.cxx"<<std::endl;
+ Wt::WServer::instance()->stop();
+ }
+ */
+
+
+ std::cout<<"EED WtBlackBox::bbCreateFrameWindow Deploying Server -- Definition of server parameters by default -DELETE THIS MESSAGE bbtkWTBlackBox.cxx"<<std::endl;
+
+
+// Wt::WRun(argc,argv,&createApplication);
+
+ Wt::WRun(WtBlackBox::wtServerData::argc,
+ WtBlackBox::wtServerData::argv,
+ &createApplication);
+
+
+ }
+
+ //==================================================================
+
+ //==================================================================
+ void WtBlackBox::bbSetWindow(Wt::WContainerWidget* w)
+ {
+ bbtkBlackBoxDebugMessage("widget",9,"==> WtBlackBox::bbSetWindow("<<w<<")"<<std::endl);
+ if ((bbmWindow != 0)&&(w!=0))
+ {
+ std::cout << "ERRRRRRRROOOOR"<<std::endl;
+ }
+ bbmWindow = w;
+ }
+
+
+
+ //==================================================================
+
+ //==================================================================
+ void WtBlackBox::bbShowWindow()
+ {
+ if ((bbmWindow) && (!bbIsShown()))
+ {
+ bbtkBlackBoxDebugMessage("widget",3,"==> WtBlackBox::bbShowWindow()"
+ <<std::endl);
+ if (bbGetInputWinDialog())
+ {
+ // ((WxDialog*)bbmWindow)->ShowModal();
+ }
+ else
+ {
+ // There is not such a thing like show becouse it is a webapp
+ // bbGetWindow()->Show();
+ // WWt::CreateWtAppIfNeeded();
+
+
+ Wt::WRun(WtBlackBox::wtServerData::argc,
+ WtBlackBox::wtServerData::argv,
+ &createApplication);
+
+
+ bbSetShown(true);
+ }
+ }
+ }
+ //==================================================================
+
+ //==================================================================
+ void WtBlackBox::bbDestroyWindow()
+ {
+ bbtkBlackBoxDebugMessage("widget",3,"==> WtBlackBox::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,"<== WtBlackBox::bbDestroyWindow("<<bbmWindow<<")"<<std::endl);
+
+ }
+
+
+//==================================================================
+ void WtBlackBox::bbwtUpdateInputs()
+ {
+ BlackBox::bbUpdateInputs();
+ }
+
+//==================================================================
+ void WtBlackBox::bbwtProcess()
+ {
+ BlackBox::bbProcess();
+ }
+
+
+
+}//namespace bbtk
+
+#endif
+
+
--- /dev/null
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ # pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ # This software is governed by the CeCILL-B license under French law and
+ # abiding by the rules of distribution of free software. You can use,
+ # modify and/ or redistribute the software under the terms of the CeCILL-B
+ # license as circulated by CEA, CNRS and INRIA at the following URL
+ # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ # or in the file LICENSE.txt.
+ #
+ # As a counterpart to the access to the source code and rights to copy,
+ # modify and redistribute granted by the license, users are provided only
+ # with a limited warranty and the software's author, the holder of the
+ # economic rights, and the successive licensors have only limited
+ # liability.
+ #
+ # The fact that you are presently reading this means that you have had
+ # knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+/*=========================================================================
+ Program: bbtk
+ Module: $RCSfile: bbtkWxBlackBox.h,v $
+ Language: C++
+ Date: $Date: 2012/11/16 08:49:01 $
+ Version: $Revision: 1.33 $
+========================================================================*/
+
+
+
+/**
+ * \brief Short description in one line
+ *
+ * Long description which
+ * can span multiple lines
+ */
+/**
+ * \file
+ * \brief
+ */
+/**
+ * \class bbtk::
+ * \brief
+ */
+
+
+#ifdef USE_WT
+
+
+#ifndef __bbtkWtBlackBox_h__
+#define __bbtkWtBlackBox_h__
+
+
+
+#include "bbtkWidgetBlackBox.h"
+#include "bbtkWt.h"
+
+
+namespace bbtk
+{
+
+
+
+ //==================================================================
+ /// Widget black boxes
+//EED 10/06/2009 /*BBTK_EXPORT*/
+ class BBTK_EXPORT WtBlackBox : public bbtk::WidgetBlackBox<Wt::WContainerWidget>
+ {
+
+
+
+
+
+
+ public:
+ BBTK_BLACK_BOX_INTERFACE(WtBlackBox,bbtk::WidgetBlackBox<Wt::WContainerWidget>);
+
+
+ // protected:
+
+ public:
+
+ struct wtServerData
+ {
+ /*std::string docRoot;
+ std::string port;
+ std::string address;
+ */
+ static std::string docRoot ;
+ static std::string port ;
+ static std::string address ;
+
+ static int argc;
+ static char **argv;
+ };
+
+ /* static std::string* jScript;
+ static void changeJScript(std::string newJScript){jScript=newJScript;};
+ static std::string getJScript(){return jScript;};*/
+ //==================================================================
+ /// Callback for creating a Dialog window (modal)
+ /// ** Must be defined ** in toolkit specific descendants
+ virtual void bbCreateDialogWindow();
+ //==================================================================
+
+ //==================================================================
+ /// Callback for creating a Frame window
+ /// ** Must be defined ** in toolkit specific descendants
+ virtual void bbCreateFrameWindow();
+ //==================================================================
+ //staticwtServerData serData;
+ // static void setServerInformation(std::string nDocRoot, std::string nPort, std::string nAddress);
+ //==================================================================
+ Wt::WContainerWidget* bbGetWindow() { return bbmWindow; }
+ void bbSetWindow(Wt::WContainerWidget*) ;
+ bool bbWindowIsCreated() { return (bbGetWindow() != 0); }
+ // Wt::WApplication *createApplication(const Wt::WEnvironment& env);
+ //==================================================================
+
+
+ //==================================================================
+ virtual void bbShowWindow();
+ //==================================================================
+
+ //==================================================================
+ virtual void bbDestroyWindow();
+ //==================================================================
+
+ void bbwtUpdateInputs();
+ void bbwtProcess();
+
+ private:
+
+ Wt::WApplication* bbApp;
+ Wt::WContainerWidget* bbmWindow;
+
+ };
+ //=================================================================
+
+
+ //=================================================================
+ // WxBlackBoxDescriptor declaration
+ class WtBlackBoxDescriptor : public WidgetBlackBoxDescriptor<Wt::WContainerWidget>
+ BBTK_BEGIN_DESCRIBE_BLACK_BOX_BODY(WtBlackBox);
+ BBTK_NAME("WtBlackBox");
+ BBTK_END_DESCRIBE_BLACK_BOX(WtBlackBox);
+ //=================================================================
+
+
+} //namespace bbtk
+
+#endif //__bbtkWxBlackBox_h__
+
+#endif //USE_WXWIDGETS
IMPLEMENT_APP_NO_MAIN(WxApp);
//=========================================================================
bool WxApp::OnInit( )
- {
+ {
+ std::cout<<"Testing OnINIT Wx ---- JFGA !!!DELETE ME!!! bbtkWx"<<std::endl;
wxApp::OnInit();
#ifdef __WXGTK__
//See http://www.wxwindows.org/faqgtk.htm#locale
//=========================================================================
void Wx::CreateWxAppIfNeeded()
{
+
+ std::cout<<"Testing CreateWxAppIfNeeded --- DELETE ME ----"<<std::endl;
if (wxApp::GetInstance()==0)
{
if (mgWxApp != 0)
BEGIN_EVENT_TABLE(WxFrame, wxFrame)
// EVT_CLOSE(WxFrame::OnCloseWindow)
END_EVENT_TABLE();
- //==================================================================
+ //==========================================Window ========================
//==================================================================
WxFrame::WxFrame(WxBlackBox::Pointer b,
}
//==================================================================
- //=========================================================================
+ //====================================================SetWin=====================
// WxDialog
//=========================================================================
),
mBox(b)
{
+
bbtkDebugMessage("widget",9,"WxDialog::WxDialog ["<<b->bbGetName()<<"]"
<<std::endl);
Wx::IncNbWindowsAlive();
void WxBlackBox::bbUserSetDefaultValues()
{
bbtkBlackBoxDebugMessage("widget",5,"WxBlackBox::bbUserSetDefaultValues()"<<std::endl);
- bbmWindow = 0;
+ bbmWindow = 0;
}
//=========================================================================
wxSize( bbGetInputWinWidth() ,
bbGetInputWinHeight() ) );
w->Show();
+
+
}
//==================================================================
{
bbtkBlackBoxDebugMessage("widget",9,"==> WxBlackBox::bbSetWindow("<<w<<")"<<std::endl);
if ((bbmWindow != 0)&&(w!=0))
- {
- std::cout << "ERRRRRRRROOOOR"<<std::endl;
- }
+ {
+ std::cout << "WxBlackBox::bbSetWindow ?? EED ?? ERRRRRRRROOOOR"<<std::endl;
+ }
bbmWindow = w;
}
//==================================================================
{
((WxDialog*)bbmWindow)->ShowModal();
}
- else
+ else
{
bbGetWindow()->Show();
bbSetShown(true);
}
- }
+ } // if
+
+
}
//==================================================================
ADD_SUBDIRECTORY(gdcmvtk)
+
+
+
+IF(BBTK_USE_WT)
+ ADD_SUBDIRECTORY(wt)
+ENDIF(BBTK_USE_WT)
+
IF(BBTK_USE_KWWIDGETS)
ADD_SUBDIRECTORY(kw)
ENDIF(BBTK_USE_KWWIDGETS)
<<bbtk::TypeName<itkImageType>()
<<">()"<<std::endl);
+ std::cout<<"bbitk::ImageWriter::Write<"
+ <<bbtk::TypeName<itkImageType>()
+ <<">()"<<std::endl;
+
typedef itk::ImageFileWriter< itkImageType > itkWriterType;
typename itkWriterType::Pointer writer = itkWriterType::New();
writer->SetInput(bbGetInputIn().unsafe_get<const itkImageType*>());
--- /dev/null
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+#include "bbstdGetBBTKinfo.h"
+#include "bbstdPackage.h"
+namespace bbstd
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,GetBBTKinfo)
+BBTK_BLACK_BOX_IMPLEMENTATION(GetBBTKinfo,bbtk::AtomicBlackBox);
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void GetBBTKinfo::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+// Here we simply set the input 'In' value to the output 'Out'
+// And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+// void bbSet{Input|Output}NAME(const TYPE&)
+// const TYPE& bbGet{Input|Output}NAME() const
+// Where :
+// * NAME is the name of the input/output
+// (the one provided in the attribute 'name' of the tag 'input')
+// * TYPE is the C++ type of the input/output
+// (the one provided in the attribute 'type' of the tag 'input')
+// bbSetOutputOut( bbGetInputIn() );
+// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+
+ bbSetOutputExecPath( bbtk::Utilities::GetExecutablePath() );
+
+}
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void GetBBTKinfo::bbUserSetDefaultValues()
+{
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+// bbSetInputIn(0);
+
+}
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void GetBBTKinfo::bbUserInitializeProcessing()
+{
+
+// THE INITIALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should allocate the internal/output pointers
+// if any
+
+
+}
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void GetBBTKinfo::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbstd
+
+
--- /dev/null
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+#ifndef __bbstdGetBBTKinfo_h_INCLUDED__
+#define __bbstdGetBBTKinfo_h_INCLUDED__
+#include "bbstd_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbstd
+{
+
+class bbstd_EXPORT GetBBTKinfo
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(GetBBTKinfo,bbtk::AtomicBlackBox);
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+// BBTK_DECLARE_INPUT(In,double);
+ BBTK_DECLARE_OUTPUT(ExecPath,std::string);
+ BBTK_PROCESS(Process);
+ void Process();
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(GetBBTKinfo,bbtk::AtomicBlackBox);
+ BBTK_NAME("GetBBTKinfo");
+ BBTK_AUTHOR("InfoDev");
+ BBTK_DESCRIPTION("No Description.");
+ BBTK_CATEGORY("empty");
+// BBTK_INPUT(GetBBTKinfo,In,"First input",double,"");
+ BBTK_OUTPUT(GetBBTKinfo,ExecPath,"Executable path",std::string,"");
+BBTK_END_DESCRIBE_BLACK_BOX(GetBBTKinfo);
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+}
+// EO namespace bbstd
+
+#endif // __bbstdGetBBTKinfo_h_INCLUDED__
+
--- /dev/null
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+#include "bbstdRandomString.h"
+#include "bbstdPackage.h"
+namespace bbstd
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,RandomString)
+BBTK_BLACK_BOX_IMPLEMENTATION(RandomString,bbtk::AtomicBlackBox);
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+
+
+static const char alphanum[] =
+"0123456789"
+//"!@#$%^&*"
+"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+"abcdefghijklmnopqrstuvwxyz";
+
+
+char genRandom()
+{
+}
+
+
+void RandomString::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+// Here we simply set the input 'In' value to the output 'Out'
+// And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+// void bbSet{Input|Output}NAME(const TYPE&)
+// const TYPE& bbGet{Input|Output}NAME() const
+// Where :
+// * NAME is the name of the input/output
+// (the one provided in the attribute 'name' of the tag 'input')
+// * TYPE is the C++ type of the input/output
+// (the one provided in the attribute 'type' of the tag 'input')
+// bbSetOutputOut( bbGetInputIn() );
+// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+
+ int stringLength = sizeof(alphanum) - 1;
+ srand(time(0));
+ std::string STR;
+ for(unsigned int i = 0; i < 8; ++i)
+ {
+ STR += alphanum[rand() % stringLength];
+ }
+ bbSetOutputOut( STR );
+printf("EED RandomString::Process randomString=%s\n",STR.c_str());
+}
+
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void RandomString::bbUserSetDefaultValues()
+{
+
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+// bbSetInputIn(0);
+
+}
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void RandomString::bbUserInitializeProcessing()
+{
+
+// THE INITIALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should allocate the internal/output pointers
+// if any
+
+
+}
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void RandomString::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbstd
+
+
--- /dev/null
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+#ifndef __bbstdRandomString_h_INCLUDED__
+#define __bbstdRandomString_h_INCLUDED__
+#include "bbstd_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbstd
+{
+
+class bbstd_EXPORT RandomString
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(RandomString,bbtk::AtomicBlackBox);
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+// BBTK_DECLARE_INPUT(In,double);
+ BBTK_DECLARE_OUTPUT(Out,std::string);
+ BBTK_PROCESS(Process);
+ void Process();
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(RandomString,bbtk::AtomicBlackBox);
+ BBTK_NAME("RandomString");
+ BBTK_AUTHOR("InfoDev");
+ BBTK_DESCRIPTION("No Description.");
+ BBTK_CATEGORY("empty");
+// BBTK_INPUT(RandomString,In,"First input",double,"");
+ BBTK_OUTPUT(RandomString,Out,"Output random string [8]",std::string,"");
+BBTK_END_DESCRIBE_BLACK_BOX(RandomString);
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+}
+// EO namespace bbstd
+
+#endif // __bbstdRandomString_h_INCLUDED__
+
<input name="In" type="vtkPolyData*" description="Input mesh" />
<process><PRE>
+
+ printf("EED PolyDataWriter::Process() %s\n", bbGetInputFilename().c_str());
+
vtkPolyDataWriter* w = vtkPolyDataWriter::New();
bbGetInputIn()->Update();
w->SetInput(bbGetInputIn());
writer->Delete();
}
-
std::cout << "Saving Ok!" << std::endl;
InvokeEvent(OBS_POST_WRITER_1);
bbGetInputReactiveOnKeystroke()
);
bbSetOutputWidget( w );
+
}
BBTK_BLACK_BOX_INTERFACE(CheckBox,bbtk::WxBlackBox);
BBTK_DECLARE_INPUT(In,bool);
BBTK_DECLARE_INPUT(Title,std::string);
- BBTK_DECLARE_INPUT(ReactiveOnKeystroke,int);
+ BBTK_DECLARE_INPUT(ReactiveOnKeystroke,int);
BBTK_DECLARE_OUTPUT(Out,bool);
BBTK_PROCESS(Process);
BBTK_CREATE_WIDGET(CreateWidget);
~ComboBoxWidget();
void OnComboBox(wxEvent& event);
+ void FillItems( int iSelection, std::vector< std::string > lstIn);
+
private:
int mTypeForm;
Connect( wxlistbox->GetId(), wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction) (void (wxPanel::*)(wxEvent&))&ComboBoxWidget::OnComboBox );
for (i=0;i<lstIn.size(); i++)
{
- wxlistbox->Append( bbtk::std2wx( lstIn[i] ) );
+ wxlistbox->Append( bbtk::std2wx( lstIn[i] ) );
} // for i
wxlistbox->SetSelection(iSelection);
sizer->Add( wxlistbox,1,wxGROW );
Connect( wxchoice->GetId(), wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction) (void (wxPanel::*)(wxEvent&))&ComboBoxWidget::OnComboBox );
for (i=0;i<lstIn.size(); i++)
{
- wxchoice->Append( bbtk::std2wx( lstIn[i] ) );
+ wxchoice->Append( bbtk::std2wx( lstIn[i] ) );
} // for i
wxchoice->SetSelection(iSelection);
sizer->Add( wxchoice,1,wxGROW );
mBox->bbSignalOutputModification("OutString");
}
+//--------------------------------------------------------------------------
+ void ComboBoxWidget::FillItems(
+ int iSelection,
+ std::vector< std::string > lstIn
+ )
+ {
+ int i;
+ if (mTypeForm==1)
+ {
+ wxlistbox->Clear();
+ for (i=0;i<lstIn.size(); i++)
+ {
+ wxlistbox->Append( bbtk::std2wx( lstIn[i] ) );
+ } // for i
+ wxlistbox->SetSelection(iSelection);
+ } else {
+ wxchoice->Clear();
+ for (i=0;i<lstIn.size(); i++)
+ {
+ wxchoice->Append( bbtk::std2wx( lstIn[i] ) );
+ } // for i
+ wxchoice->SetSelection(iSelection);
+ } // if
+ }
BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,ComboBox)
BBTK_BLACK_BOX_IMPLEMENTATION(ComboBox,bbtk::WxBlackBox);
//=====
void ComboBox::Process()
{
+ ComboBoxWidget *w = (ComboBoxWidget*)bbGetOutputWidget();
+ w->FillItems( bbGetInputSelection(),bbGetInputIn() );
}
+
//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
//=====
//=====
void StaticBox::CreateWidget(wxWindow* parent)
{
- std::cout << "creating..." << std::endl;
wxPanel *w=new wxPanel(
parent, //bbGetWxParent(),
-1
{
bbSetInputBoxTitle("");
bbSetInputBoxContent(NULL);
- std::cout << "initialized"<<std::endl;
}
//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)