From: Eduardo DAVILA Date: Mon, 5 Jun 2023 15:24:13 +0000 (+0200) Subject: #3504 RadioButton first select item X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=1ba1a0e223adf11163b6e12ad5fe999b0f87add7;p=bbtk.git #3504 RadioButton first select item --- diff --git a/packages/std/src/bbstdTransposeVectors.h b/packages/std/src/bbstdTransposeVectors.h index 3ebc049..8e680b7 100644 --- a/packages/std/src/bbstdTransposeVectors.h +++ b/packages/std/src/bbstdTransposeVectors.h @@ -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 lstIn ); ~RadioButtonWidget(); - int GetValue(); void OnRadioButton(wxEvent& event); void AddElements(std::vector 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