X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0ec1179b86dac6c87ad9f2cd126f87e92642c62c..ffaaf1078e1bc8f03ca97782b34f8607172672bf:/src/univ/combobox.cpp diff --git a/src/univ/combobox.cpp b/src/univ/combobox.cpp index 21adf5f74d..0cfcbcdd71 100644 --- a/src/univ/combobox.cpp +++ b/src/univ/combobox.cpp @@ -105,8 +105,6 @@ BEGIN_EVENT_TABLE(wxComboListBox, wxListBox) EVT_LEFT_UP(wxComboListBox::OnLeftUp) END_EVENT_TABLE() -IMPLEMENT_DYNAMIC_CLASS2(wxComboBox, wxControl, wxComboCtrl) - // ============================================================================ // implementation // ============================================================================ @@ -185,7 +183,7 @@ void wxComboListBox::OnLeftUp(wxMouseEvent& event) wxCommandEvent evt(wxEVT_COMMAND_COMBOBOX_SELECTED,m_combo->GetId()); evt.SetInt(wxListBox::GetSelection()); evt.SetEventObject(m_combo); - m_combo->ProcessEvent(evt); + m_combo->ProcessWindowEvent(evt); event.Skip(); } @@ -205,7 +203,7 @@ wxSize wxComboListBox::GetAdjustedSize(int minWidth, void wxComboBox::Init() { - m_lbox = (wxListBox *)NULL; + m_lbox = NULL; } wxComboBox::wxComboBox(wxWindow *parent, @@ -273,14 +271,15 @@ wxComboBox::~wxComboBox() // 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) @@ -364,7 +363,7 @@ void wxComboBox::DoClear() 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); @@ -379,14 +378,14 @@ unsigned int wxComboBox::GetCount() const 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); } @@ -398,7 +397,7 @@ int wxComboBox::FindString(const wxString& s, bool bCase) const 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); @@ -411,7 +410,7 @@ void wxComboBox::SetSelection(int 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 @@ -427,6 +426,11 @@ wxString wxComboBox::GetStringSelection() const return GetLBox()->GetStringSelection(); } +wxClientDataType wxComboBox::GetClientDataType() const +{ + return GetLBox()->GetClientDataType(); +} + void wxComboBox::SetClientDataType(wxClientDataType clientDataItemsType) { GetLBox()->SetClientDataType(clientDataItemsType);