]> Creatis software - bbtk.git/blob - packages/wx/src/bbwxInputText.h
=== MAJOR RELEASE ====
[bbtk.git] / packages / wx / src / bbwxInputText.h
1 /*=========================================================================
2                                                                                 
3   Program:   bbtk
4   Module:    $RCSfile: bbwxInputText.h,v $
5   Language:  C++
6   Date:      $Date: 2008/04/18 12:59:52 $
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
36 #ifndef __bbWxInputText_h__
37 #define __bbWxInputText_h__
38
39 #include "bbtkWxBlackBox.h"
40
41
42
43 namespace bbwx
44 {
45   
46   
47   
48   
49   class InputText;
50   
51   //--------------------------------------------------------------------------
52   class InputTextWidget : wxPanel
53   {
54   public:
55     InputTextWidget(InputText* box, wxWindow *parent,
56                     wxString In, wxString title);
57     ~InputTextWidget();
58
59     std::string GetValue();
60     void OnTextUpdate(wxCommandEvent& event);
61
62     void SetTitle(wxString);
63
64   private:
65     InputText    *mBox;
66     wxTextCtrl   *mwxTextCtrl;
67     wxStaticText *mwxTitle;
68   };
69   
70   //------------------------------------------------------------------------
71   //------------------------------------------------------------------------
72   //------------------------------------------------------------------------
73
74   
75   
76   
77   
78   class /*BBTK_EXPORT*/ InputText : public bbtk::WxBlackBox
79   {
80     
81     BBTK_BLACK_BOX_INTERFACE(InputText,bbtk::WxBlackBox);
82     BBTK_DECLARE_INPUT(In,std::string);
83     BBTK_DECLARE_INPUT(Title,std::string);
84     BBTK_DECLARE_OUTPUT(Out,std::string);
85     BBTK_PROCESS(Process);
86     void Process();
87     BBTK_CREATE_WIDGET(CreateWidget);
88     void CreateWidget();
89     
90   protected:
91     virtual void bbUserConstructor();
92   };
93   
94  
95   //=================================================================
96   // UserBlackBox description
97   BBTK_BEGIN_DESCRIBE_BLACK_BOX(InputText,bbtk::WxBlackBox);
98   BBTK_NAME("InputText");
99   BBTK_AUTHOR("laurent guigues at creatis.insa-lyon.fr");
100   BBTK_DESCRIPTION("A zone in which the user can enter a text (wxTextCtrl)");
101   BBTK_INPUT(InputText,In,"Initial text (default '')",std::string,"");
102
103   BBTK_INPUT(InputText,Title,"Title of the input zone (default '') ",
104              std::string,"");
105
106   BBTK_OUTPUT(InputText,Out,"Current text",std::string,"");
107   BBTK_END_DESCRIBE_BLACK_BOX(InputText);
108   //=================================================================
109
110
111
112 }
113
114
115
116 //namespace bbtk
117 #endif  //__bbWxInputText_h__
118
119 #endif //_USE_WXWIDGETS_