}
else // we're synthesizing text updated event from sel change
{
+ // We need to retrieve the current selection because the user
+ // may have changed it in the previous handler (for CBN_SELCHANGE
+ // above).
+ sel = GetSelection();
+ if ( sel > -1 )
+ {
+ value = GetString(sel);
+ }
// we need to do this because the user code expects
// wxComboBox::GetValue() to return the new value from
// "text updated" handler but it hadn't been updated yet
return TRUE;
}
+bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
+ const wxString& value,
+ const wxPoint& pos,
+ const wxSize& size,
+ const wxArrayString& choices,
+ long style,
+ const wxValidator& validator,
+ const wxString& name)
+{
+ wxCArrayString chs(choices);
+ return Create(parent, id, value, pos, size, chs.GetCount(),
+ chs.GetStrings(), style, validator, name);
+}
+
void wxComboBox::SetValue(const wxString& value)
{
if ( HasFlag(wxCB_READONLY) )