]> Creatis software - creaWT.git/blob - wt/bbtk_wt_PKG/src/bbwtOutputText.cxx
12e6de7805f93237356b6ea4e955af9c9703a621
[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                 mText->setText(newText);
46         }
47
48         Wt::WString OutputTextWidget::getTextValue()
49         {
50                 return mText->text();
51         }
52
53         
54
55 BBTK_ADD_BLACK_BOX_TO_PACKAGE(wt,OutputText)
56 BBTK_BLACK_BOX_IMPLEMENTATION(OutputText,bbtk::WtBlackBox);
57 //===== 
58 // 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)
59 //===== 
60 void OutputText::Process()
61 {
62
63    std::string msg;
64     if (bbGetInputTitle()!="")
65       {
66         msg = bbGetInputTitle()+": " + bbGetInputIn();
67       }
68     else
69       {
70         msg = bbGetInputIn();
71       }
72    ((OutputTextWidget*)bbGetOutputWidget())->setTextValue( bbtk::std2wt( msg ) ); 
73   
74 }
75 //===== 
76 // 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)
77 //===== 
78 void OutputText::CreateWidget(Wt::WContainerWidget* parent)
79 {
80    
81    bbSetOutputWidget( new OutputTextWidget(parent,bbtk::std2wt(bbGetInputIn()))) ;
82   
83 }
84 //===== 
85 // 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)
86 //===== 
87 void OutputText::bbUserSetDefaultValues()
88 {
89
90 }
91 //===== 
92 // 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)
93 //===== 
94 void OutputText::bbUserInitializeProcessing()
95 {
96
97 }
98 //===== 
99 // 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)
100 //===== 
101 void OutputText::bbUserFinalizeProcessing()
102 {
103
104 }
105 }
106 // EO namespace bbwt
107
108