1 /*=========================================================================
3 Module: $RCSfile: bbwxLayoutLine.cxx,v $
5 Date: $Date: 2008/11/24 15:45:51 $
6 Version: $Revision: 1.7 $
7 =========================================================================*/
9 /* ---------------------------------------------------------------------
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
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.
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
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 * ------------------------------------------------------------------------ */
38 #ifdef _USE_WXWIDGETS_
40 #include "bbwxLayoutLine.h"
41 #include "bbwxPackage.h"
42 #include "bbtkUtilities.h"
47 BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx, LayoutLine);
48 BBTK_BLACK_BOX_IMPLEMENTATION(LayoutLine,bbtk::WxBlackBox);
50 void LayoutLine::bbUserConstructor()
52 bbSetInputOrientation("VERTICAL");
53 bbSetInputWidget1(NULL);
54 bbSetInputWidget2(NULL);
55 bbSetInputWidget3(NULL);
56 bbSetInputWidget4(NULL);
57 bbSetInputWidget5(NULL);
58 bbSetInputWidget6(NULL);
59 bbSetInputWidget7(NULL);
60 bbSetInputWidget8(NULL);
61 bbSetInputWidget9(NULL);
64 void LayoutLine::Process()
70 void LayoutLine::TryInsertWindow(wxWindow *parent, wxWindow *w,wxBoxSizer *sizer)
75 sizer->Add(w, 1, wxEXPAND, 0);
80 void LayoutLine::CreateWidget(wxWindow* parent)
83 wxPanel *w=new wxPanel(parent, //bbGetWxParent(),
85 w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
88 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
89 "0|H|HORIZONTAL")==true)
90 { style=wxHORIZONTAL; }
91 if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
92 "1|V|VERTICAL")==true)
95 sizer = new wxBoxSizer(style);
98 if ((cw=bbCreateWidgetOfInput("Widget1",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
99 if ((cw=bbCreateWidgetOfInput("Widget2",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
100 if ((cw=bbCreateWidgetOfInput("Widget3",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
101 if ((cw=bbCreateWidgetOfInput("Widget4",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
102 if ((cw=bbCreateWidgetOfInput("Widget5",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
103 if ((cw=bbCreateWidgetOfInput("Widget6",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
104 if ((cw=bbCreateWidgetOfInput("Widget7",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
105 if ((cw=bbCreateWidgetOfInput("Widget8",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
106 if ((cw=bbCreateWidgetOfInput("Widget9",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
108 TryInsertWindow(w,bbGetInputWidget1(),sizer);
109 TryInsertWindow(w,bbGetInputWidget2(),sizer);
110 TryInsertWindow(w,bbGetInputWidget3(),sizer);
111 TryInsertWindow(w,bbGetInputWidget4(),sizer);
112 TryInsertWindow(w,bbGetInputWidget5(),sizer);
113 TryInsertWindow(w,bbGetInputWidget6(),sizer);
114 TryInsertWindow(w,bbGetInputWidget7(),sizer);
115 TryInsertWindow(w,bbGetInputWidget8(),sizer);
116 TryInsertWindow(w,bbGetInputWidget9(),sizer);
118 w -> SetSizer(sizer);
119 bbSetOutputWidget( w );
122 // This callback is necessary to get actual processing of the view
123 // when window is shown
124 void LayoutLine::OnShowWidget()
126 bbUserOnShowWidget("Widget1");
127 bbUserOnShowWidget("Widget2");
128 bbUserOnShowWidget("Widget3");
129 bbUserOnShowWidget("Widget4");
130 bbUserOnShowWidget("Widget5");
131 bbUserOnShowWidget("Widget6");
132 bbUserOnShowWidget("Widget7");
133 bbUserOnShowWidget("Widget8");
134 bbUserOnShowWidget("Widget9");
139 #endif // _USE_WXWIDGETS_