/*========================================================================= Program: bbtk Module: $RCSfile: bbwxCommandButton.h,v $ Language: C++ Date: $Date: 2008/02/15 12:47:18 $ 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. =========================================================================*//** * \brief Short description in one line * * Long description which * can span multiple lines */ /** * \file * \brief Pattern for the definition of a new type of Node (header) */ /** * \class bbtk::NodePatern * \brief Pattern for the definition of a new type of Node */ #ifdef _USE_WXWIDGETS_ #ifndef __bbwxCommandButton_h_INCLUDED_H__ #define __bbwxCommandButton_h_INCLUDED_H__ #include "bbtkWxBlackBox.h" namespace bbwx { class CommandButton; //-------------------------------------------------------------------------- class CommandButtonWidget : public wxPanel { public: CommandButtonWidget(CommandButton* box, wxWindow *parent, wxString title); ~CommandButtonWidget(); void OnCommandButton( wxEvent& ); void SetLabel(wxString title); void SetColour(wxColour color); private: CommandButton* mBox; wxButton *mwxCommandButton; }; //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- class /*BBTK_EXPORT*/ CommandButton : public bbtk::WxBlackBox { friend class CommandButtonWidget; BBTK_USER_BLACK_BOX_INTERFACE(CommandButton,bbtk::WxBlackBox); BBTK_DECLARE_INPUT(In, std::string ); BBTK_DECLARE_INPUT(Label, std::string ); BBTK_DECLARE_INPUT(Colour, std::vector ); // BBTK_DECLARE_OUTPUT(Out,int); BBTK_PROCESS(Process); void Process(); BBTK_CREATE_WIDGET(CreateWidget); void CreateWidget(); protected: virtual void bbUserConstructor(); private: void UpdateColour(); void UpdateLabel(); }; //================================================================= // UserBlackBox description BBTK_BEGIN_DESCRIBE_BLACK_BOX(CommandButton,bbtk::WxBlackBox); BBTK_NAME("CommandButton"); BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr"); BBTK_DESCRIPTION("Button which executes bbi commands"); typedef std::vector vectorcolour; BBTK_INPUT(CommandButton,In,"Commands to be executed separated by commas (;). Each single quote (') is replaced by a double quote (\").",std::string); BBTK_INPUT(CommandButton,Label,"Label of the button",std::string); BBTK_INPUT(CommandButton,Colour,"Colour of the button (-1 -1 -1 Background)",vectorcolour); // BBTK_OUTPUT(CommandButton,Out,"..Out..",int); BBTK_END_DESCRIBE_BLACK_BOX(CommandButton); //================================================================= }//namespace bbwx #endif // __bbwxCommandButton_h_INCLUDED_H__ #endif //_USE_WXWIDGETS_