1 /*=========================================================================
4 Module: $RCSfile: bbwxColourSelectorButton.h,v $
6 Date: $Date: 2008/09/10 12:01:47 $
7 Version: $Revision: 1.6 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
21 * \brief Short description in one line
23 * Long description which
24 * can span multiple lines
28 * \class bbwx::ColourSelectorButton
31 * \class bbwx::wxColourPickerCtrlWidget
35 #ifdef _USE_WXWIDGETS_
37 // Prevents multiple inclusions : use symbols of the form
38 // __FILENAME_INCLUDED__
39 // where FILENAME must be replaced by the actual file name
40 #ifndef __bbwxColourSelectorButton_h_INCLUDED_H__
41 #define __bbwxColourSelectorButton_h_INCLUDED_H__
43 // Include wxBlackBox definition
44 #include "bbtkWxBlackBox.h"
46 #include <wx/clrpicker.h>
48 // Namespace of the package "wx" is "bbwx"
49 // Namespace associated to packages should be of the form :
54 //=================================================================
55 class ColourSelectorButton;
57 class wxColourPickerCtrlWidget :public wxPanel
61 wxColourPickerCtrlWidget( ColourSelectorButton* box,
67 ~wxColourPickerCtrlWidget();
68 void OnColorChange(wxColourPickerEvent& e);
71 wxColourPickerCtrl *picker;
72 ColourSelectorButton *mBox;
75 //------------------------------------------------------------------------
77 class /*BBTK_EXPORT*/ ColourSelectorButton : public bbtk::WxBlackBox
79 BBTK_BLACK_BOX_INTERFACE(ColourSelectorButton,bbtk::WxBlackBox);
80 BBTK_DECLARE_INPUT(In,std::string);
81 BBTK_DECLARE_OUTPUT(Out,std::string);
82 BBTK_PROCESS(Process);
83 BBTK_CREATE_WIDGET(CreateWidget);
88 virtual void bbUserConstructor();
91 wxColourPickerCtrlWidget* pickerWidget;
94 //=================================================================
95 // UserBlackBox description
96 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ColourSelectorButton,bbtk::WxBlackBox);
97 // Already inserted for any WxBlackBox BBTK_CATEGORY("widget");
98 BBTK_NAME("ColourSelectorButton");
99 BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
100 BBTK_DESCRIPTION("A button which displays a colour picker dialog when clicked");
101 BBTK_INPUT(ColourSelectorButton,In,"Initial colour",std::string,"colour");
102 BBTK_OUTPUT(ColourSelectorButton,Out,"Colour choosen in format '[0,1] [0,1] [0,1]'",std::string,"colour");
103 BBTK_END_DESCRIBE_BLACK_BOX(ColourSelectorButton);
104 //=================================================================
107 #endif // __bbtkWxColourSelector_h__
109 #endif //_USE_WXWIDGETS_