1 /*=========================================================================
4 Module: $RCSfile: bbwxLayoutLine.cxx,v $
6 Date: $Date: 2008/02/15 12:19:58 $
7 Version: $Revision: 1.1 $
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(),"0|H|HORIZONTAL")==true) { style=wxHORIZONTAL; }
71 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|VERTICAL")==true) { style=wxVERTICAL; }
73 sizer = new wxBoxSizer(style);
75 TryInsertWindow(w,bbGetInputWidget1(),sizer);
76 TryInsertWindow(w,bbGetInputWidget2(),sizer);
77 TryInsertWindow(w,bbGetInputWidget3(),sizer);
78 TryInsertWindow(w,bbGetInputWidget4(),sizer);
79 TryInsertWindow(w,bbGetInputWidget5(),sizer);
80 TryInsertWindow(w,bbGetInputWidget6(),sizer);
81 TryInsertWindow(w,bbGetInputWidget7(),sizer);
82 TryInsertWindow(w,bbGetInputWidget8(),sizer);
83 TryInsertWindow(w,bbGetInputWidget9(),sizer);
86 bbSetOutputWidget( w );
91 #endif // _USE_WXWIDGETS_