1 /*=========================================================================
3 Module: $RCSfile: bbwxLayoutTab.cxx,v $
5 Date: $Date: 2008/11/13 14:46:46 $
6 Version: $Revision: 1.6 $
7 =========================================================================*/
9 /* ---------------------------------------------------------------------
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
14 * This software is governed by the CeCILL-B license under French law and
15 * abiding by the rules of distribution of free software. You can use,
16 * modify and/ or redistribute the software under the terms of the CeCILL-B
17 * license as circulated by CEA, CNRS and INRIA at the following URL
18 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
19 * or in the file LICENSE.txt.
21 * As a counterpart to the access to the source code and rights to copy,
22 * modify and redistribute granted by the license, users are provided only
23 * with a limited warranty and the software's author, the holder of the
24 * economic rights, and the successive licensors have only limited
27 * The fact that you are presently reading this means that you have had
28 * knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */
37 #ifdef _USE_WXWIDGETS_
40 #include "bbwxLayoutTab.h"
41 #include "bbwxPackage.h"
42 #include "bbtkUtilities.h"
49 BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx , LayoutTab);
52 BBTK_BLACK_BOX_IMPLEMENTATION(LayoutTab,bbtk::WxBlackBox);
54 void LayoutTab::bbUserConstructor()
56 bbSetInputOrientation("TOP");
57 bbSetInputWidget1(NULL);
58 bbSetInputWidget2(NULL);
59 bbSetInputWidget3(NULL);
60 bbSetInputWidget4(NULL);
61 bbSetInputWidget5(NULL);
62 bbSetInputWidget6(NULL);
63 bbSetInputWidget7(NULL);
64 bbSetInputWidget8(NULL);
65 bbSetInputWidget9(NULL);
68 void LayoutTab::TryInsertWindow(wxNotebook *book, wxWindow *widgetchild )
70 if (widgetchild!=NULL)
72 widgetchild->Reparent(book);
73 book->AddPage(widgetchild, widgetchild->GetName() );
79 void LayoutTab::Process()
84 void LayoutTab::CreateWidget()
86 long style = wxNB_TOP;
87 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|T|TOP")==true) { style=wxNB_TOP; }
88 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|R|RIGHT")==true) { style=wxNB_RIGHT; }
89 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"2|B|BOTTOM")==true) { style=wxNB_BOTTOM; }
90 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"3|L|LEFT")==true) { style=wxNB_LEFT; }
91 wxNotebook *w = new wxNotebook(bbGetWxParent(), -1, wxDefaultPosition,wxDefaultSize,style );
92 w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
94 TryInsertWindow(w,bbGetInputWidget1());
95 TryInsertWindow(w,bbGetInputWidget2());
96 TryInsertWindow(w,bbGetInputWidget3());
97 TryInsertWindow(w,bbGetInputWidget4());
98 TryInsertWindow(w,bbGetInputWidget5());
99 TryInsertWindow(w,bbGetInputWidget6());
100 TryInsertWindow(w,bbGetInputWidget7());
101 TryInsertWindow(w,bbGetInputWidget8());
102 TryInsertWindow(w,bbGetInputWidget9());
105 bbSetOutputWidget( w );
109 // This callback is necessary to get actual processing of the view
110 // when window is shown
111 void LayoutTab::OnShowWidget()
113 bbGetOutputWidget()->Show();
114 bbUserOnShowWidget("Widget1");
115 bbUserOnShowWidget("Widget2");
116 bbUserOnShowWidget("Widget3");
117 bbUserOnShowWidget("Widget4");
118 bbUserOnShowWidget("Widget5");
119 bbUserOnShowWidget("Widget6");
120 bbUserOnShowWidget("Widget7");
121 bbUserOnShowWidget("Widget8");
122 bbUserOnShowWidget("Widget9");