1 /*=========================================================================
4 Module: $RCSfile: bbwxSizer.cxx,v $
6 Date: $Date: 2008/02/08 14:58:31 $
7 Version: $Revision: 1.4 $
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_
27 #include "bbwxSizer.h"
28 #include "bbwxPackage.h"
29 #include "bbtkUtilities.h"
37 BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx , Sizer);
40 BBTK_USER_BLACK_BOX_IMPLEMENTATION(Sizer,bbtk::WxBlackBox);
42 void Sizer::bbUserConstructor()
44 bbSetInputOrientation("VERTICAL");
45 bbSetInputWidget1(NULL);
46 bbSetInputWidget2(NULL);
47 bbSetInputWidget3(NULL);
48 bbSetInputWidget4(NULL);
49 bbSetInputWidget5(NULL);
50 bbSetInputWidget6(NULL);
51 bbSetInputWidget7(NULL);
52 bbSetInputWidget8(NULL);
53 bbSetInputWidget9(NULL);
56 void Sizer::TryInsertWindow(wxWindow *parent, wxWindow *w,wxBoxSizer *sizer)
61 sizer->Add(w, 1, wxEXPAND, 0);
71 void Sizer::CreateWidget()
74 wxPanel *w=new wxPanel(bbGetWxParent(), -1);
75 w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
78 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|H|HORIZONTAL")==true) { style=wxHORIZONTAL; }
79 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|VERTICAL")==true) { style=wxVERTICAL; }
81 sizer = new wxBoxSizer(style);
83 TryInsertWindow(w,bbGetInputWidget1(),sizer);
84 TryInsertWindow(w,bbGetInputWidget2(),sizer);
85 TryInsertWindow(w,bbGetInputWidget3(),sizer);
86 TryInsertWindow(w,bbGetInputWidget4(),sizer);
87 TryInsertWindow(w,bbGetInputWidget5(),sizer);
88 TryInsertWindow(w,bbGetInputWidget6(),sizer);
89 TryInsertWindow(w,bbGetInputWidget7(),sizer);
90 TryInsertWindow(w,bbGetInputWidget8(),sizer);
91 TryInsertWindow(w,bbGetInputWidget9(),sizer);
94 bbSetOutputWidget( w );