1 /*=========================================================================
4 Module: $RCSfile: bbwxLayoutTab.cxx,v $
6 Date: $Date: 2008/10/06 09:05:07 $
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 "bbwxLayoutTab.h"
28 #include "bbwxPackage.h"
29 #include "bbtkUtilities.h"
36 BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx , LayoutTab);
39 BBTK_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() );
66 void LayoutTab::Process()
71 void LayoutTab::CreateWidget()
73 long style = wxNB_TOP;
74 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|T|TOP")==true) { style=wxNB_TOP; }
75 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|R|RIGHT")==true) { style=wxNB_RIGHT; }
76 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"2|B|BOTTOM")==true) { style=wxNB_BOTTOM; }
77 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"3|L|LEFT")==true) { style=wxNB_LEFT; }
78 wxNotebook *w = new wxNotebook(bbGetWxParent(), -1, wxDefaultPosition,wxDefaultSize,style );
79 w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
81 TryInsertWindow(w,bbGetInputWidget1());
82 TryInsertWindow(w,bbGetInputWidget2());
83 TryInsertWindow(w,bbGetInputWidget3());
84 TryInsertWindow(w,bbGetInputWidget4());
85 TryInsertWindow(w,bbGetInputWidget5());
86 TryInsertWindow(w,bbGetInputWidget6());
87 TryInsertWindow(w,bbGetInputWidget7());
88 TryInsertWindow(w,bbGetInputWidget8());
89 TryInsertWindow(w,bbGetInputWidget9());
92 bbSetOutputWidget( w );
96 // This callback is necessary to get actual processing of the view
97 // when window is shown
98 void LayoutTab::bbUserOnShow()
100 bbGetOutputWidget()->Show();
101 bbUserOnShowWidget("Widget1");
102 bbUserOnShowWidget("Widget2");
103 bbUserOnShowWidget("Widget3");
104 bbUserOnShowWidget("Widget4");
105 bbUserOnShowWidget("Widget5");
106 bbUserOnShowWidget("Widget6");
107 bbUserOnShowWidget("Widget7");
108 bbUserOnShowWidget("Widget8");
109 bbUserOnShowWidget("Widget9");