// Author: Vadim Zeitlin
// Modified by:
// Created: 15.12.00
-// RCS-ID: $Id$
// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
m_combo->SetValue(wxListBox::GetStringSelection());
// next let the user code have the event
- wxCommandEvent evt(wxEVT_COMMAND_COMBOBOX_SELECTED,m_combo->GetId());
+ wxCommandEvent evt(wxEVT_COMBOBOX,m_combo->GetId());
evt.SetInt(wxListBox::GetSelection());
evt.SetEventObject(m_combo);
m_combo->ProcessWindowEvent(evt);
wxString wxComboBox::DoGetValue() const
{
- return wxComboCtrl::GetValue();
+ return GetTextCtrl() ? GetTextCtrl()->GetValue() : m_valueString;
}
void wxComboBox::SetValue(const wxString& value)
{
- wxComboCtrl::SetValue(value);
+ if ( GetTextCtrl() )
+ GetTextCtrl()->SetValue(value);
+ else
+ m_valueString = value;
}
void wxComboBox::WriteText(const wxString& value)
void wxComboBox::DoClear()
{
GetLBox()->Clear();
- if ( GetTextCtrl() ) GetTextCtrl()->SetValue(wxEmptyString);
+ SetValue(wxEmptyString);
}
void wxComboBox::DoDeleteOneItem(unsigned int n)
wxCHECK_RET( IsValid(n), wxT("invalid index in wxComboBox::Delete") );
if (GetSelection() == (int)n)
- if ( GetTextCtrl() ) GetTextCtrl()->SetValue(wxEmptyString);
+ SetValue(wxEmptyString);
GetLBox()->Delete(n);
}
int wxComboBox::GetSelection() const
{
-#if 1 // FIXME:: What is the correct behavior?
+#if 1 // FIXME:: What is the correct behaviour?
// if the current value isn't one of the listbox strings, return -1
return GetLBox()->GetSelection();
#else