X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2e9f62dafb75dc5baa3800af456d1b0248d85357..9e691f46b2ec1b5dbbff2e51131e3c532e688a89:/src/univ/combobox.cpp diff --git a/src/univ/combobox.cpp b/src/univ/combobox.cpp index ec71609c58..54ce379716 100644 --- a/src/univ/combobox.cpp +++ b/src/univ/combobox.cpp @@ -314,8 +314,9 @@ void wxComboControl::DoMoveWindow(int x, int y, int width, int height) wxSize sizeBtn = m_btn->GetBestSize(); wxCoord wText = width - sizeBtn.x; - m_text->SetSize(x, y, wText, height); - m_btn->SetSize(x + wText, y, sizeBtn.x, height); + wxPoint p = GetParent() ? GetParent()->GetClientAreaOrigin() : wxPoint(0,0); + m_text->SetSize(x - p.x, y - p.y, wText, height); + m_btn->SetSize(x - p.x + wText, y - p.y, sizeBtn.x, height); } // ---------------------------------------------------------------------------- @@ -520,7 +521,10 @@ bool wxComboListBox::SetSelection(const wxString& value) void wxComboListBox::OnSelect(wxCommandEvent& event) { - // first let the user code have the event + // first update the combo and close the listbox + m_combo->OnSelect(event.GetString()); + + // next let the user code have the event // all fields are already filled by the listbox, just change the event // type and send it to the combo @@ -529,9 +533,6 @@ void wxComboListBox::OnSelect(wxCommandEvent& event) event2.SetEventObject(m_combo); event2.SetId(m_combo->GetId()); m_combo->ProcessEvent(event2); - - // next update the combo and close the listbox - m_combo->OnSelect(event.GetString()); } void wxComboListBox::OnShow()