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
00047 #ifdef _USE_WXWIDGETS_
00048
00049 #ifndef __bbwxCommandButton_h_INCLUDED_H__
00050 #define __bbwxCommandButton_h_INCLUDED_H__
00051
00052
00053 #include "bbtkWxBlackBox.h"
00054
00055
00056
00057 namespace bbwx
00058 {
00059 class CommandButton;
00060
00061
00062 class CommandButtonWidget : public wxPanel
00063 {
00064 public:
00065 CommandButtonWidget(CommandButton* box, wxWindow *parent,
00066 wxString title);
00067 ~CommandButtonWidget();
00068 void OnCommandButton( wxEvent& );
00069 void SetLabel(wxString title);
00070 void SetColour(wxColour color);
00071
00072 private:
00073 CommandButton* mBox;
00074 wxButton *mwxCommandButton;
00075 };
00076
00077
00078
00079
00080
00081 class CommandButton : public bbtk::WxBlackBox
00082 {
00083 friend class CommandButtonWidget;
00084 BBTK_BLACK_BOX_INTERFACE(CommandButton,bbtk::WxBlackBox);
00085 BBTK_DECLARE_INPUT(In, std::string );
00086 BBTK_DECLARE_INPUT(Label, std::string );
00087 BBTK_DECLARE_INPUT(Colour, std::vector<double> );
00088
00089 BBTK_PROCESS(Process);
00090 void Process();
00091 BBTK_CREATE_WIDGET(CreateWidget);
00092 void CreateWidget();
00093 protected:
00094 virtual void bbUserConstructor();
00095
00096
00097 private:
00098 void UpdateColour();
00099 void UpdateLabel();
00100 };
00101
00102
00103
00104 BBTK_BEGIN_DESCRIBE_BLACK_BOX(CommandButton,bbtk::WxBlackBox);
00105 BBTK_NAME("CommandButton");
00106 BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr");
00107 BBTK_DESCRIPTION("Button which executes bbi commands");
00108
00109 typedef std::vector<double> vectorcolour;
00110
00111 BBTK_INPUT(CommandButton,In,"Commands to be executed separated by commas (;). Each single quote (') is replaced by a double quote (\").",std::string,"");
00112 BBTK_INPUT(CommandButton,Label,"Label of the button",std::string,"");
00113 BBTK_INPUT(CommandButton,Colour,"Colour of the button (-1 -1 -1 Background)",vectorcolour,"colour");
00114
00115 BBTK_END_DESCRIBE_BLACK_BOX(CommandButton);
00116
00117
00118
00119 }
00120
00121 #endif // __bbwxCommandButton_h_INCLUDED_H__
00122
00123 #endif //_USE_WXWIDGETS_