]> Creatis software - bbtk.git/blob - packages/wx/src/bbwxButtonExecBlackBox.h
93bc21acf9154de63234f67d22a49a4db9cec0c1
[bbtk.git] / packages / wx / src / bbwxButtonExecBlackBox.h
1 /*========================================================================= 
2                                                                                  
3   Program:   bbtk 
4   Module:    $RCSfile: bbwxButtonExecBlackBox.h,v $ 
5   Language:  C++ 
6   Date:      $Date: 2008/02/12 10:31:58 $ 
7   Version:   $Revision: 1.1 $ 
8                                                                                  
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. 
12                                                                                  
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. 
16                                                                                  
17 =========================================================================*//** 
18 /**
19  * \file 
20  * \brief Short description in one line
21  * 
22  * Long description which 
23  * can span multiple lines
24 */
25
26 /**
27  * \class bbwx::Slider
28  * \brief 
29
30  * \class bbwx::SliderWidget
31  * \brief 
32  */
33
34
35 #ifdef _USE_WXWIDGETS_
36  
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 __bbwxButtonExecBlackBox_h_INCLUDED_H__ 
41 #define __bbwxButtonExecBlackBox_h_INCLUDED_H__ 
42  
43  
44 // Include wxBlackBox definition
45 #include "bbtkWxBlackBox.h" 
46  
47  
48  
49 // Namespace of the package "wx" is "bbwx" 
50 // Namespace associated to packages should be of the form :
51 // bbPACKAGENAME
52 namespace bbwx 
53
54 //--------------------------------------------------------------------------
55 // Forward declaration of the box
56   class ButtonExecBlackBox;
57   
58   //--------------------------------------------------------------------------
59   // The widget created by the box 
60   class ButtonExecBlackBoxWidget : public wxPanel
61   {
62   public:
63         /// Ctor with the two first params the parent window and the creator box
64         /// which must be passed to the WxBlackBoxWidget constructor.
65         /// The other params initialize the widget 
66     ButtonExecBlackBoxWidget(ButtonExecBlackBox* box,
67                              wxWindow *parent, 
68                              wxString title);
69     ~ButtonExecBlackBoxWidget();
70     /// Events callbacks
71     void OnButton( wxEvent& );
72     
73     // Accessors
74     void SetLabel(wxString title);
75     void SetColour(wxColour color);
76         
77   private:
78         ButtonExecBlackBox              *mBox;
79     wxButton                            *mwxButton;
80   }; 
81    
82   //--------------------------------------------------------------------------
83   //--------------------------------------------------------------------------
84   //--------------------------------------------------------------------------
85
86   class /*BBTK_EXPORT*/ ButtonExecBlackBox : public bbtk::WxBlackBox 
87   {     
88     BBTK_USER_BLACK_BOX_INTERFACE(ButtonExecBlackBox,bbtk::WxBlackBox); 
89     BBTK_DECLARE_INPUT(In, std::string );       
90     BBTK_DECLARE_INPUT(Label, std::string ); 
91     BBTK_DECLARE_INPUT(Colour, std::vector<double> );   
92     //    BBTK_DECLARE_OUTPUT(Out,int); 
93     BBTK_CREATE_WIDGET(CreateWidget);
94     BBTK_PROCESS(Process); 
95     void Process();
96     void CreateWidget();
97
98   protected:
99     virtual void bbUserConstructor();
100
101   private:
102           ButtonExecBlackBoxWidget *mWidget;      
103   }; 
104   
105   //================================================================= 
106   // UserBlackBox description 
107   BBTK_BEGIN_DESCRIBE_BLACK_BOX(ButtonExecBlackBox,bbtk::WxBlackBox); 
108   BBTK_NAME("ButtonExecBlackBox"); 
109   BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr"); 
110   // Already inserted for any WxBlackBox  BBTK_CATEGORY("widget");
111   BBTK_DESCRIPTION("Button widget (Execute a BlackBox)"); 
112
113   typedef std::vector<double> vectorcolour;
114
115   BBTK_INPUT(ButtonExecBlackBox,In,"Name of the Black Box to be executed",std::string);   
116   BBTK_INPUT(ButtonExecBlackBox,Label,"Label of the button",std::string); 
117   BBTK_INPUT(ButtonExecBlackBox,Colour,"Colour of the button (-1 -1 -1  Background)",vectorcolour); 
118   //    BBTK_OUTPUT(ButtonExecBlackBox,Out,"..Out..",int); 
119   BBTK_END_DESCRIBE_BLACK_BOX(ButtonExecBlackBox); 
120   //================================================================= 
121  
122  
123 }//namespace  bbwx 
124  
125 #endif  // __bbwxButtonExecBlackBox_h_INCLUDED_H__ 
126  
127 #endif //_USE_WXWIDGETS_