# LG : removed vtkIO because conflict with itktiff lib in ITKIO
)
MARK_AS_ADVANCED(VTK_DIR)
+ ELSE(VTK_FOUND)
+ message(FATAL_ERROR "VTK_DIR not found")
ENDIF(VTK_FOUND)
ENDIF(USE_VTK)
#-----------------------------------------------------------------------------
--- /dev/null
+description "Simple test of wx::Sizer widget"
+author "eduardo.davila@creatis.insa-lyon.fr"
+category "test;widget"
+
+load wx
+
+new Slider slider1
+new Slider slider2
+new Slider slider3
+new Sizer sizer
+new Notebook main
+
+connect slider2.Widget sizer.Widget1
+connect slider3.Widget sizer.Widget2
+
+connect slider1.Widget main.Widget1
+connect sizer.Widget main.Widget2
+
+exec main
--- /dev/null
+description "Simple test of wx::Sizer widget"
+author "eduardo.davila@creatis.insa-lyon.fr"
+category "test;widget"
+
+load wx
+
+new Slider slider1
+new Slider slider2
+new Slider slider3
+new Sizer sizer
+new Notebook main
+
+new Slider sA
+new Slider sB
+new Notebook notebook
+
+connect slider2.Widget sizer.Widget1
+connect slider3.Widget sizer.Widget2
+
+connect sA.Widget notebook.Widget1
+connect sB.Widget notebook.Widget2
+
+
+connect slider1.Widget main.Widget1
+connect sizer.Widget main.Widget2
+connect notebook.Widget main.Widget3
+
+exec main
--- /dev/null
+description "Simple test of wx::Sizer widget"
+author "eduardo.davila@creatis.insa-lyon.fr"
+category "test;widget"
+
+load wx
+
+new Slider slider1
+new Slider slider2
+new Sizer main
+
+connect slider1.Widget main.Widget1
+connect slider2.Widget main.Widget2
+
+exec main
--- /dev/null
+/*=========================================================================
+
+ Program: bbtk
+ Module: $RCSfile: bbwxNotebook.cxx,v $
+ Language: C++
+ Date: $Date: 2008/02/05 18:05:32 $
+ Version: $Revision: 1.1 $
+
+ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+ l'Image). All rights reserved. See Doc/License.txt or
+ http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notices for more information.
+
+=========================================================================*/
+/**
+ * \file
+ * \brief
+ */
+
+
+#ifdef _USE_WXWIDGETS_
+
+
+#include "bbwxNotebook.h"
+#include "bbwxPackage.h"
+
+
+
+
+
+namespace bbwx
+{
+ BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx , Notebook);
+
+
+ BBTK_USER_BLACK_BOX_IMPLEMENTATION(Notebook,bbtk::WxBlackBox);
+
+ void Notebook::bbUserConstructor()
+ {
+ bbSetInputWinTitle("Notebook");
+ bbSetInputOrientation(0);
+ bbSetInputWidget1(NULL);
+ bbSetInputWidget2(NULL);
+ bbSetInputWidget3(NULL);
+ bbSetInputWidget4(NULL);
+ bbSetInputWidget5(NULL);
+ bbSetInputWidget6(NULL);
+ bbSetInputWidget7(NULL);
+ bbSetInputWidget8(NULL);
+ bbSetInputWidget9(NULL);
+ bbSetInputWidget10(NULL);
+ }
+
+ void Notebook::TryInsertWindow(wxNotebook *book, wxWindow *widgetchild )
+ {
+ if (widgetchild!=NULL)
+ {
+ widgetchild->Reparent(book);
+ book->AddPage(widgetchild, widgetchild->GetName() );
+ }
+ }
+
+
+ void Notebook::Process()
+ {
+ }
+
+
+ void Notebook::CreateWidget()
+ {
+ long style = wxNB_TOP;
+ if (bbGetInputOrientation()==0) { style=wxNB_TOP; }
+ if (bbGetInputOrientation()==1) { style=wxNB_LEFT; }
+ if (bbGetInputOrientation()==2) { style=wxNB_RIGHT; }
+ if (bbGetInputOrientation()==3) { style=wxNB_BOTTOM; }
+ wxNotebook *w = new wxNotebook(bbGetWxParent(), -1, wxDefaultPosition,wxDefaultSize,style );
+ w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
+
+
+ TryInsertWindow(w,bbGetInputWidget1());
+ TryInsertWindow(w,bbGetInputWidget2());
+ TryInsertWindow(w,bbGetInputWidget3());
+ TryInsertWindow(w,bbGetInputWidget4());
+ TryInsertWindow(w,bbGetInputWidget5());
+ TryInsertWindow(w,bbGetInputWidget6());
+ TryInsertWindow(w,bbGetInputWidget7());
+ TryInsertWindow(w,bbGetInputWidget8());
+ TryInsertWindow(w,bbGetInputWidget9());
+ TryInsertWindow(w,bbGetInputWidget10());
+
+ bbSetOutputWidget( w );
+ }
+
+
+
+
+}//namespace bbwx
+
+#endif
+
--- /dev/null
+/*=========================================================================
+
+ Program: bbtk
+ Module: $RCSfile: bbwxNotebook.h,v $
+ Language: C++
+ Date: $Date: 2008/02/05 18:05:32 $
+ Version: $Revision: 1.1 $
+
+ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+ l'Image). All rights reserved. See Doc/License.txt or
+ http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notices for more information.
+
+=========================================================================*//**
+ * \brief Short description in one line
+ *
+ * Long description which
+ * can span multiple lines
+ */
+/**
+ * \file
+ * \brief Pattern for the definition of a new type of Node (header)
+ */
+/**
+ * \class bbtk::NodePatern
+ * \brief Pattern for the definition of a new type of Node
+ */
+
+
+#ifdef _USE_WXWIDGETS_
+
+
+#ifndef __bbWxNotebook_h__
+#define __bbWxNotebook_h__
+
+#include "bbtkWxBlackBox.h"
+#include <wx/notebook.h>
+
+
+namespace bbwx
+{
+
+
+
+
+ class /*BBTK_EXPORT*/ Notebook : public bbtk::WxBlackBox
+ {
+
+ BBTK_USER_BLACK_BOX_INTERFACE(Notebook,bbtk::WxBlackBox);
+ BBTK_DECLARE_INPUT(Widget1,wxWindow*);
+ BBTK_DECLARE_INPUT(Widget2,wxWindow*);
+ BBTK_DECLARE_INPUT(Widget3,wxWindow*);
+ BBTK_DECLARE_INPUT(Widget4,wxWindow*);
+ BBTK_DECLARE_INPUT(Widget5,wxWindow*);
+ BBTK_DECLARE_INPUT(Widget6,wxWindow*);
+ BBTK_DECLARE_INPUT(Widget7,wxWindow*);
+ BBTK_DECLARE_INPUT(Widget8,wxWindow*);
+ BBTK_DECLARE_INPUT(Widget9,wxWindow*);
+ BBTK_DECLARE_INPUT(Widget10,wxWindow*);
+ BBTK_DECLARE_INPUT(Orientation,int);
+ BBTK_PROCESS(Process);
+ BBTK_CREATE_WIDGET(CreateWidget);
+
+ void Process();
+ void CreateWidget();
+
+ protected:
+ virtual void bbUserConstructor();
+ void TryInsertWindow(wxNotebook *book, wxWindow *widgetchild);
+
+ };
+
+
+//=================================================================
+// UserBlackBox description
+ BBTK_BEGIN_DESCRIBE_BLACK_BOX(Notebook,bbtk::WxBlackBox);
+ BBTK_NAME("Notebook");
+ BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr");
+
+ BBTK_DESCRIPTION("Notebook widget (wxNotebook)");
+ BBTK_INPUT(Notebook,Widget1,"widget 1",wxWindow*);
+ BBTK_INPUT(Notebook,Widget2,"widget 2",wxWindow*);
+ BBTK_INPUT(Notebook,Widget3,"widget 3",wxWindow*);
+ BBTK_INPUT(Notebook,Widget4,"widget 4",wxWindow*);
+ BBTK_INPUT(Notebook,Widget5,"widget 5",wxWindow*);
+ BBTK_INPUT(Notebook,Widget6,"widget 6",wxWindow*);
+ BBTK_INPUT(Notebook,Widget7,"widget 7",wxWindow*);
+ BBTK_INPUT(Notebook,Widget8,"widget 8",wxWindow*);
+ BBTK_INPUT(Notebook,Widget9,"widget 9",wxWindow*);
+ BBTK_INPUT(Notebook,Widget10,"widget 10",wxWindow*);
+ BBTK_INPUT(Notebook,Orientation,"Orientation (default 0), 0=Top , 1=Left , 2=Right , 3=Botton",int);
+ BBTK_END_DESCRIBE_BLACK_BOX(Notebook);
+ //=================================================================
+
+
+
+}
+
+
+
+//namespace bbtk
+#endif //__bbtkWxSizer_h__
+
+#endif //_USE_WXWIDGETS_
Program: bbtk
Module: $RCSfile: bbwxSizer.cxx,v $
Language: C++
- Date: $Date: 2008/02/05 13:23:47 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2008/02/05 18:05:32 $
+ Version: $Revision: 1.3 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx , Sizer);
-/*
- wxWidgetSizer::wxWidgetSizer(wxWindow *parent,int orientation)
- : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
- {
- wxPanel *panel = this;
-
- if (orientation==0)
- {
- mwxSizer = new wxBoxSizer(wxHORIZONTAL);
- } else {
- mwxSizer = new wxBoxSizer(wxVERTICAL);
- }
-
- panel -> SetSizer(mwxSizer);
- panel -> SetAutoLayout(true);
- panel -> Layout();
-
- mbbtkSizer=NULL;
- }
- //-------------------------------------------------------------------------
- void wxWidgetSizer::AddChild(wxWindow* child)
- {
- mwxSizer->Add(child, 1, wxEXPAND, 0);
- }
-
- wxWidgetSizer::~wxWidgetSizer()
- {
- }
-
- //-------------------------------------------------------------------------
-
- void wxWidgetSizer::SetSizer(Sizer* bbtksizer)
- {
- mbbtkSizer = bbtksizer;
- }
-
-
-
- //--------------------------------------------------------------------------
- //-------------------------------------------------------------------------
- //--------------------------------------------------------------------------
- //--------------------------------------------------------------------------
-
-*/
BBTK_USER_BLACK_BOX_IMPLEMENTATION(Sizer,bbtk::WxBlackBox);
void Sizer::bbUserConstructor()
{
+ bbSetInputWinTitle("Sizer");
bbSetInputOrientation(1);
bbSetInputWidget1(NULL);
bbSetInputWidget2(NULL);
{
wxBoxSizer *sizer;
wxPanel *w=new wxPanel(bbGetWxParent(), -1);
+ w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
if (bbGetInputOrientation()==0)
{
sizer = new wxBoxSizer(wxHORIZONTAL);
TryInsertWindow(w,bbGetInputWidget9(),sizer);
TryInsertWindow(w,bbGetInputWidget10(),sizer);
- w -> SetSizer(sizer);
-// w -> SetAutoLayout(true);
-// w -> Layout();
+ w -> SetSizer(sizer);
bbSetOutputWidget( w );
}
-/*
- wxWindow *Sizer::CreateWxWindow(wxWindow *parent)
- {
- bbtkDebugMessageInc("Kernel",9,"Sizer::CreateWxWindow("<<parent<<")"<<std::endl);
-
- wxWidgetSizer *wxwidgetsizer = new wxWidgetSizer(parent,bbGetInputOrientation() );
-
-// OutputConnectorMapType::iterator i = GetOutputConnectorMap().find("Child");
- OutputConnectorMapType::iterator i;
- for (i=GetOutputConnectorMap().begin() ; i!=GetOutputConnectorMap().end(); ++i ){
- if (i->first=="Child")
- {
- const std::vector<Connection*>& C = i->second->GetConnectionVector();
- std::vector<Connection*>::const_iterator j;
- for (j=C.begin(); j!=C.end(); ++j)
- {
-// WxBlackBox* to = ((WxBlackBox*)((*j)->GetBlackBoxTo()));
-// wxWindow* cw = ((WxBlackBox*)((*j)->GetBlackBoxTo()))->GetWxWindow(wxwidgetsizer);
- wxPanel *cw = new wxPanel(wxwidgetsizer,-1);
- cw->SetName( wxString( (*j)->GetBlackBoxTo()->bbGetName().c_str(), wxConvUTF8 ) );
- wxwidgetsizer->AddChild(cw);
- } // for j
- break;
- } // if Child
- } // for i
- //
- wxwidgetsizer->SetSizer(this);
-
- bbtkDebugDecTab("Kernel",9);
-
- Setmwxcontainer(wxwidgetsizer);
-
- return wxwidgetsizer;
- }
-
- void Sizer::AddWxBBChild(WxBlackBox *wxblackbox) // virtual
- {
- wxWindow *subparent = GetSubParent( wxString(wxblackbox->bbGetName().c_str(),wxConvUTF8 ) );
- wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
- sizer -> Add( wxblackbox->GetWxWindow( subparent ) , 1, wxALL|wxEXPAND, 2);
- subparent -> SetAutoLayout(true);
- subparent -> SetSizer(sizer);
- subparent -> Layout();
- }
-*/
Program: bbtk
Module: $RCSfile: bbwxSlider.cxx,v $
Language: C++
- Date: $Date: 2008/01/22 15:41:35 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2008/02/05 18:05:32 $
+ Version: $Revision: 1.3 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//--------------------------------------------------------------------------
void Slider::bbUserConstructor()
{
+ bbSetInputWinTitle("Slider");
bbSetInputIn(0);
bbSetInputMin(0);
bbSetInputMax(500);
void Slider::CreateWidget()
{
- bbSetOutputWidget( new SliderWidget(this,
- bbGetWxParent(),
- bbGetInputOrientation() ,
- bbGetInputChangeResolution(),
- bbGetInputLabel(),
- bbtk::std2wx( bbGetInputTitle() ),
- bbGetInputMin(),
- bbGetInputMax(),
- bbGetInputIn(),
- bbGetInputReactiveOnTrack()
- )
- );
+
+ SliderWidget *w = new SliderWidget(this,
+ bbGetWxParent(),
+ bbGetInputOrientation() ,
+ bbGetInputChangeResolution(),
+ bbGetInputLabel(),
+ bbtk::std2wx( bbGetInputTitle() ),
+ bbGetInputMin(),
+ bbGetInputMax(),
+ bbGetInputIn(),
+ bbGetInputReactiveOnTrack()
+ );
+ w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
+
+ bbSetOutputWidget( w );
}
//--------------------------------------------------------------------------
Program: bbtk
Module: $RCSfile: bbwxSplit.cxx,v $
Language: C++
- Date: $Date: 2008/02/05 13:23:47 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2008/02/05 18:05:32 $
+ Version: $Revision: 1.4 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace bbwx
{
BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,Split);
- /*
- //-------------------------------------------------------------------------
- SplitWidget::SplitWidget(Split* box,
- wxWindow *parent,
- int orientation)
- :
- WxBlackBoxWidgetPanel(box,parent),
- mOrientation(orientation)
- //( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
- {
- wxPanel *panel = this->GetPanel();
- mwxSplitterWindow = new wxSplitterWindow(panel,-1,
- wxDefaultPosition,
- wxDefaultSize,
- wxSP_3D |
- wxSP_LIVE_UPDATE );
-
- wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
- sizer -> Add(mwxSplitterWindow, 1, wxGROW, 0);
-#if defined(_WIN32)
- //mwxSplitterWindow -> SetMinimumPaneSize(25);
-#else
- mwxSplitterWindow -> SetMinimumPaneSize(25);
-#endif // defined(_WIN32)
-
- panel -> SetSizer(sizer);
- panel -> SetAutoLayout(true);
- panel -> Layout();
- }
- //-------------------------------------------------------------------------
-
- //-------------------------------------------------------------------------
- void SplitWidget::SetChilds(wxWindow* child1,wxWindow* child2,
- int prop)
- {
- if (mwxSplitterWindow->IsSplit()) return;
- if (mOrientation==0)
- {
- int sz = (int)(GetParent()->GetSize().GetHeight() * prop * 0.01);
- mwxSplitterWindow->SplitHorizontally( child1 , child2, sz);
- }
- else
- {
- int sz = (int)(GetParent()->GetSize().GetWidth() * prop * 0.01);
- mwxSplitterWindow->SplitVertically( child1 , child2, sz );
- }
-
-
- }
-
- SplitWidget::~SplitWidget()
- {
- }
-
-
- //-------------------------------------------------------------------------
- wxSplitterWindow *SplitWidget::GetWxSplitterWindow()
- {
- return mwxSplitterWindow;
- }
-
- */
- //--------------------------------------------------------------------------
- //-------------------------------------------------------------------------
- //--------------------------------------------------------------------------
- //--------------------------------------------------------------------------
BBTK_USER_BLACK_BOX_IMPLEMENTATION(Split,bbtk::WxBlackBox);
void Split::bbUserConstructor()
{
+ bbSetInputWinTitle("Split");
bbSetInputOrientation(0);
bbSetInputProportion(50);
}
//wxSize(400,200),
wxSP_3D |
wxSP_LIVE_UPDATE );
+ w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
wxWindow* w1 = bbGetInputWidget1();
wxWindow* w2 = bbGetInputWidget2();
- //w->SetInitialSize(wxSize(100,100));
- // int sz = (int)(GetParent()->GetSize().GetHeight() * prop * 0.01);
+
w1->Reparent(w);
w2->Reparent(w);
w->SplitHorizontally( w1, w2, 100);
- //w->SetMinimumPaneSize(100);
- // w->SetAutoLayout(true);
- // w->Fit();
- // w->Layout();
bbSetOutputWidget( w );
}
- /**
- * \brief Create wxWidget .
- *
- *
- */
- /*
- bbtk::WxBlackBoxWidget *Split::bbUserCreateWidget(wxWindow *parent)
- {
- //printf("EED Split::CreateWxWindow \n" );
- bbtkDebugMessageInc("Kernel",9,"Split::bbUserCreateWidget("<<parent<<")"<<std::endl);
-
- SplitWidget *wxwidgetsplit = new SplitWidget(this, parent ,
- bbGetInputOrientation() );
-
- OutputConnectorMapType::iterator i;
- for (i=bbGetOutputConnectorMap().begin() ; i!=bbGetOutputConnectorMap().end(); ++i )
- {
- if (i->first=="WinChild")
- {
- const std::vector<bbtk::Connection*>& C = i->second->GetConnectionVector();
- std::vector<bbtk::Connection*>::const_iterator j;
- j = C.begin();
- if (C.size()==2)
- {
- wxPanel *w1 = new wxPanel(wxwidgetsplit->GetWxSplitterWindow() ,-1 );
- wxPanel *w2 = new wxPanel(wxwidgetsplit->GetWxSplitterWindow() ,-1 );
- bbtkDebugMessage("Debug",1,"Creating panel for "<<(*j)->GetFullName());
- bbmOutputWinChild->AddToConnectionToWindowMap(*j,w1);
- bbtkDebugMessage("Debug",1,"..OK"<<std::endl);
- j++;
- bbtkDebugMessage("Debug",1,"Creating panel for "<<(*j)->GetFullName());
- bbmOutputWinChild->AddToConnectionToWindowMap(*j,w2);
-
- bbtkDebugMessage("Debug",1,"..OK"<<std::endl);
- wxwidgetsplit->SetChilds( w1 , w2, bbGetInputProportion() );
- } // if C
- break;
- }// if Child
- }// if i
- //
-
-
- bbtkDebugDecTab("Kernel",9);
-
- return wxwidgetsplit;
-
- }
- */
}//namespace bbtk