]> Creatis software - bbtk.git/blob - packages/wx/src/bbwxLayoutLine.cxx
LayoutLine
[bbtk.git] / packages / wx / src / bbwxLayoutLine.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   bbtk
4   Module:    $RCSfile: bbwxLayoutLine.cxx,v $
5   Language:  C++
6   Date:      $Date: 2008/02/15 12:19:58 $
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 #include "bbwxLayoutLine.h"
27 #include "bbwxPackage.h"
28 #include "bbtkUtilities.h"
29
30
31 namespace bbwx
32 {
33   BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx, LayoutLine);
34   BBTK_USER_BLACK_BOX_IMPLEMENTATION(LayoutLine,bbtk::WxBlackBox);
35
36         void LayoutLine::bbUserConstructor()
37         {
38                 bbSetInputOrientation("VERTICAL");
39                 bbSetInputWidget1(NULL);
40                 bbSetInputWidget2(NULL);
41                 bbSetInputWidget3(NULL);
42                 bbSetInputWidget4(NULL);
43                 bbSetInputWidget5(NULL);
44                 bbSetInputWidget6(NULL);
45                 bbSetInputWidget7(NULL);
46                 bbSetInputWidget8(NULL);
47                 bbSetInputWidget9(NULL);
48         }
49
50           void LayoutLine::Process()
51           {
52           }
53
54         void LayoutLine::TryInsertWindow(wxWindow *parent, wxWindow *w,wxBoxSizer *sizer)
55         {
56                   if (w!=NULL)
57                   {
58                           w->Reparent(parent);
59                           sizer->Add(w, 1, wxEXPAND, 0);
60                   }
61         }
62
63           void LayoutLine::CreateWidget()
64           {
65           wxBoxSizer *sizer;
66           wxPanel *w=new wxPanel(bbGetWxParent(), -1);
67           w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
68
69           int style=0;
70       if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|H|HORIZONTAL")==true)  { style=wxHORIZONTAL; }
71           if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|VERTICAL")==true)        { style=wxVERTICAL;   }
72
73           sizer = new wxBoxSizer(style);
74
75           TryInsertWindow(w,bbGetInputWidget1(),sizer);
76           TryInsertWindow(w,bbGetInputWidget2(),sizer);
77           TryInsertWindow(w,bbGetInputWidget3(),sizer);
78           TryInsertWindow(w,bbGetInputWidget4(),sizer);
79           TryInsertWindow(w,bbGetInputWidget5(),sizer);
80           TryInsertWindow(w,bbGetInputWidget6(),sizer);
81           TryInsertWindow(w,bbGetInputWidget7(),sizer);
82           TryInsertWindow(w,bbGetInputWidget8(),sizer);
83           TryInsertWindow(w,bbGetInputWidget9(),sizer);
84
85           w     -> SetSizer(sizer);
86           bbSetOutputWidget( w );
87   }
88
89 }//namespace bbwx
90
91 #endif // _USE_WXWIDGETS_
92