got it . the documentation needs to be updated !
in documentation it says :
GetCurrentSelection () const
Returns the item being selected right now.
that made me think it returns the actual object , which in my case was a simple string ( or WxString ) . although i noticed that virtual int , but was unsure which one was a typo !
how am i supposed to get the current selected object in a combo box then ?
i would like to know how i can do it in wxWidgets .
and here is the code anyway .
Code: Select all
int SelectedItemIndex = WxComboBox1->GetSelection();
if ( WxComboBox1->GetString(SelectedItemIndex) == wxT("open file"))
{
WxEdit1->SetValue(WxComboBox1->GetString(SelectedItemIndex));
if ( WxOpenFileDialog1->ShowModal() == wxID_OK )
{
WxEdit1->SetValue(WxOpenFileDialog1->GetPath());
}
else
{
WxEdit1->SetValue(wxT("NoThing "));
}
}
by the way i recall from two or three years ago , that wxwidgets were going to convert strings to WxString at backstage , is it not yet implemented ? or it is me that is missing something here . would appreciate any help on this too