]> Creatis software - bbtk.git/blob - packages/wx/src/bbwxLayoutTab.cxx
*** empty log message ***
[bbtk.git] / packages / wx / src / bbwxLayoutTab.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   bbtk
4   Module:    $RCSfile: bbwxLayoutTab.cxx,v $
5   Language:  C++
6   Date:      $Date: 2008/02/19 18:31:36 $
7   Version:   $Revision: 1.1 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*/
18 /**
19  *  \file 
20  *  \brief 
21  */
22
23
24 #ifdef _USE_WXWIDGETS_
25
26
27 #include "bbwxLayoutTab.h"
28 #include "bbwxPackage.h"
29 #include "bbtkUtilities.h"
30
31
32
33
34 namespace bbwx
35 {
36   BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx , LayoutTab);
37   
38
39   BBTK_USER_BLACK_BOX_IMPLEMENTATION(LayoutTab,bbtk::WxBlackBox);
40   
41         void LayoutTab::bbUserConstructor() 
42         { 
43                 bbSetInputOrientation("TOP");
44                 bbSetInputWidget1(NULL);
45                 bbSetInputWidget2(NULL);
46                 bbSetInputWidget3(NULL);
47                 bbSetInputWidget4(NULL);
48                 bbSetInputWidget5(NULL);
49                 bbSetInputWidget6(NULL);
50                 bbSetInputWidget7(NULL);
51                 bbSetInputWidget8(NULL);
52                 bbSetInputWidget9(NULL);
53         }
54
55         void LayoutTab::TryInsertWindow(wxNotebook *book, wxWindow *widgetchild )
56         {
57                   if (widgetchild!=NULL)
58                   {
59                           widgetchild->Reparent(book);
60                           book->AddPage(widgetchild,  widgetchild->GetName() );
61                   }             
62         }
63
64
65         void LayoutTab::Process() 
66         { 
67         }
68
69           
70         void LayoutTab::CreateWidget() 
71         { 
72           long style = wxNB_TOP;
73           if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|T|TOP")==true)     { style=wxNB_TOP; }
74           if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|R|RIGHT")==true)   { style=wxNB_RIGHT; }
75           if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"2|B|BOTTOM")==true)  { style=wxNB_BOTTOM; }
76           if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"3|L|LEFT")==true)    { style=wxNB_LEFT; }
77           wxNotebook *w = new wxNotebook(bbGetWxParent(), -1, wxDefaultPosition,wxDefaultSize,style );
78           w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
79                   
80           TryInsertWindow(w,bbGetInputWidget1());
81           TryInsertWindow(w,bbGetInputWidget2());
82           TryInsertWindow(w,bbGetInputWidget3());
83           TryInsertWindow(w,bbGetInputWidget4());
84           TryInsertWindow(w,bbGetInputWidget5());
85           TryInsertWindow(w,bbGetInputWidget6());
86           TryInsertWindow(w,bbGetInputWidget7());
87           TryInsertWindow(w,bbGetInputWidget8());
88           TryInsertWindow(w,bbGetInputWidget9());
89           
90           bbSetOutputWidget( w );
91         }
92   
93
94
95
96 }//namespace bbwx
97
98 #endif
99