]> Creatis software - creaWT.git/commitdiff
#3030 creaWT Bug New Normal - ComboBox update
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Wed, 19 Oct 2016 13:42:09 +0000 (15:42 +0200)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Wed, 19 Oct 2016 13:42:09 +0000 (15:42 +0200)
wt/bbtk_wt_PKG/src/bbwtComboBox.cxx

index 2a4bf63943863c8f31a9bf6615e63d55cbf77bd1..3ab014667bb14bfd98b72815ff8747650e9b5e5e 100644 (file)
@@ -15,7 +15,7 @@ namespace bbwt
                       int typeForm);
       ~ComboBoxWidget();
       void OnComboBox();
-         void AddItems( std::vector<std::string> lstIn );      
+         void SetItems( std::vector<std::string> lstIn );      
 
     private:
       int                              mTypeForm;
@@ -82,9 +82,12 @@ namespace bbwt
   }
 
 //--------------------------------------------------------------------------
-  void ComboBoxWidget::AddItems( std::vector<std::string> lstIn )
+  void ComboBoxWidget::SetItems( std::vector<std::string> lstIn )
   {
        int i;
+
+    selection->clear();
+
     for (i=0;i<lstIn.size(); i++)
     {
       selection->addItem(bbtk::std2wt(lstIn[i]));
@@ -101,9 +104,9 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ComboBox,bbtk::WtBlackBox);
 void ComboBox::Process()
 {
 
-       ComboBoxWidget *widget = (ComboBoxWidget *)bbGetOutputWidget();
-       widget->AddItems( bbGetInputIn() );
-  
+       ComboBoxWidget *widget = (ComboBoxWidget *)bbGetOutputWidget(); 
+       widget->SetItems( 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)