DirName = bbGetInputIn();
/*int nbFiles = */ Explore(DirName, bbGetInputRecursive(), bbGetInputRecursiveLevel() );
CleanFilenames( DirName );
- bbSetOutputOut(Filenames);
- bbSetOutputOutSimple(SimpleFilenames);
} // if In
+ bbSetOutputOut(Filenames);
+ bbSetOutputOutSimple(SimpleFilenames);
}
void FilesFromDirectory::bbUserSetDefaultValues()
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-# pour la SantÈ)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-# This software is governed by the CeCILL-B license under French law and
-# abiding by the rules of distribution of free software. You can use,
-# modify and/ or redistribute the software under the terms of the CeCILL-B
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-# or in the file LICENSE.txt.
-#
-# As a counterpart to the access to the source code and rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty and the software's author, the holder of the
-# economic rights, and the successive licensors have only limited
-# liability.
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
-
-
# ----------------------------------
-# - BBTKGEditor v 1.2 BBG BlackBox Diagram file
-# - /Users/davila/Creatis/All3/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageItkPropertiesWidget.bbg
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /home/davila/Creatis/C10/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageItkPropertiesWidget.bbg
# ----------------------------------
APP_START
COMPLEXBOX:TRUE
COMPLEXBOXNAME:ImageItkPropertiesWidget
PACKAGENAME:toolsbbtk
-COMPLEXINPUTS:1
-COMPLEX_PORT
-in
--80.663770:148.604993:900.000000
-FIN_COMPLEX_PORT
-COMPLEXOUTPUTS:7
+COMPLEXOUTPUTS:8
COMPLEX_PORT
widget
--142.967861:-58.247376:900.000000
+-142.967861:-58.247376:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
Dimensions
--124.883681:-57.175644:900.000000
+-124.883681:-57.175644:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
Index
--108.940640:-56.720128:900.000000
+-108.940640:-56.720128:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
MinMax
--92.628104:-54.898845:900.000000
+-92.628104:-54.898845:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
Size
--81.734224:-56.500886:900.000000
+-55.578467:-54.074063:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
Spacing
--70.199528:-56.180478:900.000000
+-38.111538:-54.967067:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
TypeName
--57.383199:-56.821294:900.000000
+-25.564856:-54.529295:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+origin
+-75.421485:-52.421824:-900.000000
+FIN_COMPLEX_PORT
+COMPLEXINPUTS:2
+COMPLEX_PORT
+in
+-80.663770:148.604993:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+FileName
+-13.739739:147.116939:-900.000000
FIN_COMPLEX_PORT
-BOXES:8
+BOXES:14
BOX
itk:ImageProperties:Box00
ISEXEC:FALSE
--86.392715:120.167267:900.000000
--40.817715:110.167267:900.000000
+-86.392715:120.167267:-900.000000
+-44.192715:110.167267:-900.000000
FIN_BOX
BOX
wx:OutputText:Box02
ISEXEC:FALSE
--348.493528:57.422012:900.000000
--302.918528:47.422012:900.000000
+-348.493528:57.422012:-900.000000
+-311.718528:47.422012:-900.000000
PORT
Title:"Dimension"
FIN_BOX
BOX
wx:OutputText:Box14
ISEXEC:FALSE
--306.197846:44.988878:900.000000
--260.622846:34.988878:900.000000
+-306.197846:44.988878:-900.000000
+-269.422846:34.988878:-900.000000
PORT
Title:"Index"
FIN_BOX
BOX
wx:LayoutLine:Box15
ISEXEC:FALSE
--196.596247:-31.096236:900.000000
--139.036247:-41.096236:900.000000
+-196.596247:-31.096236:-900.000000
+-139.036247:-41.096236:-900.000000
PORT
WinTitle:"Image Properties"
FIN_BOX
BOX
wx:OutputText:Box17
ISEXEC:FALSE
--262.616712:54.641899:900.000000
--217.041712:44.641899:900.000000
+-262.616712:54.641899:-900.000000
+-225.841712:44.641899:-900.000000
PORT
Title:"Size"
FIN_BOX
BOX
wx:OutputText:Box20
ISEXEC:FALSE
--232.876715:39.300084:900.000000
--187.301715:29.300084:900.000000
+-232.876715:39.300084:-900.000000
+-196.101715:29.300084:-900.000000
PORT
Title:"Spacing"
FIN_BOX
BOX
wx:OutputText:Box22
ISEXEC:FALSE
--191.029461:30.782065:900.000000
--145.454461:20.782065:900.000000
+-191.029461:30.782065:-900.000000
+-154.254461:20.782065:-900.000000
PORT
Title:"TypeName"
FIN_BOX
BOX
wx:OutputText:Box26
ISEXEC:FALSE
--166.067448:13.413901:900.000000
--120.492448:3.413901:900.000000
+-154.877098:-1.551506:-900.000000
+-118.102098:-11.551506:-900.000000
PORT
Title:"Min Max"
FIN_BOX
-CONNECTIONS:20
+BOX
+wx:OutputText:Box09
+ISEXEC:FALSE
+-174.515204:12.516260:-900.000000
+-137.740204:2.516260:-900.000000
+PORT
+Title:"Origin"
+FIN_BOX
+BOX
+std:ConcatStrings:Box10
+ISEXEC:FALSE
+-15.155386:29.281210:-900.000000
+24.569614:19.281210:-900.000000
+PORT
+In2:" "
+PORT
+In4:" "
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box11
+ISEXEC:FALSE
+-11.582563:52.605674:-900.000000
+39.467437:42.605674:-900.000000
+PORT
+I:"0"
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box12
+ISEXEC:FALSE
+8.417437:72.605674:-900.000000
+59.467437:62.605674:-900.000000
+PORT
+I:"1"
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box13
+ISEXEC:FALSE
+28.417437:92.605674:-900.000000
+79.467437:82.605674:-900.000000
+PORT
+I:"2"
+FIN_BOX
+BOX
+wx:OutputText:Box16
+ISEXEC:FALSE
+-141.887920:-15.796672:-900.000000
+-105.112920:-25.796672:-900.000000
+PORT
+Title:"Name"
+FIN_BOX
+CONNECTIONS:31
CONNECTION
Box00:Dimension:Box02:In
NumberOfControlPoints:0
Box22:Widget:Box15:Widget5
NumberOfControlPoints:0
CONNECTION
-Box26:Widget:Box15:Widget6
-NumberOfControlPoints:0
-CONNECTION
Box00:Dimension:Dimensions:Dimensions
NumberOfControlPoints:0
CONNECTION
CONNECTION
Box00:TypeName:TypeName:TypeName
NumberOfControlPoints:0
+CONNECTION
+Box00:Origin:origin:origin
+NumberOfControlPoints:0
+CONNECTION
+Box09:Widget:Box15:Widget6
+NumberOfControlPoints:0
+CONNECTION
+Box00:Origin:Box13:In
+NumberOfControlPoints:0
+CONNECTION
+Box00:Origin:Box12:In
+NumberOfControlPoints:0
+CONNECTION
+Box00:Origin:Box11:In
+NumberOfControlPoints:0
+CONNECTION
+Box11:Out:Box10:In1
+NumberOfControlPoints:0
+CONNECTION
+Box12:Out:Box10:In3
+NumberOfControlPoints:0
+CONNECTION
+Box13:Out:Box10:In5
+NumberOfControlPoints:0
+CONNECTION
+Box10:Out:Box09:In
+NumberOfControlPoints:0
+CONNECTION
+Box26:Widget:Box15:Widget7
+NumberOfControlPoints:0
+CONNECTION
+Box16:Widget:Box15:Widget9
+NumberOfControlPoints:0
+CONNECTION
+FileName:FileName:Box16:In
+NumberOfControlPoints:0
APP_END
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-# pour la SantÈ)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-# This software is governed by the CeCILL-B license under French law and
-# abiding by the rules of distribution of free software. You can use,
-# modify and/ or redistribute the software under the terms of the CeCILL-B
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-# or in the file LICENSE.txt.
-#
-# As a counterpart to the access to the source code and rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty and the software's author, the holder of the
-# economic rights, and the successive licensors have only limited
-# liability.
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
-
-
# ----------------------------------
-# - BBTKGEditor v 1.2 BBS BlackBox Script (Complex Box)
-# - /Users/davila/Creatis/All3/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageItkPropertiesWidget.bbs
+# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
+# - /home/davila/Creatis/C10/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageItkPropertiesWidget.bbs
# ----------------------------------
include std
include itkvtk
include itk
include wx
+include std
define ImageItkPropertiesWidget toolsbbtk
category "<VOID>"
-new ImageProperties Box00
+new itk:ImageProperties Box00
-new OutputText Box02
+new wx:OutputText Box02
set Box02.Title "Dimension"
-new OutputText Box14
+new wx:OutputText Box14
set Box14.Title "Index"
-new LayoutLine Box15
+new wx:LayoutLine Box15
set Box15.WinTitle "Image Properties"
-new OutputText Box17
+new wx:OutputText Box17
set Box17.Title "Size"
-new OutputText Box20
+new wx:OutputText Box20
set Box20.Title "Spacing"
-new OutputText Box22
+new wx:OutputText Box22
set Box22.Title "TypeName"
-new OutputText Box26
+new wx:OutputText Box26
set Box26.Title "Min Max"
+new wx:OutputText Box09
+ set Box09.Title "Origin"
+
+new std:ConcatStrings Box10
+ set Box10.In2 " "
+ set Box10.In4 " "
+
+new std:GetVectorDoubleElement Box11
+ set Box11.I "0"
+
+new std:GetVectorDoubleElement Box12
+ set Box12.I "1"
+
+new std:GetVectorDoubleElement Box13
+ set Box13.I "2"
+
+new wx:OutputText Box16
+ set Box16.Title "Name"
+
connect Box00.Dimension Box02.In
connect Box00.Index Box14.In
connect Box17.Widget Box15.Widget3
connect Box20.Widget Box15.Widget4
connect Box22.Widget Box15.Widget5
-connect Box26.Widget Box15.Widget6
-
+connect Box09.Widget Box15.Widget6
+connect Box00.Origin Box13.In
+connect Box00.Origin Box12.In
+connect Box00.Origin Box11.In
+connect Box11.Out Box10.In1
+connect Box12.Out Box10.In3
+connect Box13.Out Box10.In5
+connect Box10.Out Box09.In
+connect Box26.Widget Box15.Widget7
+connect Box16.Widget Box15.Widget9
# Complex input ports
input in Box00.In " "
+input FileName Box16.In " "
# Complex output ports
output widget Box15.Widget " "
output Size Box00.Size " "
output Spacing Box00.Spacing " "
output TypeName Box00.TypeName " "
+output origin Box00.Origin " "
+
endefine
# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - imageVtkPropertiesWidget.bbg
+# - /home/davila/Creatis/C10/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbg
# ----------------------------------
APP_START
COMPLEXBOX:TRUE
COMPLEXBOXNAME:ImageVtkPropertiesWidget
PACKAGENAME:toolsbbtk
-COMPLEXOUTPUTS:6
+COMPLEXOUTPUTS:7
COMPLEX_PORT
widget
3.333144:-72.520645:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
Size
-64.566781:-70.774155:-900.000000
+76.763110:-69.490331:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
Spacing
-76.101477:-70.453747:-900.000000
+87.976850:-69.972313:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
TypeName
-88.917806:-71.094563:-900.000000
+98.867443:-69.650261:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+origin
+65.467976:-67.826409:-900.000000
FIN_COMPLEX_PORT
COMPLEXINPUTS:3
COMPLEX_PORT
boxExecute
-92.186317:150.079323:-900.000000
FIN_COMPLEX_PORT
-BOXES:10
+BOXES:15
BOX
wx:OutputText:Box02
ISEXEC:FALSE
-173.282353:46.940241:-900.000000
--127.707353:36.940241:-900.000000
+-136.507353:36.940241:-900.000000
PORT
Title:"Dimensions"
FIN_BOX
wx:OutputText:Box17
ISEXEC:FALSE
-81.960343:34.681383:-900.000000
--36.385343:24.681383:-900.000000
+-45.185343:24.681383:-900.000000
PORT
Title:"Size"
FIN_BOX
wx:OutputText:Box20
ISEXEC:FALSE
-52.452230:20.761380:-900.000000
--6.877230:10.761380:-900.000000
+-15.677230:10.761380:-900.000000
PORT
Title:"Spacing"
FIN_BOX
wx:OutputText:Box22
ISEXEC:FALSE
-33.844911:1.230494:-900.000000
-11.730089:-8.769506:-900.000000
+2.930089:-8.769506:-900.000000
PORT
Title:"TypeName"
FIN_BOX
wx:OutputText:Box26
ISEXEC:FALSE
-128.670557:28.919600:-900.000000
--83.095557:18.919600:-900.000000
+-91.895557:18.919600:-900.000000
PORT
Title:"Min Max"
FIN_BOX
vtk:ImageVtkProperties:Box09
ISEXEC:FALSE
14.396297:109.880107:-900.000000
-59.971297:99.880107:-900.000000
+59.746297:99.880107:-900.000000
FIN_BOX
BOX
wx:OutputText:Box10
ISEXEC:FALSE
-196.439793:65.504307:-900.000000
--150.584398:55.504307:-900.000000
+-159.664793:55.504307:-900.000000
PORT
Title:"Components"
FIN_BOX
BOX
wx:LayoutLine:Box11
ISEXEC:FALSE
--69.746079:-39.358124:-900.000000
--12.186079:-49.358124:-900.000000
+-57.992403:-49.764245:-900.000000
+-0.432403:-59.764245:-900.000000
PORT
WinTitle:"Image properties"
FIN_BOX
BOX
wx:OutputText:Box13
ISEXEC:FALSE
--27.886899:-16.541426:-900.000000
-17.688101:-26.541426:-900.000000
+8.178439:-32.145808:-900.000000
+44.953439:-42.145808:-900.000000
PORT
Title:"Name"
FIN_BOX
std:MagicBox:Box14
ISEXEC:FALSE
-98.823731:125.742136:-900.000000
--53.248731:115.742136:-900.000000
+-62.748731:115.742136:-900.000000
+FIN_BOX
+BOX
+wx:OutputText:Box15
+ISEXEC:FALSE
+-27.670236:-19.010277:-900.000000
+9.104764:-29.010277:-900.000000
+PORT
+Title:"Origin"
+FIN_BOX
+BOX
+std:ConcatStrings:Box16
+ISEXEC:FALSE
+113.399842:22.194464:-900.000000
+153.124842:12.194464:-900.000000
+PORT
+In2:" "
+PORT
+In4:" "
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box18
+ISEXEC:FALSE
+77.073454:52.393509:-900.000000
+128.123454:42.393509:-900.000000
+PORT
+I:"0"
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box19
+ISEXEC:FALSE
+94.301561:68.016836:-900.000000
+145.351561:58.016836:-900.000000
+PORT
+I:"1"
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box21
+ISEXEC:FALSE
+114.301561:88.016836:-900.000000
+165.351561:78.016836:-900.000000
+PORT
+I:"2"
FIN_BOX
-CONNECTIONS:30
+CONNECTIONS:40
CONNECTION
Box09:Components:Box10:In
NumberOfControlPoints:0
FileName:FileName:Box13:In
NumberOfControlPoints:0
CONNECTION
-Box13:Widget:Box11:Widget7
-NumberOfControlPoints:0
-CONNECTION
boxExecute:boxExecute:Box14:In
NumberOfControlPoints:0
CONNECTION
CONNECTION
Box14:Out:Box26:BoxExecute
NumberOfControlPoints:0
+CONNECTION
+Box13:Widget:Box11:Widget9
+NumberOfControlPoints:0
+CONNECTION
+Box15:Widget:Box11:Widget7
+NumberOfControlPoints:0
+CONNECTION
+Box14:Out:Box15:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box09:Origin:Box18:In
+NumberOfControlPoints:0
+CONNECTION
+Box09:Origin:Box19:In
+NumberOfControlPoints:0
+CONNECTION
+Box09:Origin:Box21:In
+NumberOfControlPoints:0
+CONNECTION
+Box21:Out:Box16:In5
+NumberOfControlPoints:0
+CONNECTION
+Box18:Out:Box16:In1
+NumberOfControlPoints:0
+CONNECTION
+Box19:Out:Box16:In3
+NumberOfControlPoints:0
+CONNECTION
+Box16:Out:Box15:In
+NumberOfControlPoints:0
+CONNECTION
+Box09:Origin:origin:origin
+NumberOfControlPoints:0
APP_END
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
-# - imageVtkPropertiesWidget.bbs
+# - /home/davila/Creatis/C10/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbs
# ----------------------------------
include std
new std:MagicBox Box14
+new wx:OutputText Box15
+ set Box15.Title "Origin"
+
+new std:ConcatStrings Box16
+ set Box16.In2 " "
+ set Box16.In4 " "
+
+new std:GetVectorDoubleElement Box18
+ set Box18.I "0"
+
+new std:GetVectorDoubleElement Box19
+ set Box19.I "1"
+
+new std:GetVectorDoubleElement Box21
+ set Box21.I "2"
+
connect Box09.Components Box10.In
connect Box09.MinMax Box26.In
connect Box22.Widget Box11.Widget5
connect Box26.Widget Box11.Widget6
connect Box09.Dimension Box02.In
-connect Box13.Widget Box11.Widget7
connect Box14.Out Box10.BoxExecute
connect Box14.Out Box02.BoxExecute
connect Box14.Out Box17.BoxExecute
connect Box14.Out Box13.BoxExecute
connect Box14.BoxChange Box09.BoxExecute
connect Box14.Out Box26.BoxExecute
+connect Box13.Widget Box11.Widget9
+connect Box15.Widget Box11.Widget7
+connect Box14.Out Box15.BoxExecute
+connect Box09.Origin Box18.In
+connect Box09.Origin Box19.In
+connect Box09.Origin Box21.In
+connect Box21.Out Box16.In5
+connect Box18.Out Box16.In1
+connect Box19.Out Box16.In3
+connect Box16.Out Box15.In
# Complex input ports
input in Box09.In " "
output Size Box09.Size " "
output Spacing Box09.Spacing " "
output TypeName Box09.TypeName " "
+output origin Box09.Origin " "
endefine
{
// If no executer : create a totally independant interpreter
I = bbtk::Interpreter::New();
- }
- else
- {
+ } else {
// If executer : create an interpreter using E
I = bbtk::Interpreter::New(E);
}
{
ok=false;
ccommand=commandstr.substr(pos1,commandstr.length()-pos1 );
- }
- else
- {
+ } else {
ccommand=commandstr.substr(pos1,pos2-pos1);
}
for ( i=0 ; i < ccommand.length() ; i++)
{
if (ccommand[i]==39) // '
- {
- ccommand[i]=34; // "
- }
+ {
+ ccommand[i]=34; // "
+ }
}
I->InterpretLine( ccommand );
pos1=pos2+1;
void LayoutLine::CreateWidget(wxWindow* parent)
{
wxBoxSizer *sizer;
- wxPanel *w=new wxPanel(parent, //bbGetWxParent(),
- -1);
+ wxPanel *w=new wxPanel(parent, -1);
w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
int style=0;
- if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
- "0|H|HORIZONTAL")==true)
- { style=wxHORIZONTAL; }
- if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
- "1|V|VERTICAL")==true)
- { style=wxVERTICAL; }
+ if (bbtk::Utilities::loosematch(bbGetInputOrientation(), "0|H|HORIZONTAL")==true)
+ {
+ style=wxHORIZONTAL;
+ } // if
+ if (bbtk::Utilities::loosematch(bbGetInputOrientation(), "1|V|VERTICAL")==true)
+ {
+ style=wxVERTICAL;
+ } // if
sizer = new wxBoxSizer(style);
- wxWindow* cw;
+ wxWindow* cw;
if ((cw=bbCreateWidgetOfInput("Widget1",w)) != 0) sizer->Add(cw, 1, wxGROW, 0);
if ((cw=bbCreateWidgetOfInput("Widget2",w)) != 0) sizer->Add(cw, 1, wxGROW, 0);
if ((cw=bbCreateWidgetOfInput("Widget3",w)) != 0) sizer->Add(cw, 1, wxGROW, 0);
namespace bbwx
{
- BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx , LayoutTab);
+
+
+ //--------------------------------------------------------------------------
+ class TabWidget : public wxPanel
+ {
+ public:
+ TabWidget(LayoutTab* box, wxWindow *parent, long style);
+ ~TabWidget();
+ void OnTabChange( wxEvent& );
+ wxNotebook* GetmwxNotebook();
+ private:
+ LayoutTab *mBox;
+ wxNotebook *mwxNotebook;
+ };
+
+
+ TabWidget::TabWidget(LayoutTab* box,
+ wxWindow *parent,long style )
+ : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL),
+ mBox(box)
+ {
+ wxPanel *panel = this;
+ mwxNotebook = new wxNotebook(panel, //bbGetWxParent(),
+ -1,
+ wxDefaultPosition,
+ wxDefaultSize,
+ style );
+ Connect( mwxNotebook->GetId(), wxEVT_NOTEBOOK_PAGE_CHANGED ,
+ (wxObjectEventFunction)
+ (void (wxPanel::*)(wxEvent&))
+ &TabWidget::OnTabChange );
+ wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
+ sizer -> Add( mwxNotebook,1,wxGROW | wxALL,10 );
+ sizer -> AddGrowableCol(0);
+ panel -> SetSizer(sizer);
+ panel -> SetAutoLayout(true);
+ panel -> Layout();
+ }
+
+ TabWidget::~TabWidget()
+ {
+ }
+ void TabWidget::OnTabChange( wxEvent& )
+ {
+ printf("EED TabWidget::OnTabChange %d\n",mwxNotebook->GetSelection() );
+ mBox->bbSetOutputSelection( mwxNotebook->GetSelection() );
+ mBox->bbSignalOutputModification();
+ }
+wxNotebook* TabWidget::GetmwxNotebook()
+{
+ return mwxNotebook;
+}
+
+
+
+ BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx , LayoutTab);
BBTK_BLACK_BOX_IMPLEMENTATION(LayoutTab,bbtk::WxBlackBox);
//-----------------------------------------------------------------
//-----------------------------------------------------------------
void LayoutTab::TryInsertWindow(wxNotebook *book, const std::string& input )
{
- wxWindow* w = bbCreateWidgetOfInput(input,book); //panel);
+ wxWindow* w = bbCreateWidgetOfInput(input,book);
if (w!=NULL)
{
book->AddPage(w,w->GetName());
- }
+ } // if w
}
- void LayoutTab::SetTitleTabs()
- {
-
+void LayoutTab::SetTitleTabs()
+{
std::vector<std::string> vecTitle;
std::vector<std::string> vecInputNameWidget;
vecInputNameWidget.push_back("Widget1");
} // if c
} // for iWidget
-
- wxNotebook* w = (wxNotebook*)bbGetOutputWidget();
- if (w!=NULL)
+//EED2020-04-06
+// wxNotebook* w = (wxNotebook*)bbGetOutputWidget();
+ TabWidget *tabwidget=(TabWidget*)bbGetOutputWidget();
+ if (tabwidget!=NULL)
{
- int i,size=vecTitle.size();
- for (i=0; i<size; i++)
+ wxNotebook *w = tabwidget->GetmwxNotebook();
+ if (w!=NULL)
{
- w->SetPageText(i, wxString( vecTitle[i].c_str(),wxConvUTF8 ) );
- } // for i
- } //w
+ int i,size=vecTitle.size();
+ for (i=0; i<size; i++)
+ {
+ w->SetPageText(i, wxString( vecTitle[i].c_str(),wxConvUTF8 ) );
+ } // for i
+ } //w
+ } // if tabwidget
}
-
void LayoutTab::Process()
{
PutWinTitle();
SetTitleTabs();
}
-
-
+
void LayoutTab::CreateWidget(wxWindow* parent)
{
long style = wxNB_TOP;
{ style=wxNB_BOTTOM; }
if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"3|L|LEFT")==true)
{ style=wxNB_LEFT; }
- wxNotebook *w = new wxNotebook(parent, //bbGetWxParent(),
- -1,
- wxDefaultPosition,
- wxDefaultSize,
- style );
- w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
-
+
+//EED2020-04-06
+// wxNotebook *w = new wxNotebook(parent, //bbGetWxParent(),
+// -1,
+// wxDefaultPosition,
+// wxDefaultSize,
+// style );
+//
+ TabWidget *tabwidget = new TabWidget (this, parent, style );
+ tabwidget->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
+ wxNotebook *w = tabwidget->GetmwxNotebook();
+
+//EED2020-04-06
+// w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
TryInsertWindow(w,"Widget1");
TryInsertWindow(w,"Widget2");
TryInsertWindow(w,"Widget3");
TryInsertWindow(w,"Widget8");
TryInsertWindow(w,"Widget9");
- bbSetOutputWidget( w );
+//EED2020-04-06
+// bbSetOutputWidget( w );
+ bbSetOutputWidget( tabwidget );
}
- // This callback is necessary to get actual processing of the view
- // when window is shown
- void LayoutTab::OnShowWidget()
- {
- wxNotebook* w = (wxNotebook*)bbGetOutputWidget();
- if (w)
- {
- if (w->GetPageCount()>0)
- {
- w->SetSelection(0);
- for (unsigned int i=0; i<w->GetPageCount(); ++i) w->AdvanceSelection();
- }
- }
-
-
- }
+ // This callback is necessary to get actual processing of the view
+// when window is shown
+void LayoutTab::OnShowWidget()
+{
+//EED2020-04-06
+// wxNotebook* w = (wxNotebook*)bbGetOutputWidget();
+ wxNotebook* w = ((TabWidget*)bbGetOutputWidget())->GetmwxNotebook();
+ if (w)
+ {
+ if (w->GetPageCount()>0)
+ {
+ w->SetSelection(0);
+ for (unsigned int i=0; i<w->GetPageCount(); ++i)
+ {
+ w->AdvanceSelection();
+ } // for
+ } // if PageCount
+ } // if w
+}
}//namespace bbwx
BBTK_DECLARE_INPUT(Widget8,wxWindow*);
BBTK_DECLARE_INPUT(Widget9,wxWindow*);
BBTK_DECLARE_INPUT(Orientation,std::string);
+
+ BBTK_DECLARE_OUTPUT(Selection,int);
+
BBTK_PROCESS(Process);
BBTK_CREATE_WIDGET(CreateWidget);
BBTK_ON_SHOW_WIDGET(OnShowWidget);
BBTK_INPUT(LayoutTab,Orientation,
"Orientation (default T), 0=T=TOP , 1=R=RIGHT , 2=B=BOTTON , 3=L=LEFT "
,std::string,"");
+ BBTK_OUTPUT(LayoutTab,Selection,"Tab selection",int,"");
+
BBTK_END_DESCRIBE_BLACK_BOX(LayoutTab);
//=================================================================