I'm facing a problem when using SetValue in a combobox.
In my code i define a wxArrayString for the combobox.
Code: Select all
wxArrayString cb_multiply;
cb_multiply.Add(_("1"));
cb_multiply.Add(_("2"));
cb_multiply.Add(_("4"));
cb_multiply.Add(_("8"));
combo = new wxComboBox( itemPanel1, ID_CB_MULTIPLICATEUR_PTS, _("1"), wxDefaultPosition, wxSize(50, -1), cb_multiply, wxCB_DROPDOWN );
Code: Select all
combo.SetStringSelection(_("2")); //Or any other value in the list
Code: Select all
combo.GetCurrentSelection();
If I use SetValue() in place of SetStringSelection(), it does not work. The selection stays at the first choice and I get a -1 when I try to get the index.
I'd like to know if anyone else is experiencing the same problem or if it's just me who's got mixed up in my code.
I spent an awful a lot of time trying to figure out what was wrong with my code due to this.
The fact that SetValue is documented in the 2.8.7 manual and SetStringSelection is not did not help.
Regards