]> Creatis software - bbtk.git/blob - packages/wx/src/bbwxLayoutTab.cxx
*** empty log message ***
[bbtk.git] / packages / wx / src / bbwxLayoutTab.cxx
1 /*=========================================================================                                                                               
2   Program:   bbtk
3   Module:    $RCSfile: bbwxLayoutTab.cxx,v $
4   Language:  C++
5   Date:      $Date: 2008/11/24 15:45:51 $
6   Version:   $Revision: 1.7 $
7 =========================================================================*/
8
9 /* ---------------------------------------------------------------------
10
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
13 *
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.
20 *
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
25 *  liability. 
26 *
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 * ------------------------------------------------------------------------ */                                                                         
30
31 /**
32  *  \file 
33  *  \brief 
34  */
35
36
37 #ifdef _USE_WXWIDGETS_
38
39
40 #include "bbwxLayoutTab.h"
41 #include "bbwxPackage.h"
42 #include "bbtkUtilities.h"
43
44
45
46
47 namespace bbwx
48 {
49   BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx , LayoutTab);
50   
51
52   BBTK_BLACK_BOX_IMPLEMENTATION(LayoutTab,bbtk::WxBlackBox);
53   
54         void LayoutTab::bbUserConstructor() 
55         { 
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);
66         }
67 /*
68         void LayoutTab::TryInsertWindow(wxNotebook *book, wxWindow *widgetchild )
69         {
70                   if (widgetchild!=NULL)
71                   {
72                           widgetchild->Reparent(book);
73                           book->AddPage(widgetchild, widgetchild->GetName() );
74                           widgetchild->Show();
75                   }             
76         }
77 */
78
79         void LayoutTab::Process() 
80         { 
81         }
82
83           
84         void LayoutTab::CreateWidget(wxWindow* parent) 
85         { 
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(parent, //bbGetWxParent(),
92                                                                          -1, wxDefaultPosition,wxDefaultSize,style );
93           w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
94                   /*
95           TryInsertWindow(w,bbGetInputWidget1());
96           TryInsertWindow(w,bbGetInputWidget2());
97           TryInsertWindow(w,bbGetInputWidget3());
98           TryInsertWindow(w,bbGetInputWidget4());
99           TryInsertWindow(w,bbGetInputWidget5());
100           TryInsertWindow(w,bbGetInputWidget6());
101           TryInsertWindow(w,bbGetInputWidget7());
102           TryInsertWindow(w,bbGetInputWidget8());
103           TryInsertWindow(w,bbGetInputWidget9());
104 */
105
106           bbSetOutputWidget( w );
107         }
108   
109
110   // This callback is necessary to get actual processing of the view 
111   // when window is shown
112   void  LayoutTab::OnShowWidget()
113   {
114           bbGetOutputWidget()->Show();
115           bbUserOnShowWidget("Widget1");
116           bbUserOnShowWidget("Widget2");
117           bbUserOnShowWidget("Widget3");
118           bbUserOnShowWidget("Widget4");
119           bbUserOnShowWidget("Widget5");
120           bbUserOnShowWidget("Widget6");
121           bbUserOnShowWidget("Widget7");
122           bbUserOnShowWidget("Widget8");
123           bbUserOnShowWidget("Widget9");
124   }
125
126
127 }//namespace bbwx
128
129 #endif
130