--- /dev/null
+/*=========================================================================
+
+ 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 <wx/colordlg.h>
+
+
+
+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() ["
+ <<bbGetFullName()<<"]"<<std::endl);
+
+ wxColourDialog *colordialog = new wxColourDialog( 0 );
+ colordialog->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_
+
--- /dev/null
+/*=========================================================================
+
+ 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_