2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------ */
28 /*=========================================================================
30 Module: $RCSfile: bbwxLayoutTab.cxx,v $
32 Date: $Date: 2012/11/16 08:52:14 $
33 Version: $Revision: 1.12 $
34 =========================================================================*/
42 #ifdef _USE_WXWIDGETS_
45 #include "bbwxLayoutTab.h"
46 #include "bbwxPackage.h"
47 #include "bbtkUtilities.h"
54 BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx , LayoutTab);
57 BBTK_BLACK_BOX_IMPLEMENTATION(LayoutTab,bbtk::WxBlackBox);
59 //-----------------------------------------------------------------
60 void LayoutTab::bbUserSetDefaultValues()
62 bbSetInputOrientation("TOP");
63 bbSetInputWidget1(NULL);
64 bbSetInputWidget2(NULL);
65 bbSetInputWidget3(NULL);
66 bbSetInputWidget4(NULL);
67 bbSetInputWidget5(NULL);
68 bbSetInputWidget6(NULL);
69 bbSetInputWidget7(NULL);
70 bbSetInputWidget8(NULL);
71 bbSetInputWidget9(NULL);
74 //-----------------------------------------------------------------
75 void LayoutTab::bbUserInitializeProcessing()
79 //-----------------------------------------------------------------
80 void LayoutTab::bbUserFinalizeProcessing()
85 //-----------------------------------------------------------------
86 void LayoutTab::TryInsertWindow(wxNotebook *book, const std::string& input )
88 wxWindow* w = bbCreateWidgetOfInput(input,book); //panel);
91 book->AddPage(w,w->GetName());
95 void LayoutTab::Process()
100 void LayoutTab::CreateWidget(wxWindow* parent)
102 long style = wxNB_TOP;
103 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|T|TOP")==true)
105 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|R|RIGHT")==true)
106 { style=wxNB_RIGHT; }
107 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"2|B|BOTTOM")==true)
108 { style=wxNB_BOTTOM; }
109 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"3|L|LEFT")==true)
111 wxNotebook *w = new wxNotebook(parent, //bbGetWxParent(),
116 w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
118 TryInsertWindow(w,"Widget1");
119 TryInsertWindow(w,"Widget2");
120 TryInsertWindow(w,"Widget3");
121 TryInsertWindow(w,"Widget4");
122 TryInsertWindow(w,"Widget5");
123 TryInsertWindow(w,"Widget6");
124 TryInsertWindow(w,"Widget7");
125 TryInsertWindow(w,"Widget8");
126 TryInsertWindow(w,"Widget9");
128 bbSetOutputWidget( w );
132 // This callback is necessary to get actual processing of the view
133 // when window is shown
134 void LayoutTab::OnShowWidget()
136 wxNotebook* w = (wxNotebook*)bbGetOutputWidget();
139 if (w->GetPageCount()>0)
142 for (unsigned int i=0; i<w->GetPageCount(); ++i) w->AdvanceSelection();