From 6c157b0a50ff0852d0441e3cadc4df6342eb22ba Mon Sep 17 00:00:00 2001 From: jean-pierre roux Date: Wed, 20 Feb 2008 11:51:59 +0000 Subject: [PATCH] ColourDialog -> ColourSelector --- packages/wx/src/bbwxColourSelector.cxx | 73 ++++++++++++++++++++++++ packages/wx/src/bbwxColourSelector.h | 79 ++++++++++++++++++++++++++ 2 files changed, 152 insertions(+) create mode 100644 packages/wx/src/bbwxColourSelector.cxx create mode 100644 packages/wx/src/bbwxColourSelector.h diff --git a/packages/wx/src/bbwxColourSelector.cxx b/packages/wx/src/bbwxColourSelector.cxx new file mode 100644 index 0000000..cf6547e --- /dev/null +++ b/packages/wx/src/bbwxColourSelector.cxx @@ -0,0 +1,73 @@ +/*========================================================================= + + Program: bbtk + Module: $RCSfile: bbwxColourSelector.cxx,v $ + Language: C++ + Date: $Date: 2008/02/20 11:51:59 $ + 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 "bbwxColourSelector.h" +#include "bbwxPackage.h" + +#include + + + +namespace bbwx +{ + + BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,ColourSelector); + BBTK_USER_BLACK_BOX_IMPLEMENTATION(ColourSelector,bbtk::AtomicBlackBox); + + + void ColourSelector::bbUserConstructor() + { + } + + void ColourSelector::Process() + { + bbtkDebugMessageInc("Core",9,"ColourSelector::Process() [" + <ShowModal(); + if (colordialog->GetReturnCode()==wxID_OK) + { + char col[100]; + wxColour& c = colordialog->GetColourData().GetColour(); + sprintf(col,"%f %f %f",c.Red()/255.,c.Green()/255.,c.Blue()/255.); + bbSetOutputOut( col ); + } else { + bbSetOutputOut(""); + } + bbtkDebugDecTab("Core",9); + } + +// void ColourSelector::CreateWidget() +// { +// mColorDialog = new wxColourSelector( 0 ); +// bbSetOutputWidget( mColourSelector ); +// } + +}//namespace bbwx + +#endif // _USE_WXWIDGETS_ + diff --git a/packages/wx/src/bbwxColourSelector.h b/packages/wx/src/bbwxColourSelector.h new file mode 100644 index 0000000..cae667b --- /dev/null +++ b/packages/wx/src/bbwxColourSelector.h @@ -0,0 +1,79 @@ +/*========================================================================= + + Program: bbtk + Module: $RCSfile: bbwxColourSelector.h,v $ + Language: C++ + Date: $Date: 2008/02/20 11:51:59 $ + 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 __bbWxColourSelector_h__ +#define __bbWxColourSelector_h__ + +#include "bbtkWxBlackBox.h" + +// Namespace of the package "wx" is "bbwx" +// Namespace associated to packages should be of the form : +// bbPACKAGENAME +namespace bbwx +{ + + //================================================================= + class /*BBTK_EXPORT*/ ColourSelector : public bbtk::AtomicBlackBox + { + BBTK_USER_BLACK_BOX_INTERFACE(ColourSelector,bbtk::AtomicBlackBox); + BBTK_DECLARE_OUTPUT(Out,std::string); + BBTK_PROCESS(Process); +// BBTK_CREATE_WIDGET(CreateWidget); + void Process(); +// void CreateWidget(); + + protected: + virtual void bbUserConstructor(); + // private: + // wxColourSelector* mColorDialog; + }; + //================================================================= + + //================================================================= + // UserBlackBox description + BBTK_BEGIN_DESCRIBE_BLACK_BOX(ColourSelector,bbtk::AtomicBlackBox); + // Already inserted for any WxBlackBox BBTK_CATEGORY("widget"); + BBTK_NAME("ColourSelector"); + BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr"); + BBTK_DESCRIPTION("Colour Selector dialog (bbfication of wxColourSelector)"); + BBTK_OUTPUT(ColourSelector,Out,"The colour selected by the user",std::string); + BBTK_END_DESCRIBE_BLACK_BOX(ColourSelector); + //================================================================= + +} + +//namespace bbtk +#endif //__bbtkWxColourSelector_h__ + +#endif //_USE_WXWIDGETS_ -- 2.47.1