/*=========================================================================
Program: bbtk
- Module: $RCSfile: bbwxColourDialogButton.cxx,v $
+ Module: $RCSfile: bbwxColourSelectorButton.cxx,v $
Language: C++
- Date: $Date: 2008/02/14 16:55:07 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2008/02/20 11:36:29 $
+ 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
#ifdef _USE_WXWIDGETS_
-#include "bbwxColourDialogButton.h"
+#include "bbwxColourSelectorButton.h"
#include "bbwxPackage.h"
//-------------------------------------------------------------------------
-wxColourPickerCtrlWidget::wxColourPickerCtrlWidget( ColourDialogButton* box,
+wxColourPickerCtrlWidget::wxColourPickerCtrlWidget( ColourSelectorButton* box,
wxWindow *parent,
unsigned char cr,
unsigned char cg,
// std::cout << col << std::endl;
- ColourDialogButton* b = (ColourDialogButton*)mBox;
+ ColourSelectorButton* b = (ColourSelectorButton*)mBox;
b->bbSetOutputOut( col );
b->bbSignalOutputModification("Out");
}
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
+
+ BBTK_USER_BLACK_BOX_IMPLEMENTATION(ColourSelectorButton,bbtk::WxBlackBox);
+ BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,ColourSelectorButton);
- BBTK_USER_BLACK_BOX_IMPLEMENTATION(ColourDialogButton,bbtk::WxBlackBox);
- BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,ColourDialogButton);
-
- void ColourDialogButton::bbUserConstructor()
+ void ColourSelectorButton::bbUserConstructor()
{
bbSetInputIn("1 1 1");
}
-
-
- void ColourDialogButton::Process()
+
+
+ void ColourSelectorButton::Process()
{
- bbtkDebugMessageInc("Process",9,"ColourDialogButton::Process()"<<std::endl);
+ bbtkDebugMessageInc("Process",9,"ColourSelectorButton::Process()"<<std::endl);
pickerWidget->UpdateBox();
bbtkDebugDecTab("Process",9);
}
-
+
/**
- * \brief Create wxWidget .
+ * \brief Create wxWidget .
*
*
- */
- void ColourDialogButton::CreateWidget()
+ */
+ void ColourSelectorButton::CreateWidget()
{
- bbtkDebugMessage("Process",9,"=> ColourDialogButton::CreateWidget()"<<std::endl);
+ bbtkDebugMessage("Process",9,"=> ColourSelectorButton::CreateWidget()"<<std::endl);
float r,g,b;
sscanf( bbGetInputIn().c_str(), "%f %f %f", &r, &g ,&b);
pickerWidget = new wxColourPickerCtrlWidget(this, bbGetWxParent() , cr , cg , cb );
- bbtkDebugMessage("Process",9,"<= ColourDialogButton::CreateWidget()"<<std::endl);
+ bbtkDebugMessage("Process",9,"<= ColourSelectorButton::CreateWidget()"<<std::endl);
bbSetOutputWidget( pickerWidget );
}
/*=========================================================================
Program: bbtk
- Module: $RCSfile: bbwxColourDialogButton.h,v $
+ Module: $RCSfile: bbwxColourSelectorButton.h,v $
Language: C++
- Date: $Date: 2008/02/14 19:19:52 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2008/02/20 11:36:29 $
+ 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
*/
/**
- * \class bbwx::ColourDialogButton
+ * \class bbwx::ColourSelectorButton
* \brief
* \class bbwx::wxColourPickerCtrlWidget
// Prevents multiple inclusions : use symbols of the form
// __FILENAME_INCLUDED__
// where FILENAME must be replaced by the actual file name
-#ifndef __bbwxColourDialogButton_h_INCLUDED_H__
-#define __bbwxColourDialogButton_h_INCLUDED_H__
+#ifndef __bbwxColourSelectorButton_h_INCLUDED_H__
+#define __bbwxColourSelectorButton_h_INCLUDED_H__
// Include wxBlackBox definition
#include "bbtkWxBlackBox.h"
// bbPACKAGENAME
namespace bbwx
{
-
-class ColourDialogButton;
+class ColourSelectorButton;
class wxColourPickerCtrlWidget :public wxPanel
{
public:
- wxColourPickerCtrlWidget( ColourDialogButton* box,
- wxWindow *parent,
- unsigned char cr,
- unsigned char cg,
- unsigned char cb );
-
- ~wxColourPickerCtrlWidget();
- void OnColorChange(wxColourPickerEvent& e);
- void UpdateBox();
+ wxColourPickerCtrlWidget( ColourSelectorButton* box,
+ wxWindow *parent,
+ unsigned char cr,
+ unsigned char cg,
+ unsigned char cb );
+
+ ~wxColourPickerCtrlWidget();
+ void OnColorChange(wxColourPickerEvent& e);
+ void UpdateBox();
private:
- wxColourPickerCtrl *picker;
- ColourDialogButton *mBox;
+ wxColourPickerCtrl *picker;
+ ColourSelectorButton *mBox;
};
//------------------------------------------------------------------------
//------------------------------------------------------------------------
//------------------------------------------------------------------------
// The black box
- class /*BBTK_EXPORT*/ ColourDialogButton : public bbtk::WxBlackBox
+ class /*BBTK_EXPORT*/ ColourSelectorButton : public bbtk::WxBlackBox
{
- BBTK_USER_BLACK_BOX_INTERFACE(ColourDialogButton,bbtk::WxBlackBox);
+ BBTK_USER_BLACK_BOX_INTERFACE(ColourSelectorButton,bbtk::WxBlackBox);
BBTK_DECLARE_INPUT(In,std::string);
BBTK_DECLARE_OUTPUT(Out,std::string);
BBTK_PROCESS(Process);
void CreateWidget();
protected:
- virtual void bbUserConstructor();
+ virtual void bbUserConstructor();
private:
- wxColourPickerCtrlWidget* pickerWidget;
+ wxColourPickerCtrlWidget* pickerWidget;
};
//=================================================================
// UserBlackBox description
- BBTK_BEGIN_DESCRIBE_BLACK_BOX(ColourDialogButton,bbtk::WxBlackBox);
- BBTK_NAME("ColourDialogButton");
+ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ColourSelectorButton,bbtk::WxBlackBox);
+ BBTK_NAME("ColourSelectorButton");
BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
// Already inserted for any WxBlackBox BBTK_CATEGORY("widget");
BBTK_DESCRIPTION("A button which displays a colour picker dialog when clicked");
- BBTK_INPUT(ColourDialogButton,In,"Initial colour",std::string);
- BBTK_OUTPUT(ColourDialogButton,Out,"Colour choosen in format '[0,1] [0,1] [0,1]'",std::string);
- BBTK_END_DESCRIBE_BLACK_BOX(ColourDialogButton);
+ BBTK_INPUT(ColourSelectorButton,In,"Initial colour",std::string);
+ BBTK_OUTPUT(ColourSelectorButton,Out,"Colour choosen in format '[0,1] [0,1] [0,1]'",std::string);
+ BBTK_END_DESCRIBE_BLACK_BOX(ColourSelectorButton);
//=================================================================
}//namespace bbwx
-#endif // __bbwxColourDialogButton_h_INCLUDED_H__
+#endif // __bbwxColourSelectorButton_h_INCLUDED_H__
#endif //_USE_WXWIDGETS_