]> Creatis software - creaWT.git/blob - wt/bbtk_wt_PKG/src/bbwtOutputText.cxx
559de567227dc59a87d97fc326669cee167756a1
[creaWT.git] / wt / bbtk_wt_PKG / src / bbwtOutputText.cxx
1 //===== 
2 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
3 //===== 
4 #include "bbwtOutputText.h"
5 #include "bbwtPackage.h"
6 namespace bbwt
7 {
8         class OutputTextWidget : public Wt::WContainerWidget
9         {
10                 public:
11                         OutputTextWidget(
12                                                                                                 Wt::WContainerWidget *parent,
13                                                                                                 Wt::WString text);
14                         ~OutputTextWidget();
15
16                         
17                         void setTextValue(Wt::WString newText);
18                         Wt::WString getTextValue();
19                         
20
21                 private:                                        
22                         
23                         Wt::WText* mText;
24                         
25         };
26
27         OutputTextWidget::OutputTextWidget(
28                                                                                                 Wt::WContainerWidget *parent,
29                                                                                                 Wt::WString text)
30                                                                                                 :
31                                                                                                 Wt::WContainerWidget(parent)
32         {
33                 
34                 Wt::WContainerWidget *panel = this;
35                 mText = new Wt::WText(text,panel);              
36                         
37         }
38
39         OutputTextWidget::~OutputTextWidget()
40         {
41         }
42
43         void OutputTextWidget::setTextValue(Wt::WString newText)
44         {
45                 std::cout<<"CAMBIANDO TEXTO--"<<bbtk::wt2std(newText)<<std::endl;
46                 mText->setText(newText);
47         }
48
49         Wt::WString OutputTextWidget::getTextValue()
50         {
51                 return mText->text();
52         }
53
54         
55
56 BBTK_ADD_BLACK_BOX_TO_PACKAGE(wt,OutputText)
57 BBTK_BLACK_BOX_IMPLEMENTATION(OutputText,bbtk::WtBlackBox);
58 //===== 
59 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
60 //===== 
61 void OutputText::Process()
62 {
63
64    std::string msg;
65     if (bbGetInputTitle()!="")
66       {
67         msg = bbGetInputTitle()+": " + bbGetInputIn();
68       }
69     else
70       {
71         msg = bbGetInputIn();
72       }
73    ((OutputTextWidget*)bbGetOutputWidget())->setTextValue( bbtk::std2wt( msg ) ); 
74   
75 }
76 //===== 
77 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
78 //===== 
79 void OutputText::CreateWidget(Wt::WContainerWidget* parent)
80 {
81    
82    bbSetOutputWidget( new OutputTextWidget(parent,bbtk::std2wt(bbGetInputIn()))) ;
83    Process();
84   
85 }
86 //===== 
87 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
88 //===== 
89 void OutputText::bbUserSetDefaultValues()
90 {
91
92 }
93 //===== 
94 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
95 //===== 
96 void OutputText::bbUserInitializeProcessing()
97 {
98
99 }
100 //===== 
101 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
102 //===== 
103 void OutputText::bbUserFinalizeProcessing()
104 {
105
106 }
107 }
108 // EO namespace bbwt
109
110