]> Creatis software - bbtk.git/blobdiff - packages/wx/src/bbwxRadioButton.cxx
#3504 RadioButton first select item
[bbtk.git] / packages / wx / src / bbwxRadioButton.cxx
index 7b670ad65d53c8e776171970e484f11326e69c04..278ebf6465406628a20db05a81e37747e87e372b 100644 (file)
@@ -62,16 +62,13 @@ namespace bbwx
                       std::vector<wxString> lstIn );
 
     ~RadioButtonWidget();
-
     int GetValue();
     void OnRadioButton(wxEvent& event);
        void AddElements(std::vector<wxString> lstIn, int In, wxString title);
-
   private:
     RadioButton      *mBox;
     int                     MAX_RADIOBUTTON;
-    wxRadioButton    *mwxRadioButton[10];
-
+    wxRadioButton    *mwxRadioButton[25];
        wxFlexGridSizer  *sizer;
   };
   
@@ -91,7 +88,7 @@ namespace bbwx
   {
     AddElements(  lstIn , In,title);
     mBox->bbSetOutputOut( GetValue() );
-    mBox->bbSetInputIn( GetValue() );
+//    mBox->bbSetInputIn( GetValue() );
   }
   
   //-------------------------------------------------------------------------
@@ -113,9 +110,10 @@ namespace bbwx
                if (mwxRadioButton[i]->GetValue()==true)
                {
                                result=i;
-               }
-               } // if GetValue
-      } // if mwxRadioButton
+               } // if Value
+               } // if NULL
+    } // for i
+    
     return result;
   }
 
@@ -146,8 +144,8 @@ namespace bbwx
     // Any top level sub-widget must have the panel returned by panel
     // for parent
              mwxRadioButton[i] = new wxRadioButton( panel, -1, lstIn[i],wxDefaultPosition, wxDefaultSize, style);
-             style=0;
-             if (In==i)
+             style = 0;
+             if (i==In)
              {
                      mwxRadioButton[i]->SetValue(true);
              } else {
@@ -160,8 +158,8 @@ namespace bbwx
                   &RadioButtonWidget::OnRadioButton ); 
           } else {
               mwxRadioButton[i]=NULL;
-          } // if
-    } // for 
+          } // if not =_T("")
+    } // for i
     
     //---------------------------------------------------------------------
     // 2) Insertion of the components in the window