00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00048 #ifdef _USE_WXWIDGETS_
00049
00050
00051
00052
00053 #ifndef __bbwxColourSelectorButton_h_INCLUDED_H__
00054 #define __bbwxColourSelectorButton_h_INCLUDED_H__
00055
00056
00057 #include "bbtkWxBlackBox.h"
00058
00059 #include <wx/clrpicker.h>
00060
00061
00062
00063
00064 namespace bbwx
00065 {
00066
00067
00068 class ColourSelectorButton;
00069
00070 class wxColourPickerCtrlWidget :public wxPanel
00071 {
00072
00073 public:
00074 wxColourPickerCtrlWidget( ColourSelectorButton* box,
00075 wxWindow *parent,
00076 unsigned char cr,
00077 unsigned char cg,
00078 unsigned char cb );
00079
00080 ~wxColourPickerCtrlWidget();
00081 void OnColorChange(wxColourPickerEvent& e);
00082 void UpdateBox();
00083 private:
00084 wxColourPickerCtrl *picker;
00085 ColourSelectorButton *mBox;
00086 };
00087
00088
00089
00090 class ColourSelectorButton : public bbtk::WxBlackBox
00091 {
00092 BBTK_BLACK_BOX_INTERFACE(ColourSelectorButton,bbtk::WxBlackBox);
00093 BBTK_DECLARE_INPUT(In,std::string);
00094 BBTK_DECLARE_OUTPUT(Out,std::string);
00095 BBTK_PROCESS(Process);
00096 BBTK_CREATE_WIDGET(CreateWidget);
00097 void Process();
00098 void CreateWidget();
00099
00100 protected:
00101 virtual void bbUserConstructor();
00102
00103 private:
00104 wxColourPickerCtrlWidget* pickerWidget;
00105 };
00106
00107
00108
00109 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ColourSelectorButton,bbtk::WxBlackBox);
00110
00111 BBTK_NAME("ColourSelectorButton");
00112 BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
00113 BBTK_DESCRIPTION("A button which displays a colour picker dialog when clicked");
00114 BBTK_INPUT(ColourSelectorButton,In,"Initial colour",std::string,"colour");
00115 BBTK_OUTPUT(ColourSelectorButton,Out,"Colour choosen in format '[0,1] [0,1] [0,1]'",std::string,"colour");
00116 BBTK_END_DESCRIBE_BLACK_BOX(ColourSelectorButton);
00117
00118
00119 }
00120 #endif // __bbtkWxColourSelector_h__
00121
00122 #endif //_USE_WXWIDGETS_