]> Creatis software - bbtk.git/blobdiff - packages/wx/src/bbwxRadioButton.cxx
#3496 Linux Bug
[bbtk.git] / packages / wx / src / bbwxRadioButton.cxx
index 8ff7751aeeb00911f08b3e5c6e9077b154ea3f64..fed13e89d463834126593f8520968442d387db0b 100644 (file)
@@ -90,64 +90,6 @@ namespace bbwx
     mBox(box)
   {
 
-/*
-    MAX_RADIOBUTTON = lstIn.size();
-    wxPanel *panel     = this;
-    int i;
-    long style=wxRB_GROUP;
-    for (i=0;i<MAX_RADIOBUTTON; i++)
-    {
-          if ( lstIn[i]!=_T(""))
-          {
-    //---------------------------------------------------------------------
-    // 1) Creation of the components of the widget
-    // 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)
-             {
-                     mwxRadioButton[i]->SetValue(true);
-             } else {
-                     mwxRadioButton[i]->SetValue(false);
-             }
-              Connect( mwxRadioButton[i]->GetId(),  
-                   wxEVT_COMMAND_RADIOBUTTON_SELECTED, 
-                  (wxObjectEventFunction) 
-                  (void (wxPanel::*)(wxEvent&))
-                  &RadioButtonWidget::OnRadioButton ); 
-          } else {
-              mwxRadioButton[i]=NULL;
-          } // if
-    } // for 
-    
-    //---------------------------------------------------------------------
-    // 2) Insertion of the components in the window
-    
-    // We use a FlexGridSizer
-
-//EED 2018-04-18
-//    wxFlexGridSizer *sizer   = new wxFlexGridSizer(1);
-    sizer      = new wxFlexGridSizer(1);
-
-    if (title!=_T(""))
-    {
-          sizer->Add( new wxStaticText(panel,-1, title ) ); 
-    }
-    for (i=0;i<MAX_RADIOBUTTON; i++)
-    {
-       if (mwxRadioButton[i]!=NULL)
-       {
-          sizer->Add( mwxRadioButton[i],1,wxGROW ); 
-       }
-    }
-    sizer->AddGrowableCol(0);
-    panel->SetSizer(sizer);
-
-//    panel->SetAutoLayout(true);
-//    panel->Layout();
-*/
-
   }
   //-------------------------------------------------------------------------
   
@@ -241,10 +183,8 @@ namespace bbwx
     sizer->AddGrowableCol(0);
     panel->SetSizer(sizer);
 
-//    panel->SetAutoLayout(true);
-//    panel->Layout();
-
-
+    panel->SetAutoLayout(true);
+    panel->Layout();
 
   }
 
@@ -302,11 +242,11 @@ namespace bbwx
     lstIn.push_back( bbtk::std2wx(bbGetInputIn7()) );
     lstIn.push_back( bbtk::std2wx(bbGetInputIn8()) );
     lstIn.push_back( bbtk::std2wx(bbGetInputIn9()) );
-
-
-       ( (RadioButtonWidget*)bbGetOutputWidget() )->AddElements(lstIn, bbGetInputIn() , bbtk::std2wx(bbGetInputTitle()) );
-
-
+    
+       if (bbGetOutputWidget()!=NULL) 
+       {
+               ( (RadioButtonWidget*)bbGetOutputWidget() )->AddElements(lstIn, bbGetInputIn() , bbtk::std2wx(bbGetInputTitle()) );     
+       } // if bbGetOutputWidget
   }
 
   /**
@@ -331,7 +271,6 @@ namespace bbwx
 
     RadioButtonWidget *w = new RadioButtonWidget(
                          this,
-//                         bbGetWxParent(),
                                                 parent,        
                          bbGetInputIn() ,
                          bbtk::std2wx(bbGetInputTitle()),