1 /*=========================================================================
3 Module: $RCSfile: bbwxLayoutTab.cxx,v $
5 Date: $Date: 2009/05/28 08:12:17 $
6 Version: $Revision: 1.11 $
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 //-----------------------------------------------------------------
55 void LayoutTab::bbUserSetDefaultValues()
57 bbSetInputOrientation("TOP");
58 bbSetInputWidget1(NULL);
59 bbSetInputWidget2(NULL);
60 bbSetInputWidget3(NULL);
61 bbSetInputWidget4(NULL);
62 bbSetInputWidget5(NULL);
63 bbSetInputWidget6(NULL);
64 bbSetInputWidget7(NULL);
65 bbSetInputWidget8(NULL);
66 bbSetInputWidget9(NULL);
69 //-----------------------------------------------------------------
70 void LayoutTab::bbUserInitializeProcessing()
74 //-----------------------------------------------------------------
75 void LayoutTab::bbUserFinalizeProcessing()
80 //-----------------------------------------------------------------
81 void LayoutTab::TryInsertWindow(wxNotebook *book, const std::string& input )
83 wxWindow* w = bbCreateWidgetOfInput(input,book); //panel);
86 book->AddPage(w,w->GetName());
90 void LayoutTab::Process()
95 void LayoutTab::CreateWidget(wxWindow* parent)
97 long style = wxNB_TOP;
98 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|T|TOP")==true)
100 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|R|RIGHT")==true)
101 { style=wxNB_RIGHT; }
102 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"2|B|BOTTOM")==true)
103 { style=wxNB_BOTTOM; }
104 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"3|L|LEFT")==true)
106 wxNotebook *w = new wxNotebook(parent, //bbGetWxParent(),
111 w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
113 TryInsertWindow(w,"Widget1");
114 TryInsertWindow(w,"Widget2");
115 TryInsertWindow(w,"Widget3");
116 TryInsertWindow(w,"Widget4");
117 TryInsertWindow(w,"Widget5");
118 TryInsertWindow(w,"Widget6");
119 TryInsertWindow(w,"Widget7");
120 TryInsertWindow(w,"Widget8");
121 TryInsertWindow(w,"Widget9");
123 bbSetOutputWidget( w );
127 // This callback is necessary to get actual processing of the view
128 // when window is shown
129 void LayoutTab::OnShowWidget()
131 wxNotebook* w = (wxNotebook*)bbGetOutputWidget();
134 if (w->GetPageCount()>0)
137 for (unsigned int i=0; i<w->GetPageCount(); ++i) w->AdvanceSelection();