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)
4 #include "bbwtComboBox.h"
5 #include "bbwtPackage.h"
9 class ComboBoxWidget : public Wt::WContainerWidget
12 ComboBoxWidget(ComboBox* box, Wt::WContainerWidget *parent,
15 std::vector<std::string> lstIn,
23 Wt::WComboBox *wtCmbBox;
24 Wt::WSelectionBox *wtSlctBox;
25 Wt::WComboBox *selection;
30 //------------------------------------------------------------------------
31 //------------------------------------------------------------------------
32 //------------------------------------------------------------------------
35 ComboBoxWidget::ComboBoxWidget(ComboBox* box, Wt::WContainerWidget *parent,
38 std::vector<std::string> lstIn,
41 Wt::WContainerWidget(parent),
46 Wt::WContainerWidget *panel = this;
47 Wt::WBorderLayout *layout = new Wt::WBorderLayout();
51 layout->addWidget(new Wt::WText(title),Wt::WBorderLayout::North);
58 wtCmbBox = new Wt::WComboBox();
63 wtSlctBox = new Wt::WSelectionBox();
64 // wtSlctBox->setSelectionMode(Wt::ExtendedSelection);
65 selection = wtSlctBox;
67 for (i=0;i<lstIn.size(); i++)
69 selection->addItem(bbtk::std2wt(lstIn[i]));
72 selection->activated().connect(this,&ComboBoxWidget::OnComboBox);
74 layout->addWidget(selection,Wt::WBorderLayout::Center);
75 panel->setLayout(layout);
80 //-------------------------------------------------------------------------
82 ComboBoxWidget::~ComboBoxWidget()
86 //--------------------------------------------------------------------------
87 void ComboBoxWidget::OnComboBox()
89 mBox->bbSetInputSelection( selection->currentIndex() );
90 mBox->bbSetOutputOut( selection->currentIndex() );
91 mBox->bbSetOutputOutString( bbtk::wt2std( selection->valueText() ) );
92 mBox->bbSignalOutputModification("Out");
93 mBox->bbSignalOutputModification("OutString");
97 BBTK_ADD_BLACK_BOX_TO_PACKAGE(wt,ComboBox)
98 BBTK_BLACK_BOX_IMPLEMENTATION(ComboBox,bbtk::WtBlackBox);
100 // 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 void ComboBox::Process()
109 // 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)
111 void ComboBox::CreateWidget(Wt::WContainerWidget* parent)
114 ComboBoxWidget *w = new ComboBoxWidget(
117 bbGetInputSelection() ,
122 bbSetOutputOut( bbGetInputSelection() );
123 bbSetOutputOutString( bbGetInputIn()[ bbGetInputSelection() ] );
124 bbSetOutputWidget( w );
128 // 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)
130 void ComboBox::bbUserSetDefaultValues()
132 bbSetInputSelection(0);
137 // 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)
139 void ComboBox::bbUserInitializeProcessing()
144 // 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)
146 void ComboBox::bbUserFinalizeProcessing()