]> Creatis software - bbtk.git/blob - packages/wx/src/bbwxRadioButton.h
=== MAJOR RELEASE ====
[bbtk.git] / packages / wx / src / bbwxRadioButton.h
1 /*=========================================================================
2                                                                                 
3   Program:   bbtk
4   Module:    $RCSfile: bbwxRadioButton.h,v $
5   Language:  C++
6   Date:      $Date: 2008/04/18 12:59:53 $
7   Version:   $Revision: 1.3 $
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  * \brief Short description in one line
19  * 
20  * Long description which 
21  * can span multiple lines
22  */
23 /**
24  * \file 
25  * \brief Pattern for the definition of a new type of Node (header)
26  */
27 /**
28  * \class bbtk::NodePatern 
29  * \brief Pattern for the definition of a new type of Node 
30  */
31
32
33 #ifdef _USE_WXWIDGETS_
34
35 // Prevents multiple inclusions : use symbols of the form
36 // __FILENAME_INCLUDED__ 
37 // where FILENAME must be replaced by the actual file name
38 #ifndef __bbWxRadioButton_h__
39 #define __bbWxRadioButton_h__
40
41 #include "bbtkWxBlackBox.h"
42
43 // Namespace of the package "wx" is "bbwx" 
44 // Namespace associated to packages should be of the form :
45 // bbPACKAGENAME
46 namespace bbwx
47 {
48   
49   
50   
51   
52   class RadioButton;
53   
54   //--------------------------------------------------------------------------
55   // The widget created by the box 
56   class RadioButtonWidget : public wxPanel
57   {
58   public:
59     RadioButtonWidget( RadioButton* box, wxWindow *parent, 
60                       int In, 
61                       wxString title, 
62                       std::vector<wxString> lstIn );
63
64     ~RadioButtonWidget();
65
66     int GetValue();
67     void OnRadioButton(wxEvent& event);
68
69   private:
70     RadioButton      *mBox;
71     int              MAX_RADIOBUTTON;
72     wxRadioButton    *mwxRadioButton[10];
73   };
74   
75   //------------------------------------------------------------------------
76   //------------------------------------------------------------------------
77   //------------------------------------------------------------------------
78
79   class /*BBTK_EXPORT*/ RadioButton : public bbtk::WxBlackBox
80   {
81
82     BBTK_BLACK_BOX_INTERFACE(RadioButton,bbtk::WxBlackBox);
83     BBTK_DECLARE_INPUT(In,int);
84     BBTK_DECLARE_INPUT(In0,std::string);
85     BBTK_DECLARE_INPUT(In1,std::string);
86     BBTK_DECLARE_INPUT(In2,std::string);
87     BBTK_DECLARE_INPUT(In3,std::string);
88     BBTK_DECLARE_INPUT(In4,std::string);
89     BBTK_DECLARE_INPUT(In5,std::string);
90     BBTK_DECLARE_INPUT(In6,std::string);
91     BBTK_DECLARE_INPUT(In7,std::string);
92     BBTK_DECLARE_INPUT(In8,std::string);
93     BBTK_DECLARE_INPUT(In9,std::string);
94     BBTK_DECLARE_INPUT(Title,std::string);
95     BBTK_DECLARE_OUTPUT(Out,int);
96     BBTK_CREATE_WIDGET(CreateWidget);
97     BBTK_PROCESS(Process);
98     void Process();
99     void CreateWidget();
100
101   protected:
102     virtual void bbUserConstructor();
103
104   };
105  
106   //=================================================================
107   // UserBlackBox description
108   BBTK_BEGIN_DESCRIBE_BLACK_BOX(RadioButton,bbtk::WxBlackBox);
109   BBTK_NAME("RadioButton");
110   BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr");
111   BBTK_DESCRIPTION("RadioButton group widget 0-9 entries");
112   BBTK_INPUT(RadioButton,In,"Set initial item",int,"");
113
114   BBTK_INPUT(RadioButton,In0,"option 0",std::string,"");
115   BBTK_INPUT(RadioButton,In1,"option 1",std::string,"");
116   BBTK_INPUT(RadioButton,In2,"option 2",std::string,"");
117   BBTK_INPUT(RadioButton,In3,"option 3",std::string,"");
118   BBTK_INPUT(RadioButton,In4,"option 4",std::string,"");
119   BBTK_INPUT(RadioButton,In5,"option 5",std::string,"");
120   BBTK_INPUT(RadioButton,In6,"option 6",std::string,"");
121   BBTK_INPUT(RadioButton,In7,"option 7",std::string,"");
122   BBTK_INPUT(RadioButton,In8,"option 8",std::string,"");
123   BBTK_INPUT(RadioButton,In9,"option 9",std::string,"");
124
125   BBTK_INPUT(RadioButton,Title,"Title of the widget (default '') ",
126              std::string,"");
127
128   BBTK_OUTPUT(RadioButton,Out,"Item selected",int,"");
129   BBTK_END_DESCRIBE_BLACK_BOX(RadioButton);
130   //=================================================================
131
132 }
133
134 //namespace bbtk
135 #endif  //__bbWxRadioButton_h__
136
137 #endif //_USE_WXWIDGETS_