1 /*=========================================================================
3 Module: $RCSfile: bbqtLayoutSplit.cxx,v $
5 Date: $Date: 2009/05/28 14:22:15 $
6 Version: $Revision: 1.3 $
7 =========================================================================*/
9 /* ---------------------------------------------------------------------
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
14 * This software is governed by the CeCILL-B license under French law and
15 * abiding by the rules of distribution of free software. You can use,
16 * modify and/ or redistribute the software under the terms of the CeCILL-B
17 * license as circulated by CEA, CNRS and INRIA at the following URL
18 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
19 * or in the file LICENSE.txt.
21 * As a counterpart to the access to the source code and rights to copy,
22 * modify and redistribute granted by the license, users are provided only
23 * with a limited warranty and the software's author, the holder of the
24 * economic rights, and the successive licensors have only limited
27 * The fact that you are presently reading this means that you have had
28 * knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */
39 #include "bbqtLayoutSplit.h"
40 #include "bbqtPackage.h"
41 #include "bbtkUtilities.h"
47 BBTK_ADD_BLACK_BOX_TO_PACKAGE(qt,LayoutSplit);
48 BBTK_BLACK_BOX_IMPLEMENTATION(LayoutSplit,bbtk::QtBlackBox);
51 void LayoutSplit::bbUserSetDefaultValues()
53 bbSetInputOrientation("VERTICAL");
54 // bbSetInputProportion(50);
56 bbSetInputWidget1(NULL);
57 bbSetInputWidget2(NULL);
58 bbSetInputWidget3(NULL);
59 bbSetInputWidget4(NULL);
60 bbSetInputWidget5(NULL);
61 bbSetInputWidget6(NULL);
62 bbSetInputWidget7(NULL);
63 bbSetInputWidget8(NULL);
64 bbSetInputWidget9(NULL);
78 void LayoutSplit::bbUserInitializeProcessing()
82 void LayoutSplit::bbUserFinalizeProcessing()
89 void LayoutSplit::Process()
93 void LayoutSplit::CreateWidget(QWidget* parent)
96 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
97 "0|H|HORIZONTAL")==true)
98 { ori = Qt::Horizontal; }
99 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
100 "1|V|VERTICAL")==true)
101 { ori = Qt::Vertical; }
103 QSplitter* w = new QSplitter(ori,parent);
106 if ((c=bbCreateWidgetOfInput("Widget1",w))!=0)
109 w->setStretchFactor(i,bbGetInputWeight1());
112 if ((c=bbCreateWidgetOfInput("Widget2",w))!=0)
115 w->setStretchFactor(i,bbGetInputWeight2());
118 if ((c=bbCreateWidgetOfInput("Widget3",w))!=0)
121 w->setStretchFactor(i,bbGetInputWeight3());
124 if ((c=bbCreateWidgetOfInput("Widget4",w))!=0)
127 w->setStretchFactor(i,bbGetInputWeight4());
130 if ((c=bbCreateWidgetOfInput("Widget5",w))!=0)
133 w->setStretchFactor(i,bbGetInputWeight5());
136 if ((c=bbCreateWidgetOfInput("Widget6",w))!=0)
139 w->setStretchFactor(i,bbGetInputWeight6());
142 if ((c=bbCreateWidgetOfInput("Widget7",w))!=0)
145 w->setStretchFactor(i,bbGetInputWeight7());
148 if ((c=bbCreateWidgetOfInput("Widget8",w))!=0)
151 w->setStretchFactor(i,bbGetInputWeight8());
154 if ((c=bbCreateWidgetOfInput("Widget9",w))!=0)
157 w->setStretchFactor(i,bbGetInputWeight9());
161 bbSetOutputWidget( w );
165 // This callback is necessary to get actual processing of the view
166 // when window is shown
167 void LayoutSplit::OnShowWidget()
170 bbUserOnShowWidget("Widget1");
171 bbUserOnShowWidget("Widget2");
172 bbUserOnShowWidget("Widget3");
173 bbUserOnShowWidget("Widget4");
174 bbUserOnShowWidget("Widget5");
175 bbUserOnShowWidget("Widget6");
176 bbUserOnShowWidget("Widget7");
177 bbUserOnShowWidget("Widget8");
178 bbUserOnShowWidget("Widget9");