X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=creaWT.git;a=blobdiff_plain;f=wt%2Fbbtk_wt_PKG%2Fsrc%2FbbwtComboBox.cxx~;fp=wt%2Fbbtk_wt_PKG%2Fsrc%2FbbwtComboBox.cxx~;h=0000000000000000000000000000000000000000;hp=2a4bf63943863c8f31a9bf6615e63d55cbf77bd1;hb=5bdd6bc07e285c2dc485dd053aaee47356d8689b;hpb=430578713a572cd83e04ca0f65c6e34e87879cd6 diff --git a/wt/bbtk_wt_PKG/src/bbwtComboBox.cxx~ b/wt/bbtk_wt_PKG/src/bbwtComboBox.cxx~ deleted file mode 100644 index 2a4bf63..0000000 --- a/wt/bbtk_wt_PKG/src/bbwtComboBox.cxx~ +++ /dev/null @@ -1,153 +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 "bbwtComboBox.h" -#include "bbwtPackage.h" -namespace bbwt -{ - - class ComboBoxWidget : public Wt::WContainerWidget - { - public: - ComboBoxWidget(ComboBox* box, Wt::WContainerWidget *parent, - int iSelection, - Wt::WString title, - int typeForm); - ~ComboBoxWidget(); - void OnComboBox(); - void AddItems( std::vector lstIn ); - - private: - int mTypeForm; - ComboBox *mBox; - Wt::WComboBox *wtCmbBox; - Wt::WSelectionBox *wtSlctBox; - Wt::WComboBox *selection; - //TODO choice - - }; - - //------------------------------------------------------------------------ - //------------------------------------------------------------------------ - //------------------------------------------------------------------------ - - - ComboBoxWidget::ComboBoxWidget(ComboBox* box, Wt::WContainerWidget *parent, - int iSelection, - Wt::WString title, - int typeForm) - : - Wt::WContainerWidget(parent), - mBox(box), - mTypeForm(typeForm) - { - - Wt::WContainerWidget *panel = this; - Wt::WBorderLayout *layout = new Wt::WBorderLayout(); - int i; - if(title!="") - { - layout->addWidget(new Wt::WText(title),Wt::WBorderLayout::North); - } - - if(mTypeForm == 0) - { - wtCmbBox = new Wt::WComboBox(); - selection = wtCmbBox; - } else { - wtSlctBox = new Wt::WSelectionBox(); - // wtSlctBox->setSelectionMode(Wt::ExtendedSelection); - selection = wtSlctBox; - } - - selection->activated().connect(this,&ComboBoxWidget::OnComboBox); - - layout->addWidget(selection,Wt::WBorderLayout::Center); - panel->setLayout(layout); - } - -//------------------------------------------------------------------------- - ComboBoxWidget::~ComboBoxWidget() - { - } - -//-------------------------------------------------------------------------- - void ComboBoxWidget::OnComboBox() - { - mBox->bbSetInputSelection( selection->currentIndex() ); - mBox->bbSetOutputOut( selection->currentIndex() ); - mBox->bbSetOutputOutString( bbtk::wt2std( selection->valueText() ) ); - mBox->bbSignalOutputModification("Out"); - mBox->bbSignalOutputModification("OutString"); - } - -//-------------------------------------------------------------------------- - void ComboBoxWidget::AddItems( std::vector lstIn ) - { - int i; - for (i=0;iaddItem(bbtk::std2wt(lstIn[i])); - } // for i - } - - - -BBTK_ADD_BLACK_BOX_TO_PACKAGE(wt,ComboBox) -BBTK_BLACK_BOX_IMPLEMENTATION(ComboBox,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 ComboBox::Process() -{ - - ComboBoxWidget *widget = (ComboBoxWidget *)bbGetOutputWidget(); - widget->AddItems( bbGetInputIn() ); - -} -//===== -// 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 ComboBox::CreateWidget(Wt::WContainerWidget* parent) -{ - - ComboBoxWidget *w = new ComboBoxWidget( - this, - parent, - bbGetInputSelection() , - bbGetInputTitle(), -// bbGetInputIn(), - bbGetInputForm() ); - - bbSetOutputOut( bbGetInputSelection() ); - bbSetOutputOutString( bbGetInputIn()[ bbGetInputSelection() ] ); - bbSetOutputWidget( w ); - -} -//===== -// 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 ComboBox::bbUserSetDefaultValues() -{ - bbSetInputSelection(0); - bbSetInputTitle(""); - bbSetInputForm(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) -//===== -void ComboBox::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 ComboBox::bbUserFinalizeProcessing() -{ - -} -} -// EO namespace bbwt - -