]> Creatis software - bbtk.git/blob - packages/wx/src/bbwxLayoutLine.cxx
#2740 BBTK Feature New Normal - Add to the box PolyDataWrite the ascii or binary...
[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   }
84   
85         
86 /*
87   void LayoutLine::TryInsertWindow(wxWindow *parent, wxWindow *w,wxBoxSizer *sizer)
88   {
89     if (w!=NULL)
90       {
91         w->Reparent(parent);
92         sizer->Add(w, 1, wxEXPAND, 0);
93       }
94   }
95   */
96         
97   void LayoutLine::CreateWidget(wxWindow* parent)
98   {
99     wxBoxSizer *sizer;
100     wxPanel *w=new wxPanel(parent, //bbGetWxParent(),
101                                                    -1);
102     w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
103     
104     int style=0;
105     if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
106                                     "0|H|HORIZONTAL")==true)  
107       { style=wxHORIZONTAL; }
108     if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
109                                     "1|V|VERTICAL")==true)      
110       { style=wxVERTICAL;   }
111     
112     sizer       = new wxBoxSizer(style);
113
114           wxWindow* cw;
115         if ((cw=bbCreateWidgetOfInput("Widget1",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
116         if ((cw=bbCreateWidgetOfInput("Widget2",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
117         if ((cw=bbCreateWidgetOfInput("Widget3",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
118         if ((cw=bbCreateWidgetOfInput("Widget4",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
119         if ((cw=bbCreateWidgetOfInput("Widget5",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
120         if ((cw=bbCreateWidgetOfInput("Widget6",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
121         if ((cw=bbCreateWidgetOfInput("Widget7",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
122         if ((cw=bbCreateWidgetOfInput("Widget8",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
123         if ((cw=bbCreateWidgetOfInput("Widget9",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
124           /*
125     TryInsertWindow(w,bbGetInputWidget1(),sizer);
126     TryInsertWindow(w,bbGetInputWidget2(),sizer);
127     TryInsertWindow(w,bbGetInputWidget3(),sizer);
128     TryInsertWindow(w,bbGetInputWidget4(),sizer);
129     TryInsertWindow(w,bbGetInputWidget5(),sizer);
130     TryInsertWindow(w,bbGetInputWidget6(),sizer);
131     TryInsertWindow(w,bbGetInputWidget7(),sizer);
132     TryInsertWindow(w,bbGetInputWidget8(),sizer);
133     TryInsertWindow(w,bbGetInputWidget9(),sizer);
134     */
135     w   -> SetSizer(sizer);
136     bbSetOutputWidget( w );
137   }
138   
139   // This callback is necessary to get actual processing of the view 
140   // when window is shown
141   void  LayoutLine::OnShowWidget()
142   {
143   }
144
145 }//namespace bbwx
146
147 #endif // _USE_WXWIDGETS_
148