EVT_LEFT_UP(wxComboListBox::OnLeftUp)
END_EVENT_TABLE()
-IMPLEMENT_DYNAMIC_CLASS2(wxComboBox, wxControl, wxComboCtrl)
-
// ============================================================================
// implementation
// ============================================================================
// wxComboBox methods forwarded to wxTextCtrl
// ----------------------------------------------------------------------------
-wxString wxComboBox::GetValue() const
+wxString wxComboBox::DoGetValue() const
{
- return wxComboCtrl::GetValue();
+ return GetTextCtrl() ? GetTextCtrl()->GetValue() : wxString();
}
void wxComboBox::SetValue(const wxString& value)
{
- wxComboCtrl::SetValue(value);
+ if ( GetTextCtrl() )
+ GetTextCtrl()->SetValue(value);
}
void wxComboBox::WriteText(const wxString& value)
void wxComboBox::DoDeleteOneItem(unsigned int n)
{
- wxCHECK_RET( IsValid(n), _T("invalid index in wxComboBox::Delete") );
+ wxCHECK_RET( IsValid(n), wxT("invalid index in wxComboBox::Delete") );
if (GetSelection() == (int)n)
if ( GetTextCtrl() ) GetTextCtrl()->SetValue(wxEmptyString);
wxString wxComboBox::GetString(unsigned int n) const
{
- wxCHECK_MSG( IsValid(n), wxEmptyString, _T("invalid index in wxComboBox::GetString") );
+ wxCHECK_MSG( IsValid(n), wxEmptyString, wxT("invalid index in wxComboBox::GetString") );
return GetLBox()->GetString(n);
}
void wxComboBox::SetString(unsigned int n, const wxString& s)
{
- wxCHECK_RET( IsValid(n), _T("invalid index in wxComboBox::SetString") );
+ wxCHECK_RET( IsValid(n), wxT("invalid index in wxComboBox::SetString") );
GetLBox()->SetString(n, s);
}
void wxComboBox::SetSelection(int n)
{
- wxCHECK_RET( (n == wxNOT_FOUND || IsValid(n)), _T("invalid index in wxComboBox::Select") );
+ wxCHECK_RET( (n == wxNOT_FOUND || IsValid(n)), wxT("invalid index in wxComboBox::Select") );
GetLBox()->SetSelection(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