1 /*=========================================================================
4 Module: $RCSfile: bbwxLayoutLine.cxx,v $
6 Date: $Date: 2008/03/10 10:01:15 $
7 Version: $Revision: 1.2 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
24 #ifdef _USE_WXWIDGETS_
26 #include "bbwxLayoutLine.h"
27 #include "bbwxPackage.h"
28 #include "bbtkUtilities.h"
33 BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx, LayoutLine);
34 BBTK_USER_BLACK_BOX_IMPLEMENTATION(LayoutLine,bbtk::WxBlackBox);
36 void LayoutLine::bbUserConstructor()
38 bbSetInputOrientation("VERTICAL");
39 bbSetInputWidget1(NULL);
40 bbSetInputWidget2(NULL);
41 bbSetInputWidget3(NULL);
42 bbSetInputWidget4(NULL);
43 bbSetInputWidget5(NULL);
44 bbSetInputWidget6(NULL);
45 bbSetInputWidget7(NULL);
46 bbSetInputWidget8(NULL);
47 bbSetInputWidget9(NULL);
50 void LayoutLine::Process()
54 void LayoutLine::TryInsertWindow(wxWindow *parent, wxWindow *w,wxBoxSizer *sizer)
59 sizer->Add(w, 1, wxEXPAND, 0);
63 void LayoutLine::CreateWidget()
66 wxPanel *w=new wxPanel(bbGetWxParent(), -1);
67 w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
70 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
71 "0|H|HORIZONTAL")==true)
72 { style=wxHORIZONTAL; }
73 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
74 "1|V|VERTICAL")==true)
77 sizer = new wxBoxSizer(style);
79 TryInsertWindow(w,bbGetInputWidget1(),sizer);
80 TryInsertWindow(w,bbGetInputWidget2(),sizer);
81 TryInsertWindow(w,bbGetInputWidget3(),sizer);
82 TryInsertWindow(w,bbGetInputWidget4(),sizer);
83 TryInsertWindow(w,bbGetInputWidget5(),sizer);
84 TryInsertWindow(w,bbGetInputWidget6(),sizer);
85 TryInsertWindow(w,bbGetInputWidget7(),sizer);
86 TryInsertWindow(w,bbGetInputWidget8(),sizer);
87 TryInsertWindow(w,bbGetInputWidget9(),sizer);
90 bbSetOutputWidget( w );
95 #endif // _USE_WXWIDGETS_