From 33a30a5090bdde56ff9ecba764b4bb5dac3fe27e Mon Sep 17 00:00:00 2001 From: Eduardo Davila Date: Thu, 14 Feb 2008 16:53:38 +0000 Subject: [PATCH] *** empty log message *** --- packages/wx/bbs/appli/testSplitInSplit.bbs | 100 +++++++++++---------- packages/wx/src/bbwxColourDialog.cxx | 73 +++++++++++++++ packages/wx/src/bbwxColourDialog.h | 89 ++++++++++++++++++ packages/wx/src/bbwxColourDialogButton.cxx | 6 +- packages/wx/src/bbwxSplit.cxx | 8 +- 5 files changed, 223 insertions(+), 53 deletions(-) create mode 100644 packages/wx/src/bbwxColourDialog.cxx create mode 100644 packages/wx/src/bbwxColourDialog.h diff --git a/packages/wx/bbs/appli/testSplitInSplit.bbs b/packages/wx/bbs/appli/testSplitInSplit.bbs index 8e7e11e..b9575e1 100644 --- a/packages/wx/bbs/appli/testSplitInSplit.bbs +++ b/packages/wx/bbs/appli/testSplitInSplit.bbs @@ -5,65 +5,69 @@ category "test" load std load wx + +#----- I N T E R F A C E ------------------------------------- + + new Split main -#set main.Orientation 1 + set main.Orientation H new Sizer up set up.Orientation 0 new Sizer down -set down.Orientation 1 + set down.Orientation 1 + new Slider sDown + connect sDown.Widget down.Widget1 + new RadioButton rb + set rb.Title "Rad But" + set rb.In0 "Choix 1" + set rb.In1 "Choix 2" + set rb.In2 "Choix 3" + set rb.In3 "Choix 4" + set rb.In 1 + connect rb.Widget down.Widget2 -new Sizer upRight -set upRight.Orientation 0 - -new Split upLeft -#set upLeft.Proportion 80 connect up.Widget main.Widget1 connect down.Widget main.Widget2 -connect upLeft.Widget up.Widget1 -connect upRight.Widget up.Widget2 - -# -- todo : add it, again later -# -- (when RadioButton exists again) - -new RadioButton rb -set rb.Title "Rad But" -set rb.In0 "Choix 1" -set rb.In1 "Choix 2" -set rb.In2 "Choix 3" -set rb.In3 "Choix 4" -set rb.In 1 - - -new Slider sUpLeft -new Slider sDown - -new Slider s1 -set s1.Orientation 1 -set s1.Title "s1" -new Slider s2 -set s2.Orientation 1 -set s2.Title "s2" -new Slider s3 -set s3.Orientation 1 -set s3.Title "s3" -new Slider s4 -set s4.Orientation 1 -set s4.Title "s4" - -connect s1.Widget upRight.Widget1 -connect s2.Widget upRight.Widget2 -connect s3.Widget upRight.Widget3 -connect s4.Widget upRight.Widget4 - -connect sUpLeft.Widget upLeft.Widget1 -connect rb.Widget down.Widget2 -connect sDown.Widget down.Widget1 - -#graph + + new Split upLeft + #set upLeft.Proportion 80 + new Slider eed + connect eed.Widget upLeft.Widget1 + new Slider sUpLeft + connect sUpLeft.Widget upLeft.Widget2 + connect upLeft.Widget up.Widget1 + + + new Sizer upRight + set upRight.Orientation 0 + new Slider s1 + set s1.Orientation 1 + set s1.Title "s1" + new Slider s2 + set s2.Orientation 1 + set s2.Title "s2" + new Slider s3 + set s3.Orientation 1 + set s3.Title "s3" + new Slider s4 + set s4.Orientation 1 + set s4.Title "s4" + connect s1.Widget upRight.Widget1 + connect s2.Widget upRight.Widget2 + connect s3.Widget upRight.Widget3 + connect s4.Widget upRight.Widget4 + connect upRight.Widget up.Widget2 + +#------p i p e l i n e--------------------------------------- +#... +#------------------------------------------------------------ + + +graph #set main.WinDialog 1 exec main diff --git a/packages/wx/src/bbwxColourDialog.cxx b/packages/wx/src/bbwxColourDialog.cxx new file mode 100644 index 0000000..7f6c929 --- /dev/null +++ b/packages/wx/src/bbwxColourDialog.cxx @@ -0,0 +1,73 @@ +/*========================================================================= + + Program: bbtk + Module: $RCSfile: bbwxColourDialog.cxx,v $ + Language: C++ + Date: $Date: 2008/02/14 16:55:07 $ + Version: $Revision: 1.1 $ + + Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de + l'Image). All rights reserved. See Doc/License.txt or + http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +/** + * \file + * \brief + */ + + +#ifdef _USE_WXWIDGETS_ + + +#include "bbwxColourDialog.h" +#include "bbwxPackage.h" + + + + +namespace bbwx +{ + + BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,ColourDialog); + BBTK_USER_BLACK_BOX_IMPLEMENTATION(ColourDialog,bbtk::WxBlackBox); + + + void ColourDialog::bbUserConstructor() + { + } + + void ColourDialog::Process() + { + bbtkDebugMessageInc("Core",9,"ColourDialog::Process() [" + <GetReturnCode()==wxID_OK) + { + char col[100]; + wxColour& c = mColorDialog->GetColourData().GetColour(); + sprintf(col,"%f %f %f",c.Red()/255.,c.Green()/255.,c.Blue()/255.); + bbSetOutputOut( col ); + } + else + { + bbSetOutputOut(""); + } + + bbtkDebugDecTab("Core",9); + } + + void ColourDialog::CreateWidget() + { + mColorDialog = new wxColourDialog( 0 ); + bbSetOutputWidget( mColorDialog ); + } + +}//namespace bbwx + +#endif // _USE_WXWIDGETS_ + diff --git a/packages/wx/src/bbwxColourDialog.h b/packages/wx/src/bbwxColourDialog.h new file mode 100644 index 0000000..1877264 --- /dev/null +++ b/packages/wx/src/bbwxColourDialog.h @@ -0,0 +1,89 @@ +/*========================================================================= + + Program: bbtk + Module: $RCSfile: bbwxColourDialog.h,v $ + Language: C++ + Date: $Date: 2008/02/14 16:55:07 $ + Version: $Revision: 1.1 $ + + Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de + l'Image). All rights reserved. See Doc/License.txt or + http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*//** + /** + * \file + * \brief Short description in one line + * + * Long description which + * can span multiple lines +*/ + +/** + * \class bbwx::ColorDialog + * \brief + + */ + +#ifdef _USE_WXWIDGETS_ + + +#ifndef __bbWxColourDialog_h__ +#define __bbWxColourDialog_h__ + +#include "bbtkWxBlackBox.h" + +#include + +// Namespace of the package "wx" is "bbwx" +// Namespace associated to packages should be of the form : +// bbPACKAGENAME +namespace bbwx +{ + + + + + //================================================================= + class /*BBTK_EXPORT*/ ColourDialog : public bbtk::WxBlackBox + { + BBTK_USER_BLACK_BOX_INTERFACE(ColourDialog,bbtk::WxBlackBox); + BBTK_DECLARE_OUTPUT(Out,std::string); + BBTK_PROCESS(Process); + BBTK_CREATE_WIDGET(CreateWidget); + void Process(); + void CreateWidget(); + + protected: + virtual void bbUserConstructor(); + private: + wxColourDialog* mColorDialog; + }; + //================================================================= + + + //================================================================= + // UserBlackBox description + BBTK_BEGIN_DESCRIBE_BLACK_BOX(ColourDialog,bbtk::WxBlackBox); + // Already inserted for any WxBlackBox BBTK_CATEGORY("widget"); + BBTK_NAME("ColourDialog"); + BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr"); + BBTK_DESCRIPTION("Colour chooser dialog (bbfication of wxColourDialog)"); + BBTK_OUTPUT(ColourDialog,Out,"The colour selected by the user",std::string); + BBTK_END_DESCRIBE_BLACK_BOX(ColourDialog); + //================================================================= + + + +} + + + +//namespace bbtk +#endif //__bbtkWxColourDialog_h__ + +#endif //_USE_WXWIDGETS_ diff --git a/packages/wx/src/bbwxColourDialogButton.cxx b/packages/wx/src/bbwxColourDialogButton.cxx index b813700..eadb5e9 100644 --- a/packages/wx/src/bbwxColourDialogButton.cxx +++ b/packages/wx/src/bbwxColourDialogButton.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbwxColourDialogButton.cxx,v $ Language: C++ - Date: $Date: 2008/02/14 08:06:19 $ - Version: $Revision: 1.2 $ + Date: $Date: 2008/02/14 16:55:07 $ + Version: $Revision: 1.3 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -63,7 +63,7 @@ wxColourPickerCtrlWidget::wxColourPickerCtrlWidget( ColourDialogButton* box, bbtkDebugMessage("Process",9,"<= wxColourPickerCtrlWidget::wxColourPickerCtrlWidget"< AddGrowableRow(0); - sizer -> Add( picker,1,wxGROW ); + sizer -> Add( picker, 1, wxEXPAND, 0 ); panel -> SetSizer(sizer); } diff --git a/packages/wx/src/bbwxSplit.cxx b/packages/wx/src/bbwxSplit.cxx index 8d05e10..2e61dc7 100644 --- a/packages/wx/src/bbwxSplit.cxx +++ b/packages/wx/src/bbwxSplit.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbwxSplit.cxx,v $ Language: C++ - Date: $Date: 2008/02/08 14:58:31 $ - Version: $Revision: 1.5 $ + Date: $Date: 2008/02/14 16:55:07 $ + Version: $Revision: 1.6 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -43,6 +43,8 @@ namespace bbwx bbSetInputWinTitle("Split"); bbSetInputOrientation("HORIZONTAL"); bbSetInputProportion(50); + bbSetInputWidget1(NULL); + bbSetInputWidget2(NULL); } void Split::Process() @@ -62,6 +64,8 @@ namespace bbwx wxWindow* w1 = bbGetInputWidget1(); wxWindow* w2 = bbGetInputWidget2(); + if (w1==NULL) { w1=new wxPanel(bbGetWxParent()); } + if (w2==NULL) { w2=new wxPanel(bbGetWxParent()); } w1->Reparent(w); w2->Reparent(w); int orientation=0; -- 2.45.1