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 "bbwtRadioButton.h"
5 #include "bbwtPackage.h"
11 class RadioButtonWidget : public Wt::WContainerWidget
14 RadioButtonWidget( RadioButton* box, Wt::WContainerWidget *parent,
17 std::vector<Wt::WString> lstIn );
27 Wt::WRadioButton *mwtRadioButton[10];
28 Wt::WButtonGroup *group;
33 //-------------------------------------------------------------------------
34 RadioButtonWidget::RadioButtonWidget( RadioButton* box,
35 Wt::WContainerWidget *parent,
38 std::vector<Wt::WString> lstIn )
40 Wt::WContainerWidget( parent) ,
43 Wt::WContainerWidget *panel = this;
44 MAX_RADIOBUTTON = lstIn.size();
48 Wt::WGroupBox *cont = new Wt::WGroupBox(title);
49 group = new Wt::WButtonGroup(panel);
52 for (i=0;i<MAX_RADIOBUTTON; i++)
56 //---------------------------------------------------------------------
57 // 1) Creation of the components of the widget
58 // Any top level sub-widget must have the panel returned by panel
60 mwtRadioButton[i] = new Wt::WRadioButton( lstIn[i],cont);
61 group->addButton(mwtRadioButton[i],i);
64 mwtRadioButton[i]->setChecked(true);
68 mwtRadioButton[i]->setChecked(false);
70 mwtRadioButton[i]->checked().connect(this,&RadioButtonWidget::OnRadioButton);
74 mwtRadioButton[i]=NULL;
78 panel->addWidget(cont);
81 //-------------------------------------------------------------------------
83 RadioButtonWidget::~RadioButtonWidget()
87 //-------------------------------------------------------------------------
89 int RadioButtonWidget::GetValue()
92 return group->checkedId();
95 //--------------------------------------------------------------------------
96 void RadioButtonWidget::OnRadioButton()
98 mBox->bbSetOutputOut( GetValue() );
99 mBox->bbSetInputIn( GetValue() );
100 mBox->bbSignalOutputModification("Out");
103 //--------------------------------------------------------------------------
104 //-------------------------------------------------------------------------
105 //--------------------------------------------------------------------------
106 //--------------------------------------------------------------------------
108 BBTK_ADD_BLACK_BOX_TO_PACKAGE(wt,RadioButton)
109 BBTK_BLACK_BOX_IMPLEMENTATION(RadioButton,bbtk::WtBlackBox);
111 // 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)
113 void RadioButton::Process()
118 // 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)
120 void RadioButton::CreateWidget(Wt::WContainerWidget* parent)
124 std::vector<wxString> lstIn;
125 lstIn.push_back( bbtk::std2wt(bbGetInputIn0()) );
126 lstIn.push_back( bbtk::std2wt(bbGetInputIn1()) );
127 lstIn.push_back( bbtk::std2wt(bbGetInputIn2()) );
128 lstIn.push_back( bbtk::std2wt(bbGetInputIn3()) );
129 lstIn.push_back( bbtk::std2wt(bbGetInputIn4()) );
130 lstIn.push_back( bbtk::std2wt(bbGetInputIn5()) );
131 lstIn.push_back( bbtk::std2wt(bbGetInputIn6()) );
132 lstIn.push_back( bbtk::std2wt(bbGetInputIn7()) );
133 lstIn.push_back( bbtk::std2wt(bbGetInputIn8()) );
134 lstIn.push_back( bbtk::std2wt(bbGetInputIn9()) );
136 RadioButtonWidget *w = new RadioButtonWidget(
141 bbtk::std2wt(bbGetInputTitle()),
144 bbSetOutputOut( bbGetInputIn() );
145 bbSetOutputWidget( w );
150 // 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)
152 void RadioButton::bbUserSetDefaultValues()
155 bbSetOutputOut( bbGetInputIn() );
168 // 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)
170 void RadioButton::bbUserInitializeProcessing()
175 // 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)
177 void RadioButton::bbUserFinalizeProcessing()