# LIST HERE THE FILES TO COMPILE TO BUILD THE LIB
# E.G. TO COMPILE "toto.cxx" ADD "toto" (NO EXTENSION)
# THE PATH MUST BE RELATIVE TO THE src FOLDER
-bbqtQOutputText
-bbqtQSlider
-bbqtQLayoutLine
+ bbqtOutputText
+ bbqtSlider
+ bbqtLayoutLine
+ bbqtLayoutSplit
)
#===========================================================================
#---------------------------------------------------------------------------
# MOC
SET(QT4_HEADERS_TO_WRAP
- bbqtQSlider.h
+ bbqtSlider.h
)
QT4_WRAP_CPP(MOC_SOURCES ${QT4_HEADERS_TO_WRAP})
#---------------------------------------------------------------------------
/*=========================================================================
Program: bbtk
- Module: $RCSfile: bbqtQLayoutLine.cxx,v $
+ Module: $RCSfile: bbqtLayoutLine.cxx,v $
Language: C++
- Date: $Date: 2009/04/08 07:56:33 $
+ Date: $Date: 2009/04/08 08:35:59 $
Version: $Revision: 1.1 $
=========================================================================*/
#ifdef USE_QT
-#include "bbqtQLayoutLine.h"
+#include "bbqtLayoutLine.h"
#include "bbqtPackage.h"
#include "bbtkUtilities.h"
QWidget* cw;
if ((cw=bbCreateWidgetOfInput("Widget1",w)) != 0) l->addWidget(cw);
if ((cw=bbCreateWidgetOfInput("Widget2",w)) != 0) l->addWidget(cw);
+ if ((cw=bbCreateWidgetOfInput("Widget3",w)) != 0) l->addWidget(cw);
+ if ((cw=bbCreateWidgetOfInput("Widget4",w)) != 0) l->addWidget(cw);
+ if ((cw=bbCreateWidgetOfInput("Widget5",w)) != 0) l->addWidget(cw);
+ if ((cw=bbCreateWidgetOfInput("Widget6",w)) != 0) l->addWidget(cw);
+ if ((cw=bbCreateWidgetOfInput("Widget7",w)) != 0) l->addWidget(cw);
+ if ((cw=bbCreateWidgetOfInput("Widget8",w)) != 0) l->addWidget(cw);
+ if ((cw=bbCreateWidgetOfInput("Widget9",w)) != 0) l->addWidget(cw);
+
w->setLayout(l);
/*=========================================================================
Program: bbtk
- Module: $RCSfile: bbqtQLayoutLine.h,v $
+ Module: $RCSfile: bbqtLayoutLine.h,v $
Language: C++
- Date: $Date: 2009/04/08 07:56:33 $
+ Date: $Date: 2009/04/08 08:35:59 $
Version: $Revision: 1.1 $
=========================================================================*/
--- /dev/null
+/*=========================================================================
+ Program: bbtk
+ Module: $RCSfile: bbqtLayoutSplit.cxx,v $
+ Language: C++
+ Date: $Date: 2009/04/08 08:35:59 $
+ Version: $Revision: 1.1 $
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+* 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.
+* ------------------------------------------------------------------------ */
+
+/**
+ * \file
+ * \brief
+ */
+
+
+#ifdef USE_QT
+
+#include "bbqtLayoutSplit.h"
+#include "bbqtPackage.h"
+#include "bbtkUtilities.h"
+
+#include <QSplitter>
+
+namespace bbqt
+{
+ BBTK_ADD_BLACK_BOX_TO_PACKAGE(qt,LayoutSplit);
+ BBTK_BLACK_BOX_IMPLEMENTATION(LayoutSplit,bbtk::QtBlackBox);
+
+ void LayoutSplit::bbUserConstructor()
+ {
+ bbSetInputOrientation("VERTICAL");
+ // bbSetInputProportion(50);
+
+ bbSetInputWidget1(NULL);
+ bbSetInputWidget2(NULL);
+ bbSetInputWidget3(NULL);
+ bbSetInputWidget4(NULL);
+ bbSetInputWidget5(NULL);
+ bbSetInputWidget6(NULL);
+ bbSetInputWidget7(NULL);
+ bbSetInputWidget8(NULL);
+ bbSetInputWidget9(NULL);
+
+ bbSetInputWeight1(1);
+ bbSetInputWeight2(1);
+ bbSetInputWeight3(1);
+ bbSetInputWeight4(1);
+ bbSetInputWeight5(1);
+ bbSetInputWeight6(1);
+ bbSetInputWeight7(1);
+ bbSetInputWeight8(1);
+ bbSetInputWeight9(1);
+ }
+
+ void LayoutSplit::Process()
+ {
+ }
+
+ void LayoutSplit::CreateWidget(QWidget* parent)
+ {
+ Qt::Orientation ori;
+ if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
+ "0|H|HORIZONTAL")==true)
+ { ori = Qt::Horizontal; }
+ if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
+ "1|V|VERTICAL")==true)
+ { ori = Qt::Vertical; }
+
+ QSplitter* w = new QSplitter(ori,parent);
+ QWidget* c;
+ int i=0;
+ if ((c=bbCreateWidgetOfInput("Widget1",w))!=0)
+ {
+ w->addWidget(c);
+ w->setStretchFactor(i,bbGetInputWeight1());
+ i++;
+ }
+ if ((c=bbCreateWidgetOfInput("Widget2",w))!=0)
+ {
+ w->addWidget(c);
+ w->setStretchFactor(i,bbGetInputWeight2());
+ i++;
+ }
+ if ((c=bbCreateWidgetOfInput("Widget3",w))!=0)
+ {
+ w->addWidget(c);
+ w->setStretchFactor(i,bbGetInputWeight3());
+ i++;
+ }
+ if ((c=bbCreateWidgetOfInput("Widget4",w))!=0)
+ {
+ w->addWidget(c);
+ w->setStretchFactor(i,bbGetInputWeight4());
+ i++;
+ }
+ if ((c=bbCreateWidgetOfInput("Widget5",w))!=0)
+ {
+ w->addWidget(c);
+ w->setStretchFactor(i,bbGetInputWeight5());
+ i++;
+ }
+ if ((c=bbCreateWidgetOfInput("Widget6",w))!=0)
+ {
+ w->addWidget(c);
+ w->setStretchFactor(i,bbGetInputWeight6());
+ i++;
+ }
+ if ((c=bbCreateWidgetOfInput("Widget7",w))!=0)
+ {
+ w->addWidget(c);
+ w->setStretchFactor(i,bbGetInputWeight7());
+ i++;
+ }
+ if ((c=bbCreateWidgetOfInput("Widget8",w))!=0)
+ {
+ w->addWidget(c);
+ w->setStretchFactor(i,bbGetInputWeight8());
+ i++;
+ }
+ if ((c=bbCreateWidgetOfInput("Widget9",w))!=0)
+ {
+ w->addWidget(c);
+ w->setStretchFactor(i,bbGetInputWeight9());
+ i++;
+ }
+
+ bbSetOutputWidget( w );
+ }
+
+
+ // This callback is necessary to get actual processing of the view
+ // when window is shown
+ void LayoutSplit::OnShowWidget()
+ {
+ bbUserOnShowWidget("Widget1");
+ bbUserOnShowWidget("Widget2");
+ bbUserOnShowWidget("Widget3");
+ bbUserOnShowWidget("Widget4");
+ bbUserOnShowWidget("Widget5");
+ bbUserOnShowWidget("Widget6");
+ bbUserOnShowWidget("Widget7");
+ bbUserOnShowWidget("Widget8");
+ bbUserOnShowWidget("Widget9");
+ }
+
+
+
+}//namespace bbqt
+
+#endif // USE_QT
+
--- /dev/null
+/*=========================================================================
+ Program: bbtk
+ Module: $RCSfile: bbqtLayoutSplit.h,v $
+ Language: C++
+ Date: $Date: 2009/04/08 08:35:59 $
+ Version: $Revision: 1.1 $
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+* 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.
+* ------------------------------------------------------------------------ */
+
+
+/**
+ */
+/**
+ * \file
+ * \brief Widget which splits a window into two parts
+ */
+/**
+ * \class bbqt::LayoutSplit
+ * \brief Widget which splits a window into two parts
+ */
+
+
+#ifdef USE_QT
+
+
+#ifndef __bbqtQLayoutSplit_h__
+#define __bbqtQLayoutSplit_h__
+
+#include "bbtkQtBlackBox.h"
+#include "bbqt_EXPORT.h"
+
+namespace bbqt
+{
+
+
+
+
+ //=================================================================
+ class bbqt_EXPORT LayoutSplit : public bbtk::QtBlackBox
+ {
+
+ BBTK_BLACK_BOX_INTERFACE(LayoutSplit,bbtk::QtBlackBox);
+ BBTK_DECLARE_INPUT(Widget1,QWidget*);
+ BBTK_DECLARE_INPUT(Widget2,QWidget*);
+ BBTK_DECLARE_INPUT(Widget3,QWidget*);
+ BBTK_DECLARE_INPUT(Widget4,QWidget*);
+ BBTK_DECLARE_INPUT(Widget5,QWidget*);
+ BBTK_DECLARE_INPUT(Widget6,QWidget*);
+ BBTK_DECLARE_INPUT(Widget7,QWidget*);
+ BBTK_DECLARE_INPUT(Widget8,QWidget*);
+ BBTK_DECLARE_INPUT(Widget9,QWidget*);
+
+ BBTK_DECLARE_INPUT(Weight1,int);
+ BBTK_DECLARE_INPUT(Weight2,int);
+ BBTK_DECLARE_INPUT(Weight3,int);
+ BBTK_DECLARE_INPUT(Weight4,int);
+ BBTK_DECLARE_INPUT(Weight5,int);
+ BBTK_DECLARE_INPUT(Weight6,int);
+ BBTK_DECLARE_INPUT(Weight7,int);
+ BBTK_DECLARE_INPUT(Weight8,int);
+ BBTK_DECLARE_INPUT(Weight9,int);
+
+ BBTK_DECLARE_INPUT(Orientation,std::string);
+ // BBTK_DECLARE_INPUT(Proportion,int);
+ BBTK_PROCESS(Process);
+ BBTK_CREATE_WIDGET(CreateWidget);
+ BBTK_ON_SHOW_WIDGET(OnShowWidget);
+
+ void Process();
+ void CreateWidget(QWidget*);
+ void OnShowWidget();
+
+ protected:
+ virtual void bbUserConstructor();
+
+ };
+ //=================================================================
+
+
+ //=================================================================
+ // BlackBox description
+ BBTK_BEGIN_DESCRIBE_BLACK_BOX(LayoutSplit,bbtk::QtBlackBox);
+ BBTK_NAME("QLayoutSplit");
+ BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
+ BBTK_DESCRIPTION("Widget which splits a window in two resizable parts (QSplitter)");
+ BBTK_INPUT(LayoutSplit,Widget1,"First widget to layout (upper or left most)",QWidget*,"");
+ BBTK_INPUT(LayoutSplit,Widget2,"Second widget",QWidget*,"");
+ BBTK_INPUT(LayoutSplit,Widget3,"Third widget",QWidget*,"");
+ BBTK_INPUT(LayoutSplit,Widget4,"Fourth widget",QWidget*,"");
+ BBTK_INPUT(LayoutSplit,Widget5,"Fifth widget",QWidget*,"");
+ BBTK_INPUT(LayoutSplit,Widget6,"Sixth widget",QWidget*,"");
+ BBTK_INPUT(LayoutSplit,Widget7,"Seventh widget",QWidget*,"");
+ BBTK_INPUT(LayoutSplit,Widget8,"Eighth widget",QWidget*,"");
+ BBTK_INPUT(LayoutSplit,Widget9,"Nineth widget",QWidget*,"");
+
+ BBTK_INPUT(LayoutSplit,Weight1,"Weight of the widget 1",int,"");
+ BBTK_INPUT(LayoutSplit,Weight2,"Weight of the widget 2",int,"");
+ BBTK_INPUT(LayoutSplit,Weight3,"Weight of the widget 3",int,"");
+ BBTK_INPUT(LayoutSplit,Weight4,"Weight of the widget 4",int,"");
+ BBTK_INPUT(LayoutSplit,Weight5,"Weight of the widget 5",int,"");
+ BBTK_INPUT(LayoutSplit,Weight6,"Weight of the widget 6",int,"");
+ BBTK_INPUT(LayoutSplit,Weight7,"Weight of the widget 7",int,"");
+ BBTK_INPUT(LayoutSplit,Weight8,"Weight of the widget 8",int,"");
+ BBTK_INPUT(LayoutSplit,Weight9,"Weight of the widget 9",int,"");
+
+
+ BBTK_INPUT(LayoutSplit,Orientation,"Orientation (default H), 0=H=HORIZONTAL , 1=V=VERTICAL",std::string,"");
+ // BBTK_INPUT(LayoutSplit,Proportion,"Proportion (in percent) of the first children in the window",int,"");
+ BBTK_END_DESCRIBE_BLACK_BOX(LayoutSplit);
+ //=================================================================
+}
+
+//namespace bbqt
+#endif //__bbqtQtLayoutSplit_h__
+
+#endif //USE_QT
-#include "bbqtQOutputText.h"
+#include "bbqtOutputText.h"
#include "bbqtPackage.h"
#include <QLabel>
+++ /dev/null
-/*=========================================================================
- Program: bbtk
- Module: $RCSfile: bbqtQLayoutLine.cxx~,v $
- Language: C++
- Date: $Date: 2009/04/08 07:56:33 $
- Version: $Revision: 1.1 $
-=========================================================================*/
-
-/* ---------------------------------------------------------------------
-
-* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
-* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
-*
-* 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.
-* ------------------------------------------------------------------------ */
-
-
-/**
- * \file
- * \brief
- */
-
-
-#ifdef _USE_WXWIDGETS_
-
-#include "bbwxLayoutLine.h"
-#include "bbwxPackage.h"
-#include "bbtkUtilities.h"
-
-
-namespace bbwx
-{
- BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx, LayoutLine);
- BBTK_BLACK_BOX_IMPLEMENTATION(LayoutLine,bbtk::WxBlackBox);
-
- void LayoutLine::bbUserConstructor()
- {
- bbSetInputOrientation("VERTICAL");
- bbSetInputWidget1(NULL);
- bbSetInputWidget2(NULL);
- bbSetInputWidget3(NULL);
- bbSetInputWidget4(NULL);
- bbSetInputWidget5(NULL);
- bbSetInputWidget6(NULL);
- bbSetInputWidget7(NULL);
- bbSetInputWidget8(NULL);
- bbSetInputWidget9(NULL);
- }
-
- void LayoutLine::Process()
- {
- }
-
-
-/*
- void LayoutLine::TryInsertWindow(wxWindow *parent, wxWindow *w,wxBoxSizer *sizer)
- {
- if (w!=NULL)
- {
- w->Reparent(parent);
- sizer->Add(w, 1, wxEXPAND, 0);
- }
- }
- */
-
- void LayoutLine::CreateWidget(wxWindow* parent)
- {
- wxBoxSizer *sizer;
- wxPanel *w=new wxPanel(parent, //bbGetWxParent(),
- -1);
- w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
-
- int style=0;
- if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
- "0|H|HORIZONTAL")==true)
- { style=wxHORIZONTAL; }
- if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
- "1|V|VERTICAL")==true)
- { style=wxVERTICAL; }
-
- sizer = new wxBoxSizer(style);
-
- wxWindow* cw;
- if ((cw=bbCreateWidgetOfInput("Widget1",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
- if ((cw=bbCreateWidgetOfInput("Widget2",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
- if ((cw=bbCreateWidgetOfInput("Widget3",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
- if ((cw=bbCreateWidgetOfInput("Widget4",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
- if ((cw=bbCreateWidgetOfInput("Widget5",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
- if ((cw=bbCreateWidgetOfInput("Widget6",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
- if ((cw=bbCreateWidgetOfInput("Widget7",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
- if ((cw=bbCreateWidgetOfInput("Widget8",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
- if ((cw=bbCreateWidgetOfInput("Widget9",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
- /*
- TryInsertWindow(w,bbGetInputWidget1(),sizer);
- TryInsertWindow(w,bbGetInputWidget2(),sizer);
- TryInsertWindow(w,bbGetInputWidget3(),sizer);
- TryInsertWindow(w,bbGetInputWidget4(),sizer);
- TryInsertWindow(w,bbGetInputWidget5(),sizer);
- TryInsertWindow(w,bbGetInputWidget6(),sizer);
- TryInsertWindow(w,bbGetInputWidget7(),sizer);
- TryInsertWindow(w,bbGetInputWidget8(),sizer);
- TryInsertWindow(w,bbGetInputWidget9(),sizer);
- */
- w -> SetSizer(sizer);
- bbSetOutputWidget( w );
- }
-
- // This callback is necessary to get actual processing of the view
- // when window is shown
- void LayoutLine::OnShowWidget()
- {
- bbUserOnShowWidget("Widget1");
- bbUserOnShowWidget("Widget2");
- bbUserOnShowWidget("Widget3");
- bbUserOnShowWidget("Widget4");
- bbUserOnShowWidget("Widget5");
- bbUserOnShowWidget("Widget6");
- bbUserOnShowWidget("Widget7");
- bbUserOnShowWidget("Widget8");
- bbUserOnShowWidget("Widget9");
- }
-
-}//namespace bbwx
-
-#endif // _USE_WXWIDGETS_
-
+++ /dev/null
-/*=========================================================================
- Program: bbtk
- Module: $RCSfile: bbqtQLayoutLine.h~,v $
- Language: C++
- Date: $Date: 2009/04/08 07:56:33 $
- Version: $Revision: 1.1 $
-=========================================================================*/
-
-/* ---------------------------------------------------------------------
-
-* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
-* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
-*
-* 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.
-* ------------------------------------------------------------------------ */
-
-
-/**
- * \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_QTWIDGETS
-
-
-#ifndef __bbQtLayoutLine_h__
-#define __bbQtLayoutLine_h__
-
-#include "bbtkQtBlackBox.h"
-#include "bbqt_EXPORT.h"
-
-
-namespace bbqt
-{
-
-
-
- //===========================================================
- class bbqt_EXPORT LayoutLine : public bbtk::QtBlackBox
- {
-
- BBTK_BLACK_BOX_INTERFACE(LayoutLine,bbtk::QtBlackBox);
- BBTK_DECLARE_INPUT(Widget1,qtWindow*);
- BBTK_DECLARE_INPUT(Widget2,qtWindow*);
- BBTK_DECLARE_INPUT(Widget3,qtWindow*);
- BBTK_DECLARE_INPUT(Widget4,qtWindow*);
- BBTK_DECLARE_INPUT(Widget5,qtWindow*);
- BBTK_DECLARE_INPUT(Widget6,qtWindow*);
- BBTK_DECLARE_INPUT(Widget7,qtWindow*);
- BBTK_DECLARE_INPUT(Widget8,qtWindow*);
- BBTK_DECLARE_INPUT(Widget9,qtWindow*);
- BBTK_DECLARE_INPUT(Orientation,std::string);
- BBTK_PROCESS(Process);
- BBTK_CREATE_WIDGET(CreateWidget);
- BBTK_ON_SHOW_WIDGET(OnShowWidget);
-
- void Process();
- void CreateWidget(qtWindow*);
- void OnShowWidget();
-
- protected:
- virtual void bbUserConstructor();
- void TryInsertWindow(qtWindow *parent, qtWindow *w,qtBoxSizer *sizer);
-
- };
- //===========================================================
-
-
- //=================================================================
- // BlackBox description
- BBTK_BEGIN_DESCRIBE_BLACK_BOX(LayoutLine,bbtk::QtBlackBox);
- BBTK_NAME("LayoutLine");
- BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr");
- BBTK_DESCRIPTION("LayoutLine widget (qtBoxSizer)");
- // Already inserted for any QtBlackBox BBTK_CATEGORY("widget");
- BBTK_INPUT(LayoutLine,Widget1,"widget 1",qtWindow*,"");
- BBTK_INPUT(LayoutLine,Widget2,"widget 2",qtWindow*,"");
- BBTK_INPUT(LayoutLine,Widget3,"widget 3",qtWindow*,"");
- BBTK_INPUT(LayoutLine,Widget4,"widget 4",qtWindow*,"");
- BBTK_INPUT(LayoutLine,Widget5,"widget 5",qtWindow*,"");
- BBTK_INPUT(LayoutLine,Widget6,"widget 6",qtWindow*,"");
- BBTK_INPUT(LayoutLine,Widget7,"widget 7",qtWindow*,"");
- BBTK_INPUT(LayoutLine,Widget8,"widget 8",qtWindow*,"");
- BBTK_INPUT(LayoutLine,Widget9,"widget 9",qtWindow*,"");
- BBTK_INPUT(LayoutLine,Orientation,"Orientation (default V), 0=H=HORIZONTAL , 1=V=VERTICAL",std::string,"");
- BBTK_END_DESCRIBE_BLACK_BOX(LayoutLine);
- //=================================================================
-
-
-
-}
-
-
-
-//namespace bbtk
-#endif //__bbtkQtLayoutLine_h__
-
-#endif //USE_QTWIDGETS
+++ /dev/null
-#include "bbqtQOutputText.h"
-#include "bbqtPackage.h"
-#include <QLabel>
-
-namespace bbqt
-{
-
-BBTK_ADD_BLACK_BOX_TO_PACKAGE(qt,QOutputText)
-BBTK_BLACK_BOX_IMPLEMENTATION(QOutputText,bbtk::QtBlackBox);
-void QOutputText::Process()
-{
-
- std::string msg;
- if (bbGetInputTitle()!="")
- {
- msg = bbGetInputTitle()+": " + bbGetInputIn();
- }
- else
- {
- msg = bbGetInputIn();
- }
- ((QLabel*)bbGetOutputWidget())->setText( msg.c_str() );
- //SetLabel( bbtk::std2wx( msg ) );
-
-}
-void QOutputText::CreateWidget(QWidget* parent)
-{
-
- bbSetOutputWidget( new
- QLabel( parent ) );
- //wxStaticText ( bbGetWxParent() , -1 , _T("") ) );
- Process();
-
-}
-void QOutputText::bbUserConstructor()
-{
-
- bbSetInputIn("");
- bbSetInputTitle("");
-
-}
-void QOutputText::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
-{
-
-
-
-}
-void QOutputText::bbUserDestructor()
-{
-
-
-
-}
-}
-// EO namespace bbqt
-
-
+++ /dev/null
-#ifdef _USE_WXWIDGETS_
-#ifndef __bbqtQOutputText_h_INCLUDED__
-#define __bbqtQOutputText_h_INCLUDED__
-#include "bbqt_EXPORT.h"
-#include "bbtkQtBlackBox.h"
-
-namespace bbqt
-{
-
-class bbqt_EXPORT QOutputText
- :
- public bbtk::QtBlackBox
-{
- BBTK_BLACK_BOX_INTERFACE(QOutputText,bbtk::QtBlackBox);
-//==================================================================
-/// User callback called in the box contructor
-virtual void bbUserConstructor();
-/// User callback called in the box copy constructor
-virtual void bbUserCopyConstructor(bbtk::BlackBox::Pointer);
-/// User callback called in the box destructor
-virtual void bbUserDestructor();
-//==================================================================
- BBTK_DECLARE_INPUT(Title,std::string);
- BBTK_DECLARE_INPUT(In,std::string);
- BBTK_PROCESS(Process);
- void Process();
- BBTK_CREATE_WIDGET(CreateWidget);
- void CreateWidget(QWidget*);
-};
-
-BBTK_BEGIN_DESCRIBE_BLACK_BOX(QOutputText,bbtk::QtBlackBox);
-BBTK_NAME("QOutputText");
-BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
-BBTK_DESCRIPTION("OutputText");
-BBTK_CATEGORY("");
-BBTK_INPUT(QOutputText,Title,"Title prepended to the text",std::string,"");
-BBTK_INPUT(QOutputText,In,"Text",std::string,"");
-BBTK_END_DESCRIBE_BLACK_BOX(QOutputText);
-}
-// EO namespace bbqt
-
-#endif // __bbqtQOutputText_h_INCLUDED__
-#endif // _USE_WXWIDGETS_
-
+++ /dev/null
-/*=========================================================================
- Program: bbtk
- Module: $RCSfile: bbqtQSlider.cxx~,v $
- Language: C++
- Date: $Date: 2009/04/08 07:56:33 $
- Version: $Revision: 1.1 $
-=========================================================================*/
-
-/* ---------------------------------------------------------------------
-
-* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
-* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
-*
-* 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.
-* ------------------------------------------------------------------------ */
-
-/**
- * \file
- * \brief Short description in one line
- *
- * Long
- * description
- *
- */
-
-#ifdef USE_QT
-
-#include "bbqtQSlider.h"
-#include "bbqtPackage.h"
-#include "bbtkUtilities.h"
-
-namespace bbqt
-{
-
- /*
- //--------------------------------------------------------------------------
- // The widget created by the box
- class SliderWidget : public qtPanel
- {
- public:
- /// Ctor with the two first params the parent window and the creator box
- /// which must be passed to the QtBlackBoxWidget constructor.
- /// The other params initialize the widget
- SliderWidget(Slider* box, qtWindow *parent,
- int orientation,
- bool changeresolution,
- bool label,
- qtString title,
- int vmin,
- int vmax,
- int value,
- bool track);
- /// Dtor
- ~SliderWidget();
- /// Events callbacks
- /// Called when the slider is moved
- void OnSliderTrack(qtScrollEvent& event);
- /// Called when the slider is released
- void OnSliderRelease(qtScrollEvent& event);
- /// Called when the little slider which controls the resolution
- /// of the main slider is moved (if activated)
- void OnResolutionOfSlider(qtScrollEvent& event);
-
- // Accessors
- void SetValue(int v) { mqtSlider->SetValue(v); }
- int GetValue() { return mqtSlider->GetValue(); }
- void SetRange(int min, int max);
- // Update the texts which display the min/max/current values of the slider
- void RefreshLabels();
-
- private:
- Slider* mBox;
- qtSlider *mqtSlider;
- qtSlider *mResolutionOfSlider;
- int min;
- int max;
- bool reactiveOnTrack;
- qtStaticText *label_vertical;
- qtStaticText *label_min;
- qtStaticText *label_max;
- };
- //------------------------------------------------------------------------
- //------------------------------------------------------------------------
- //------------------------------------------------------------------------
-
-
-
- //-------------------------------------------------------------------------
- SliderWidget::SliderWidget(Slider* box, qtWindow *parent,
- int orientation,
- bool changeresolution,
- bool labels,
- qtString title,
- int vmin,
- int vmax,
- int value,
- bool reactiveontrack)
- :
- qtPanel( parent, -1, qtDefaultPosition, qtDefaultSize, qtTAB_TRAVERSAL),
- mBox(box),
- min(vmin),
- max(vmax),
- reactiveOnTrack(reactiveontrack)
- {
- qtPanel * panel = this;
-
- label_min = NULL;
- label_max = NULL;
- label_vertical = NULL;
- mResolutionOfSlider = NULL;
-
- int sizeX,sizeY;
- long qtlabels=0;
- long qtorientation=0;
- if (orientation==0)
- {
- sizeX = 2;
- sizeY = 40;
- qtorientation = qtSL_HORIZONTAL;
- if (labels==true)
- {
- qtlabels = qtSL_LABELS;
- }
- }
- else
- {
- sizeX = 20;
- sizeY = 2;
- qtorientation = qtSL_VERTICAL;
- }
-
- //---------------------------------------------------------------------
- // 1) Creation of the components of the widget
- // Any top level sub-widget must have the panel returned by panel
- // for parent
- mqtSlider = new qtSlider( panel,
- -1, 0 , 0, 500 ,
- qtDefaultPosition,
- qtSize(sizeX,sizeY),
- qtorientation | qtlabels );
-
- // mqtSlider->SetInitialSize(qtSize(sizeX,sizeY));
-
- // mqtSlider->SetTickFreq(100,0);
- mqtSlider->SetRange(min,max);
- mqtSlider->SetValue(value);
-
- // RefreshLabels();
-
- // Connecting events to callbacks
- Connect( mqtSlider->GetId(),
- qtEVT_SCROLL_THUMBRELEASE,
- (qtObjectEventFunction)
- (void (qtPanel::*)(qtScrollEvent&))
- &SliderWidget::OnSliderRelease );
-
- Connect( mqtSlider->GetId(),
- qtEVT_SCROLL_THUMBTRACK,
- (qtObjectEventFunction)
- (void (qtPanel::*)(qtScrollEvent&))
- &SliderWidget::OnSliderTrack );
-
- Connect( mqtSlider->GetId(),
- qtEVT_SCROLL_CHANGED,
- (qtObjectEventFunction)
- (void (qtPanel::*)(qtScrollEvent&))
- &SliderWidget::OnSliderTrack );
-
- // If asked : creation of the other little slider which allows to change
- // the resolution of the main slider
- if (changeresolution==true){
- // has panel for parent too
- mResolutionOfSlider = new qtSlider(panel,
- -1,5,1,10,
- qtDefaultPosition,
- qtSize(25,45),
- qtSL_VERTICAL |
- qtSL_AUTOTICKS |
- qtSL_LEFT );
-
-
- mResolutionOfSlider->SetRange(1,8);
- mResolutionOfSlider->SetValue(5);
- // Is qtEVT_COMMAND_SLIDER_UPDATED event
- // is connected to the method OnResolutionOfSlider
- Connect(mResolutionOfSlider->GetId(),
- qtEVT_COMMAND_SLIDER_UPDATED,
- (qtObjectEventFunction)
- (void (qtPanel::*)(qtScrollEvent&))
- &SliderWidget::OnResolutionOfSlider );
- }
- //---------------------------------------------------------------------
-
- //---------------------------------------------------------------------
- // 2) Insertion of the components in the window
-
- // We use a FlexGridSizer
- qtFlexGridSizer *sizer;
-
-
- if (orientation==0)
- {
- // HORIZONTAL
- if (mResolutionOfSlider!=NULL)
- {
- sizer = new qtFlexGridSizer(2);
- if (title!=_T(""))
- {
- sizer -> Add( new qtStaticText(panel,-1, title ) );
- sizer -> Add( new qtStaticText(panel,-1, _T("") ) );
- }
- }
- else
- {
- sizer = new qtFlexGridSizer(1);
- if (title!=_T(""))
- {
- sizer -> Add( new qtStaticText(panel,-1, title ) );
- }
- }
- sizer -> Add( mqtSlider,1,qtGROW );
- sizer -> AddGrowableCol(0);
- if (mResolutionOfSlider!=NULL)
- {
- sizer -> Add( mResolutionOfSlider );
- }
- }
- else
- {
- // VERTICAL
- sizer = new qtFlexGridSizer(1);
- if (labels==true) // with lable
- {
- label_vertical = new qtStaticText(panel,-1,_T(""));
- label_min = new qtStaticText(panel,-1,_T(""));
- label_max = new qtStaticText(panel,-1,_T(""));
- if (title!=_T(""))
- {
- sizer -> Add( new qtStaticText(panel,-1, title ) );
- sizer -> AddGrowableRow(3);
- }
- else
- {
- sizer -> AddGrowableRow(2);
- }
- sizer -> Add( label_vertical );
- sizer -> Add( label_min );
- sizer -> Add( mqtSlider,1,qtGROW );
- sizer -> Add( label_max );
- if (mResolutionOfSlider!=NULL)
- {
- sizer -> Add( mResolutionOfSlider );
- }
- }
- else
- {
- if (title!=_T(""))
- {
- sizer -> Add( new qtStaticText(panel,-1, title ) );
- sizer -> AddGrowableRow(1);
- }
- else
- {
- sizer -> AddGrowableRow(0);
- }
- sizer -> Add( mqtSlider,1,qtGROW );
- if (mResolutionOfSlider!=NULL)
- {
- sizer -> Add( mResolutionOfSlider );
- }
- }
- }
- // Initialize the labels
- RefreshLabels();
- // Insert the sizer in the main panel and refresh the layout
- panel->SetSizer(sizer);
- }
- //-------------------------------------------------------------------------
-
-
- //-------------------------------------------------------------------------
- SliderWidget::~SliderWidget()
- {
- }
- //-------------------------------------------------------------------------
-
-
- //-------------------------------------------------------------------------
- void SliderWidget::OnResolutionOfSlider(qtScrollEvent& event)
- {
- int value = mqtSlider->GetValue();
- int delta = (int) (pow( 4 , mResolutionOfSlider->GetValue() ));
- int minTmp = value - delta/2;
- int maxTmp = value + delta/2;
- if (minTmp<min)
- {
- minTmp = min;
- // maxTmp = delta;
- }
- if (maxTmp>max)
- {
- maxTmp = max;
- }
- mqtSlider->SetRange(minTmp,maxTmp);
- RefreshLabels();
- }
- //-------------------------------------------------------------------------
-
-
-
- //-------------------------------------------------------------------------
- void SliderWidget::OnSliderTrack(qtScrollEvent& event)
- {
- if(reactiveOnTrack)
- {
- // When user releases the slider
- // we update the output of the box
-
- mBox->bbSetOutputOut( mqtSlider->GetValue() );
- mBox->bbSetInputIn( mqtSlider->GetValue() );
- // and signal that the output has changed
- mBox->bbSignalOutputModification(std::string("Out"));
- }
- RefreshLabels();
- }
- //-------------------------------------------------------------------------
-
-
- //-------------------------------------------------------------------------
- void SliderWidget::OnSliderRelease(qtScrollEvent& event)
- {
- // When user releases the slider
- // we update the output of the box
- mBox->bbSetOutputOut( mqtSlider->GetValue() );
- mBox->bbSetInputIn( mqtSlider->GetValue() );
- // and signal that the output has changed
- mBox->bbSignalOutputModification(std::string("Out"));
- }
- //-------------------------------------------------------------------------
-
-
- //-------------------------------------------------------------------------
- void SliderWidget::RefreshLabels()
- {
- qtString strValue;
- if (label_vertical!=NULL)
- {
- strValue.Printf( _T("%d"), mqtSlider->GetValue() );
- label_vertical->SetLabel(strValue);
- }
- if (label_min!=NULL)
- {
- strValue.Printf( _T("%d"), mqtSlider->GetMin() );
- label_min->SetLabel(strValue);
- }
- if (label_max!=NULL)
- {
- strValue.Printf( _T("%d"), mqtSlider->GetMax() );
- label_max->SetLabel(strValue);
- }
- }
- //-------------------------------------------------------------------------
-
-
- //-------------------------------------------------------------------------
- void SliderWidget::SetRange(int min, int max)
- {
- this->min = min;
- this->max = max;
- mqtSlider->SetRange(min,max);
- RefreshLabels();
- }
- //-------------------------------------------------------------------------
-
- */
-
-
- //--------------------------------------------------------------------------
- //-------------------------------------------------------------------------
- // QtBlackBox implementation
- //--------------------------------------------------------------------------
- //--------------------------------------------------------------------------
-
- //--------------------------------------------------------------------------
- BBTK_BLACK_BOX_IMPLEMENTATION(Slider,bbtk::QtBlackBox);
- BBTK_ADD_BLACK_BOX_TO_PACKAGE(qt,Slider);
-
- //--------------------------------------------------------------------------
- void Slider::bbUserConstructor()
- {
- bbSetInputIn(0);
- bbSetInputMin(0);
- bbSetInputMax(500);
- bbSetOutputOut(0);
- bbSetInputOrientation("HORIZONTAL");
- bbSetInputChangeResolution(false);
- bbSetInputLabel(true);
- bbSetInputReactiveOnTrack(false);
- }
- //--------------------------------------------------------------------------
-
- //--------------------------------------------------------------------------
- void Slider::Process()
- {
- bbtkDebugMessage("process",3,
- "Slider "<<bbGetName()<<" input="
- <<bbGetInputIn()<<std::endl);
-
- bbSetOutputOut( bbGetInputIn() );
- if (bbGetOutputWidget()!=0)
- {
- ((QSlider*)bbGetOutputWidget())->setValue(bbGetInputIn());
- }
- }
- //--------------------------------------------------------------------------
-
- //--------------------------------------------------------------------------
- void Slider::CreateWidget(QWidget* parent)
- {
-
- Qt::Orientation orientation;
- if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|H|HORIZONTAL")
- ==true)
- { orientation = Qt::Horizontal; }
- if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|VERTICAL")
- ==true)
- { orientation = Qt::Vertical ; }
-
-
- // std::cout << "bbGetQtParent = "<<bbGetQtParent()<<std::endl;
- QSlider *w = new QSlider(parent);
- w->setOrientation(orientation);
- w->setMinimum( bbGetInputMin() );
- w->setMaximum( bbGetInputMax() );
- w->setSliderPosition ( bbGetInputIn() );
-
- if (bbGetInputReactiveOnTrack())
- w->setTracking(true);
- else
- w->setTracking(false);
-
- connect(w,SIGNAL(valueChanged(int)),this,SLOT(OnValueChanged(int)));
-
- w->setSizePolicy( QSizePolicy(QSizePolicy::Expanding,
- QSizePolicy::Expanding) );
-
- bbSetOutputWidget( w );
- }
- //--------------------------------------------------------------------------
-
- //--------------------------------------------------------------------------
- void Slider::OnValueChanged(int v)
- {
- std::cout << "OnValueChanged "<<v<<std::endl;
- bbSetOutputOut( v );
- bbSetInputIn( v );
- // and signal that the output has changed
- bbSignalOutputModification(std::string("Out"));
-
- }
- //--------------------------------------------------------------------------
-
-
-} //namespace bbqt
-
-#endif // USE_QT
-
-
+++ /dev/null
-/*=========================================================================
- Program: bbtk
- Module: $RCSfile: bbqtQSlider.h~,v $
- Language: C++
- Date: $Date: 2009/04/08 07:56:33 $
- Version: $Revision: 1.1 $
-=========================================================================*/
-
-/* ---------------------------------------------------------------------
-
-* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
-* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
-*
-* 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.
-* ------------------------------------------------------------------------ */
-
-/**
- * \file
- * \brief Short description in one line
- *
- * Long description which
- * can span multiple lines
-*/
-
-/**
- * \class bbqt::Slider
- * \brief
-
- * \class bbqt::SliderWidget
- * \brief
- */
-
-#ifdef USE_QT
-
-// Prevents multiple inclusions : use symbols of the form
-// __FILENAME_INCLUDED__
-// where FILENAME must be replaced by the actual file name
-#ifndef __bbqtSlider_h_INCLUDED__
-#define __bbqtSlider_h_INCLUDED__
-
-// Include qtBlackBox definition
-#include "bbtkQtBlackBox.h"
-
-#include "bbqt_EXPORT.h"
-
-
-// Namespace of the package "qt" is "bbqt"
-// Namespace associated to packages should be of the form :
-// bbPACKAGENAME
-namespace bbqt
-{
-
-
-
-
- //------------------------------------------------------------------------
- // The black box
- class bbqt_EXPORT Slider : public bbtk::QtBlackBox
- {
-
- BBTK_BLACK_BOX_INTERFACE(Slider,bbtk::QtBlackBox);
- BBTK_DECLARE_INPUT(In,int);
- BBTK_DECLARE_INPUT(Min,int);
- BBTK_DECLARE_INPUT(Max,int);
- BBTK_DECLARE_INPUT(Label,bool);
- BBTK_DECLARE_INPUT(Title,std::string);
- BBTK_DECLARE_INPUT(Orientation,std::string);
- BBTK_DECLARE_INPUT(ChangeResolution,bool);
- BBTK_DECLARE_INPUT(ReactiveOnTrack,bool);
- BBTK_DECLARE_OUTPUT(Out,int);
- BBTK_PROCESS(Process);
- BBTK_CREATE_WIDGET(CreateWidget);
- void Process();
- void CreateWidget(QWidget*);
-
- protected:
- virtual void bbUserConstructor();
- };
- //=================================================================
-
- //=================================================================
- // the black box description
- BBTK_BEGIN_DESCRIBE_BLACK_BOX(Slider,bbtk::QtBlackBox);
- BBTK_NAME("Slider");
- BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
- // Already inserted for any QtBlackBox BBTK_CATEGORY("widget");
- BBTK_DESCRIPTION("Slider widget (QSlider)");
- BBTK_INPUT(Slider,In,"Initial position of the slider (default 0)",int,"");
- BBTK_INPUT(Slider,Min,"Minimum value of the slider (default 0)",int,"");
- BBTK_INPUT(Slider,Max,"Maximum value of the slider (default 500)",int,"");
- BBTK_INPUT(Slider,Label,"Show slider labels ? (default FALSE) ",bool,"");
- BBTK_INPUT(Slider,Title,"Title shown above the slider (default '') ", std::string,"");
- BBTK_INPUT(Slider,Orientation, "Orientation : (default H) 0=H=HORIZONTAL, 1=V=VERTICAL ",std::string,"");
- BBTK_INPUT(Slider,ChangeResolution, "Can the user change the resolution of the slider ? (default FALSE) ",bool,"");
- BBTK_INPUT(Slider,ReactiveOnTrack, "Slider sends info when track moves (default : FALSE)",bool,"");
- BBTK_OUTPUT(Slider,Out,"Current position of the slider",int,"");
- BBTK_END_DESCRIBE_BLACK_BOX(Slider);
- //=================================================================
-
-
-
-} //namespace bbqt
-
-#endif //__bbtkqtSlider_h_INCLUDED__
-
-#endif //USE_QT
/*=========================================================================
Program: bbtk
- Module: $RCSfile: bbqtQSlider.cxx,v $
+ Module: $RCSfile: bbqtSlider.cxx,v $
Language: C++
- Date: $Date: 2009/04/08 07:56:33 $
+ Date: $Date: 2009/04/08 08:36:00 $
Version: $Revision: 1.1 $
=========================================================================*/
#ifdef USE_QT
-#include "bbqtQSlider.h"
+#include "bbqtSlider.h"
#include "bbqtPackage.h"
#include "bbtkUtilities.h"
/*=========================================================================
Program: bbtk
- Module: $RCSfile: bbqtQSlider.h,v $
+ Module: $RCSfile: bbqtSlider.h,v $
Language: C++
- Date: $Date: 2009/04/08 07:56:33 $
+ Date: $Date: 2009/04/08 08:36:00 $
Version: $Revision: 1.1 $
=========================================================================*/