X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=creaWT.git;a=blobdiff_plain;f=wt%2Fbbtk_wt_PKG%2Fsrc%2FbbwtInputText.cxx~;fp=wt%2Fbbtk_wt_PKG%2Fsrc%2FbbwtInputText.cxx~;h=0000000000000000000000000000000000000000;hp=ac665053e8be6e2a85027a3f8e5bba67a09330a1;hb=5bdd6bc07e285c2dc485dd053aaee47356d8689b;hpb=430578713a572cd83e04ca0f65c6e34e87879cd6 diff --git a/wt/bbtk_wt_PKG/src/bbwtInputText.cxx~ b/wt/bbtk_wt_PKG/src/bbwtInputText.cxx~ deleted file mode 100644 index ac66505..0000000 --- a/wt/bbtk_wt_PKG/src/bbwtInputText.cxx~ +++ /dev/null @@ -1,189 +0,0 @@ -//===== -// 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) -//===== -#include "bbwtInputText.h" -#include "bbwtPackage.h" -namespace bbwt -{ - //-------------------------------------------------------------------------- - class InputTextWidget : public Wt::WContainerWidget - { - public: - InputTextWidget(InputText* box, - Wt::WContainerWidget *parent, - Wt::WString In, - Wt::WString title - ); - ~InputTextWidget(); - - std::string GetValue(); - void SetValue(std::string value); - - void OnTextEnter(); - void OnTextUpdate(const Wt::WKeyEvent e); - - void SetTitle(Wt::WString); - - private: - InputText *mBox; - Wt::WLineEdit *mwtLineEdit; - Wt::WText *mwtTitle; - }; - - //------------------------------------------------------------------------ - //------------------------------------------------------------------------ - //------------------------------------------------------------------------ - - InputTextWidget::InputTextWidget(InputText* box, - Wt::WContainerWidget *parent, - Wt::WString In, - Wt::WString title) - : - Wt::WContainerWidget(parent), - mBox(box) - { - Wt::WContainerWidget *panel = this; - Wt::WBorderLayout *layout = new Wt::WBorderLayout(); - - - mwtLineEdit = new Wt::WLineEdit(); - - mwtLineEdit->changed().connect(this,&InputTextWidget::OnTextEnter); - mwtLineEdit->keyWentUp().connect(this, &InputTextWidget::OnTextUpdate); - - - mwtTitle = new Wt::WText(title); - - layout->addWidget(mwtTitle,Wt::WBorderLayout::North); - layout->addWidget(mwtLineEdit,Wt::WBorderLayout::Center); - - panel->setLayout(layout); - - } - //------------------------------------------------------------------------- - - InputTextWidget::~InputTextWidget() - { - } - - //------------------------------------------------------------------------- - - - void InputTextWidget::SetTitle(Wt::WString s) - { - mwtTitle->setText(s); - } - - //------------------------------------------------------------------------- - std::string InputTextWidget::GetValue() - { - return bbtk::wt2std ( mwtLineEdit->text() ); - } - - void InputTextWidget::SetValue(std::string value) - { - mwtLineEdit->setText( bbtk::std2wt(value) ) ; - } - - //-------------------------------------------------------------------------- - void InputTextWidget::OnTextEnter() - { - std::cout<<"bbwtInputText.cxx -> OnTextEnter pre if"<bbGetInputReactiveOnKeystroke()==1) - { - std::cout<<"bbwtInputText.cxx -> OnTextEnter if"<bbSetOutputOut( GetValue() ); - mBox->bbSetInputIn( GetValue() ); - mBox->bbSignalOutputModification("Out"); - } - } - - //-------------------------------------------------------------------------- - void InputTextWidget::OnTextUpdate(const Wt::WKeyEvent e) - { - std::cout<<"bbwtInputText.cxx -> pre If ...OnTextUpdate VALUE : "< pre If ...OnTextUpdate presionado : "< OnTextUpdate pre if"<bbGetInputReactiveOnKeystroke()==2 && e.key() != Wt::Key_Enter)||((mBox->bbGetInputReactiveOnKeystroke()==1 && e.key() == Wt::Key_Enter) )) - { - std::cout<<"bbwtInputText.cxx -> OnTextUpdate if"< OnTextUpdate VALUE : "<bbSetOutputOut( GetValue() + bbtk::wt2std(e.text()) ); - mBox->bbSetInputIn( GetValue() ); - mBox->bbSignalOutputModification("Out"); - } - - } - - - //-------------------------------------------------------------------------- - //------------------------------------------------------------------------- - //-------------------------------------------------------------------------- - //-------------------------------------------------------------------------- -BBTK_ADD_BLACK_BOX_TO_PACKAGE(wt,InputText) -BBTK_BLACK_BOX_IMPLEMENTATION(InputText,bbtk::WtBlackBox); -//===== -// 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) -//===== -void InputText::Process() -{ - - InputTextWidget *w=(InputTextWidget *)bbGetOutputWidget(); - if (w) - { - if (firsttime==true) - { - firsttime=false; - w->SetValue( bbGetInputIn().c_str() ); - } - w->SetTitle( bbtk::std2wt ( bbGetInputTitle() ) ); - bbSetOutputOut( w->GetValue() ); - } - else - { - bbSetOutputOut( "" ); - } -} -//===== -// 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) -//===== -void InputText::CreateWidget(Wt::WContainerWidget* parent) -{ - - bbSetOutputWidget - ( new InputTextWidget(this, //bbGetWxParent(), - parent, - bbtk::std2wt ( bbGetInputIn() ) , - bbtk::std2wt ( bbGetInputTitle() ) ) ); - Process(); -} -//===== -// 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) -//===== -void InputText::bbUserSetDefaultValues() -{ - firsttime=true; - bbSetInputTitle(""); - bbSetInputIn(""); - bbSetOutputWidget(0); - bbSetInputReactiveOnKeystroke(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) -//===== -void InputText::bbUserInitializeProcessing() -{ - -} -//===== -// 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) -//===== -void InputText::bbUserFinalizeProcessing() -{ - -} -} -// EO namespace bbwt - -