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: bbwxLayoutLine.cxx,v $
32 Date: $Date: 2012/11/16 08:52:14 $
33 Version: $Revision: 1.10 $
34 =========================================================================*/
43 #ifdef _USE_WXWIDGETS_
45 #include "bbwxLayoutLine.h"
46 #include "bbwxPackage.h"
47 #include "bbtkUtilities.h"
52 BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx, LayoutLine);
53 BBTK_BLACK_BOX_IMPLEMENTATION(LayoutLine,bbtk::WxBlackBox);
55 //-----------------------------------------------------------------
56 void LayoutLine::bbUserSetDefaultValues()
58 bbSetInputOrientation("VERTICAL");
59 bbSetInputWidget1(NULL);
60 bbSetInputWidget2(NULL);
61 bbSetInputWidget3(NULL);
62 bbSetInputWidget4(NULL);
63 bbSetInputWidget5(NULL);
64 bbSetInputWidget6(NULL);
65 bbSetInputWidget7(NULL);
66 bbSetInputWidget8(NULL);
67 bbSetInputWidget9(NULL);
70 //-----------------------------------------------------------------
71 void LayoutLine::bbUserInitializeProcessing()
75 //-----------------------------------------------------------------
76 void LayoutLine::bbUserFinalizeProcessing()
81 void LayoutLine::Process()
88 void LayoutLine::TryInsertWindow(wxWindow *parent, wxWindow *w,wxBoxSizer *sizer)
93 sizer->Add(w, 1, wxEXPAND, 0);
98 void LayoutLine::CreateWidget(wxWindow* parent)
101 wxPanel *w=new wxPanel(parent, -1, wxDefaultPosition, wxSize(20,20) );
102 w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
105 if (bbtk::Utilities::loosematch(bbGetInputOrientation(), "0|H|HORIZONTAL")==true)
109 if (bbtk::Utilities::loosematch(bbGetInputOrientation(), "1|V|VERTICAL")==true)
114 sizer = new wxBoxSizer(style);
117 if ((cw=bbCreateWidgetOfInput("Widget1",w)) != 0) sizer->Add(cw, 1, wxGROW, 0);
118 if ((cw=bbCreateWidgetOfInput("Widget2",w)) != 0) sizer->Add(cw, 1, wxGROW, 0);
119 if ((cw=bbCreateWidgetOfInput("Widget3",w)) != 0) sizer->Add(cw, 1, wxGROW, 0);
120 if ((cw=bbCreateWidgetOfInput("Widget4",w)) != 0) sizer->Add(cw, 1, wxGROW, 0);
121 if ((cw=bbCreateWidgetOfInput("Widget5",w)) != 0) sizer->Add(cw, 1, wxGROW, 0);
122 if ((cw=bbCreateWidgetOfInput("Widget6",w)) != 0) sizer->Add(cw, 1, wxGROW, 0);
123 if ((cw=bbCreateWidgetOfInput("Widget7",w)) != 0) sizer->Add(cw, 1, wxGROW, 0);
124 if ((cw=bbCreateWidgetOfInput("Widget8",w)) != 0) sizer->Add(cw, 1, wxGROW, 0);
125 if ((cw=bbCreateWidgetOfInput("Widget9",w)) != 0) sizer->Add(cw, 1, wxGROW, 0);
127 TryInsertWindow(w,bbGetInputWidget1(),sizer);
128 TryInsertWindow(w,bbGetInputWidget2(),sizer);
129 TryInsertWindow(w,bbGetInputWidget3(),sizer);
130 TryInsertWindow(w,bbGetInputWidget4(),sizer);
131 TryInsertWindow(w,bbGetInputWidget5(),sizer);
132 TryInsertWindow(w,bbGetInputWidget6(),sizer);
133 TryInsertWindow(w,bbGetInputWidget7(),sizer);
134 TryInsertWindow(w,bbGetInputWidget8(),sizer);
135 TryInsertWindow(w,bbGetInputWidget9(),sizer);
137 w -> SetSizer(sizer);
138 bbSetOutputWidget( w );
141 // This callback is necessary to get actual processing of the view
142 // when window is shown
143 void LayoutLine::OnShowWidget()
149 #endif // _USE_WXWIDGETS_