]> Creatis software - bbtk.git/blob - packages/wx/src/bbwxLayoutLine.cxx
#3073 BBTK Bug New Normal - message documentation in boxes
[bbtk.git] / packages / wx / src / bbwxLayoutLine.cxx
1 /*
2  # ---------------------------------------------------------------------
3  #
4  # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5  #                        pour la SantÈ)
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
9  #
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.
16  #
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
21  #  liability.
22  #
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  # ------------------------------------------------------------------------ */
26
27
28 /*=========================================================================
29   Program:   bbtk
30   Module:    $RCSfile: bbwxLayoutLine.cxx,v $
31   Language:  C++
32   Date:      $Date: 2012/11/16 08:52:14 $
33   Version:   $Revision: 1.10 $
34 =========================================================================*/
35
36
37 /**
38  *  \file
39  *  \brief
40  */
41
42
43 #ifdef _USE_WXWIDGETS_
44
45 #include "bbwxLayoutLine.h"
46 #include "bbwxPackage.h"
47 #include "bbtkUtilities.h"
48
49
50 namespace bbwx
51 {
52   BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx, LayoutLine);
53   BBTK_BLACK_BOX_IMPLEMENTATION(LayoutLine,bbtk::WxBlackBox);
54   
55         //-----------------------------------------------------------------     
56         void LayoutLine::bbUserSetDefaultValues()
57         {
58                 bbSetInputOrientation("VERTICAL");
59                 bbSetInputWidget1(NULL);
60                 bbSetInputWidget2(NULL);
61                 bbSetInputWidget3(NULL);
62                 bbSetInputWidget4(NULL);
63                 bbSetInputWidget5(NULL);
64                 bbSetInputWidget6(NULL);
65                 bbSetInputWidget7(NULL);
66                 bbSetInputWidget8(NULL);
67                 bbSetInputWidget9(NULL);
68         }
69         
70         //-----------------------------------------------------------------     
71         void LayoutLine::bbUserInitializeProcessing()
72         {
73         }
74         
75         //-----------------------------------------------------------------     
76         void LayoutLine::bbUserFinalizeProcessing()
77         {
78         }       
79         
80         
81         void LayoutLine::Process()
82         {
83                 PutWinTitle();
84         }
85   
86         
87 /*
88   void LayoutLine::TryInsertWindow(wxWindow *parent, wxWindow *w,wxBoxSizer *sizer)
89   {
90     if (w!=NULL)
91       {
92         w->Reparent(parent);
93         sizer->Add(w, 1, wxEXPAND, 0);
94       }
95   }
96   */
97         
98   void LayoutLine::CreateWidget(wxWindow* parent)
99   {
100     wxBoxSizer *sizer;
101     wxPanel *w=new wxPanel(parent, //bbGetWxParent(),
102                                                    -1);
103     w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
104     
105     int style=0;
106     if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
107                                     "0|H|HORIZONTAL")==true)  
108       { style=wxHORIZONTAL; }
109     if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
110                                     "1|V|VERTICAL")==true)      
111       { style=wxVERTICAL;   }
112     
113     sizer       = new wxBoxSizer(style);
114
115           wxWindow* cw;
116         if ((cw=bbCreateWidgetOfInput("Widget1",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
117         if ((cw=bbCreateWidgetOfInput("Widget2",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
118         if ((cw=bbCreateWidgetOfInput("Widget3",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
119         if ((cw=bbCreateWidgetOfInput("Widget4",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
120         if ((cw=bbCreateWidgetOfInput("Widget5",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
121         if ((cw=bbCreateWidgetOfInput("Widget6",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
122         if ((cw=bbCreateWidgetOfInput("Widget7",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
123         if ((cw=bbCreateWidgetOfInput("Widget8",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
124         if ((cw=bbCreateWidgetOfInput("Widget9",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
125           /*
126     TryInsertWindow(w,bbGetInputWidget1(),sizer);
127     TryInsertWindow(w,bbGetInputWidget2(),sizer);
128     TryInsertWindow(w,bbGetInputWidget3(),sizer);
129     TryInsertWindow(w,bbGetInputWidget4(),sizer);
130     TryInsertWindow(w,bbGetInputWidget5(),sizer);
131     TryInsertWindow(w,bbGetInputWidget6(),sizer);
132     TryInsertWindow(w,bbGetInputWidget7(),sizer);
133     TryInsertWindow(w,bbGetInputWidget8(),sizer);
134     TryInsertWindow(w,bbGetInputWidget9(),sizer);
135     */
136     w   -> SetSizer(sizer);
137     bbSetOutputWidget( w );
138   }
139   
140   // This callback is necessary to get actual processing of the view 
141   // when window is shown
142   void  LayoutLine::OnShowWidget()
143   {
144   }
145
146 }//namespace bbwx
147
148 #endif // _USE_WXWIDGETS_
149