]> Creatis software - bbtk.git/blob - packages/wx/src/bbwxRadioButton.h
79bcb637c391ade01b874ceb813e6eb708366a3d
[bbtk.git] / packages / wx / src / bbwxRadioButton.h
1 /*=========================================================================                                                                               
2   Program:   bbtk
3   Module:    $RCSfile: bbwxRadioButton.h,v $
4   Language:  C++
5   Date:      $Date: 2008/11/24 15:45:51 $
6   Version:   $Revision: 1.6 $
7 =========================================================================*/
8
9 /* ---------------------------------------------------------------------
10
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
13 *
14 *  This software is governed by the CeCILL-B license under French law and 
15 *  abiding by the rules of distribution of free software. You can  use, 
16 *  modify and/ or redistribute the software under the terms of the CeCILL-B 
17 *  license as circulated by CEA, CNRS and INRIA at the following URL 
18 *  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
19 *  or in the file LICENSE.txt.
20 *
21 *  As a counterpart to the access to the source code and  rights to copy,
22 *  modify and redistribute granted by the license, users are provided only
23 *  with a limited warranty  and the software's author,  the holder of the
24 *  economic rights,  and the successive licensors  have only  limited
25 *  liability. 
26 *
27 *  The fact that you are presently reading this means that you have had
28 *  knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */                                                                         
30
31
32 /**
33  * \brief Short description in one line
34  * 
35  * Long description which 
36  * can span multiple lines
37  */
38 /**
39  * \file 
40  * \brief Pattern for the definition of a new type of Node (header)
41  */
42 /**
43  * \class bbtk::NodePatern 
44  * \brief Pattern for the definition of a new type of Node 
45  */
46
47
48 #ifdef _USE_WXWIDGETS_
49
50 // Prevents multiple inclusions : use symbols of the form
51 // __FILENAME_INCLUDED__ 
52 // where FILENAME must be replaced by the actual file name
53 #ifndef __bbWxRadioButton_h__
54 #define __bbWxRadioButton_h__
55
56 #include "bbtkWxBlackBox.h"
57
58 // Namespace of the package "wx" is "bbwx" 
59 // Namespace associated to packages should be of the form :
60 // bbPACKAGENAME
61 namespace bbwx
62 {
63   
64   
65   
66   
67   class RadioButton;
68   
69   //--------------------------------------------------------------------------
70   // The widget created by the box 
71   class RadioButtonWidget : public wxPanel
72   {
73   public:
74     RadioButtonWidget( RadioButton* box, wxWindow *parent, 
75                       int In, 
76                       wxString title, 
77                       std::vector<wxString> lstIn );
78
79     ~RadioButtonWidget();
80
81     int GetValue();
82     void OnRadioButton(wxEvent& event);
83
84   private:
85     RadioButton      *mBox;
86     int              MAX_RADIOBUTTON;
87     wxRadioButton    *mwxRadioButton[10];
88   };
89   
90   //------------------------------------------------------------------------
91   //------------------------------------------------------------------------
92   //------------------------------------------------------------------------
93
94   class /*BBTK_EXPORT*/ RadioButton : public bbtk::WxBlackBox
95   {
96
97     BBTK_BLACK_BOX_INTERFACE(RadioButton,bbtk::WxBlackBox);
98     BBTK_DECLARE_INPUT(In,int);
99     BBTK_DECLARE_INPUT(In0,std::string);
100     BBTK_DECLARE_INPUT(In1,std::string);
101     BBTK_DECLARE_INPUT(In2,std::string);
102     BBTK_DECLARE_INPUT(In3,std::string);
103     BBTK_DECLARE_INPUT(In4,std::string);
104     BBTK_DECLARE_INPUT(In5,std::string);
105     BBTK_DECLARE_INPUT(In6,std::string);
106     BBTK_DECLARE_INPUT(In7,std::string);
107     BBTK_DECLARE_INPUT(In8,std::string);
108     BBTK_DECLARE_INPUT(In9,std::string);
109     BBTK_DECLARE_INPUT(Title,std::string);
110     BBTK_DECLARE_OUTPUT(Out,int);
111     BBTK_CREATE_WIDGET(CreateWidget);
112     BBTK_PROCESS(Process);
113     void Process();
114     void CreateWidget(wxWindow*);
115
116   protected:
117     virtual void bbUserConstructor();
118   };
119  
120   //=================================================================
121   // UserBlackBox description
122   BBTK_BEGIN_DESCRIBE_BLACK_BOX(RadioButton,bbtk::WxBlackBox);
123   BBTK_NAME("RadioButton");
124   BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr");
125   BBTK_DESCRIPTION("RadioButton group widget 0-9 entries");
126   BBTK_INPUT(RadioButton,In,"Set initial item",int,"");
127
128   BBTK_INPUT(RadioButton,In0,"option 0",std::string,"");
129   BBTK_INPUT(RadioButton,In1,"option 1",std::string,"");
130   BBTK_INPUT(RadioButton,In2,"option 2",std::string,"");
131   BBTK_INPUT(RadioButton,In3,"option 3",std::string,"");
132   BBTK_INPUT(RadioButton,In4,"option 4",std::string,"");
133   BBTK_INPUT(RadioButton,In5,"option 5",std::string,"");
134   BBTK_INPUT(RadioButton,In6,"option 6",std::string,"");
135   BBTK_INPUT(RadioButton,In7,"option 7",std::string,"");
136   BBTK_INPUT(RadioButton,In8,"option 8",std::string,"");
137   BBTK_INPUT(RadioButton,In9,"option 9",std::string,"");
138
139   BBTK_INPUT(RadioButton,Title,"Title of the widget (default '') ",
140              std::string,"");
141
142   BBTK_OUTPUT(RadioButton,Out,"Item selected",int,"");
143   BBTK_END_DESCRIBE_BLACK_BOX(RadioButton);
144   //=================================================================
145
146 }
147
148 //namespace bbtk
149 #endif  //__bbWxRadioButton_h__
150
151 #endif //_USE_WXWIDGETS_