2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------ */
28 /*=========================================================================
30 Module: $RCSfile: bbqtLayoutSplit.cxx,v $
32 Date: $Date: 2012/11/16 08:51:19 $
33 Version: $Revision: 1.4 $
34 =========================================================================*/
45 #include "bbqtLayoutSplit.h"
46 #include "bbqtPackage.h"
47 #include "bbtkUtilities.h"
53 BBTK_ADD_BLACK_BOX_TO_PACKAGE(qt,LayoutSplit);
54 BBTK_BLACK_BOX_IMPLEMENTATION(LayoutSplit,bbtk::QtBlackBox);
57 void LayoutSplit::bbUserSetDefaultValues()
59 bbSetInputOrientation("VERTICAL");
60 // bbSetInputProportion(50);
62 bbSetInputWidget1(NULL);
63 bbSetInputWidget2(NULL);
64 bbSetInputWidget3(NULL);
65 bbSetInputWidget4(NULL);
66 bbSetInputWidget5(NULL);
67 bbSetInputWidget6(NULL);
68 bbSetInputWidget7(NULL);
69 bbSetInputWidget8(NULL);
70 bbSetInputWidget9(NULL);
84 void LayoutSplit::bbUserInitializeProcessing()
88 void LayoutSplit::bbUserFinalizeProcessing()
95 void LayoutSplit::Process()
99 void LayoutSplit::CreateWidget(QWidget* parent)
102 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
103 "0|H|HORIZONTAL")==true)
104 { ori = Qt::Horizontal; }
105 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
106 "1|V|VERTICAL")==true)
107 { ori = Qt::Vertical; }
109 QSplitter* w = new QSplitter(ori,parent);
112 if ((c=bbCreateWidgetOfInput("Widget1",w))!=0)
115 w->setStretchFactor(i,bbGetInputWeight1());
118 if ((c=bbCreateWidgetOfInput("Widget2",w))!=0)
121 w->setStretchFactor(i,bbGetInputWeight2());
124 if ((c=bbCreateWidgetOfInput("Widget3",w))!=0)
127 w->setStretchFactor(i,bbGetInputWeight3());
130 if ((c=bbCreateWidgetOfInput("Widget4",w))!=0)
133 w->setStretchFactor(i,bbGetInputWeight4());
136 if ((c=bbCreateWidgetOfInput("Widget5",w))!=0)
139 w->setStretchFactor(i,bbGetInputWeight5());
142 if ((c=bbCreateWidgetOfInput("Widget6",w))!=0)
145 w->setStretchFactor(i,bbGetInputWeight6());
148 if ((c=bbCreateWidgetOfInput("Widget7",w))!=0)
151 w->setStretchFactor(i,bbGetInputWeight7());
154 if ((c=bbCreateWidgetOfInput("Widget8",w))!=0)
157 w->setStretchFactor(i,bbGetInputWeight8());
160 if ((c=bbCreateWidgetOfInput("Widget9",w))!=0)
163 w->setStretchFactor(i,bbGetInputWeight9());
167 bbSetOutputWidget( w );
171 // This callback is necessary to get actual processing of the view
172 // when window is shown
173 void LayoutSplit::OnShowWidget()
176 bbUserOnShowWidget("Widget1");
177 bbUserOnShowWidget("Widget2");
178 bbUserOnShowWidget("Widget3");
179 bbUserOnShowWidget("Widget4");
180 bbUserOnShowWidget("Widget5");
181 bbUserOnShowWidget("Widget6");
182 bbUserOnShowWidget("Widget7");
183 bbUserOnShowWidget("Widget8");
184 bbUserOnShowWidget("Widget9");