1 /*=========================================================================
3 Module: $RCSfile: bbwxLayoutTab.cxx,v $
5 Date: $Date: 2008/11/26 12:18:32 $
6 Version: $Revision: 1.9 $
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, const std::string& input )
70 wxWindow* w = bbCreateWidgetOfInput(input,book); //panel);
73 book->AddPage(w,w->GetName());
77 void LayoutTab::Process()
82 void LayoutTab::CreateWidget(wxWindow* parent)
84 long style = wxNB_TOP;
85 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|T|TOP")==true)
87 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|R|RIGHT")==true)
89 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"2|B|BOTTOM")==true)
90 { style=wxNB_BOTTOM; }
91 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"3|L|LEFT")==true)
93 wxNotebook *w = new wxNotebook(parent, //bbGetWxParent(),
98 w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
100 TryInsertWindow(w,"Widget1");
101 TryInsertWindow(w,"Widget2");
102 TryInsertWindow(w,"Widget3");
103 TryInsertWindow(w,"Widget4");
104 TryInsertWindow(w,"Widget5");
105 TryInsertWindow(w,"Widget6");
106 TryInsertWindow(w,"Widget7");
107 TryInsertWindow(w,"Widget8");
108 TryInsertWindow(w,"Widget9");
110 bbSetOutputWidget( w );
114 // This callback is necessary to get actual processing of the view
115 // when window is shown
116 void LayoutTab::OnShowWidget()
118 //bbGetOutputWidget()->Show();
119 wxNotebook* w = (wxNotebook*)bbGetOutputWidget();
122 if (w->GetPageCount()>0)
125 for (unsigned int i=0; i<w->GetPageCount(); ++i) w->AdvanceSelection();
127 bbUserOnShowWidget("Widget1");
128 bbUserOnShowWidget("Widget2");
129 bbUserOnShowWidget("Widget3");
130 bbUserOnShowWidget("Widget4");
131 bbUserOnShowWidget("Widget5");
132 bbUserOnShowWidget("Widget6");
133 bbUserOnShowWidget("Widget7");
134 bbUserOnShowWidget("Widget8");
135 bbUserOnShowWidget("Widget9");