]> Creatis software - bbtk.git/commitdiff
#3504 RadioButton first select item
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Mon, 5 Jun 2023 15:24:13 +0000 (17:24 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Mon, 5 Jun 2023 15:24:13 +0000 (17:24 +0200)
packages/std/src/bbstdTransposeVectors.h
packages/wx/src/bbwxRadioButton.cxx

index 3ebc049b32e664b3647a5d7dce7e580311a4e894..8e680b7c0b223b033eebfff2b1affc6f05ef613e 100644 (file)
@@ -108,8 +108,7 @@ BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(TransposeVectors);
        unsigned int s7 = bbGetInputIn7().size();
        unsigned int s8 = bbGetInputIn8().size();
        unsigned int s9 = bbGetInputIn9().size();
-
-
+      
        if (s0>0)       {               jSize++;        }
        if (s1>0)       {               jSize++;        }
        if (s2>0)       {               jSize++;        }
@@ -120,11 +119,8 @@ BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(TransposeVectors);
        if (s7>0)       {               jSize++;        }
        if (s8>0)       {               jSize++;        }
        if (s9>0)       {               jSize++;        }
-
-
        for (j=0;j<jSize;j++)
        {
-
            if (j==0){ tmpVec = bbGetInputIn0(); }
            if (j==1){ tmpVec = bbGetInputIn1(); }
            if (j==2){ tmpVec = bbGetInputIn2(); }
@@ -139,7 +135,7 @@ BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(TransposeVectors);
                {
                        if (tmpVec.size()<=s0 )
                        {
-                               if (i==0){ out0.push_back( tmpVec[i] ); }  
+                               if (i==0){ out0.push_back( tmpVec[i] ); }
                                if (i==1){ out1.push_back( tmpVec[i] ); }  
                                if (i==2){ out2.push_back( tmpVec[i] ); }  
                                if (i==3){ out3.push_back( tmpVec[i] ); }  
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