1 /*=========================================================================
4 Module: $RCSfile: bbwxLayoutTab.cxx,v $
6 Date: $Date: 2008/02/19 18:31:36 $
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_
27 #include "bbwxLayoutTab.h"
28 #include "bbwxPackage.h"
29 #include "bbtkUtilities.h"
36 BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx , LayoutTab);
39 BBTK_USER_BLACK_BOX_IMPLEMENTATION(LayoutTab,bbtk::WxBlackBox);
41 void LayoutTab::bbUserConstructor()
43 bbSetInputOrientation("TOP");
44 bbSetInputWidget1(NULL);
45 bbSetInputWidget2(NULL);
46 bbSetInputWidget3(NULL);
47 bbSetInputWidget4(NULL);
48 bbSetInputWidget5(NULL);
49 bbSetInputWidget6(NULL);
50 bbSetInputWidget7(NULL);
51 bbSetInputWidget8(NULL);
52 bbSetInputWidget9(NULL);
55 void LayoutTab::TryInsertWindow(wxNotebook *book, wxWindow *widgetchild )
57 if (widgetchild!=NULL)
59 widgetchild->Reparent(book);
60 book->AddPage(widgetchild, widgetchild->GetName() );
65 void LayoutTab::Process()
70 void LayoutTab::CreateWidget()
72 long style = wxNB_TOP;
73 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|T|TOP")==true) { style=wxNB_TOP; }
74 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|R|RIGHT")==true) { style=wxNB_RIGHT; }
75 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"2|B|BOTTOM")==true) { style=wxNB_BOTTOM; }
76 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"3|L|LEFT")==true) { style=wxNB_LEFT; }
77 wxNotebook *w = new wxNotebook(bbGetWxParent(), -1, wxDefaultPosition,wxDefaultSize,style );
78 w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
80 TryInsertWindow(w,bbGetInputWidget1());
81 TryInsertWindow(w,bbGetInputWidget2());
82 TryInsertWindow(w,bbGetInputWidget3());
83 TryInsertWindow(w,bbGetInputWidget4());
84 TryInsertWindow(w,bbGetInputWidget5());
85 TryInsertWindow(w,bbGetInputWidget6());
86 TryInsertWindow(w,bbGetInputWidget7());
87 TryInsertWindow(w,bbGetInputWidget8());
88 TryInsertWindow(w,bbGetInputWidget9());
90 bbSetOutputWidget( w );