From 916eecaad6d0840cc8ec10f4fa2aa3d29322e3b3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 Sep 2006 16:24:00 +0000 Subject: [PATCH] implement wxComboBox::SetEditable() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41097 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 4 ++++ src/msw/combobox.cpp | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 79d2195f38..c108d27e8e 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -64,6 +64,10 @@ All (GUI): - Support for right-to-left text layout (Diaa Sami during Google Summer of Code) - Added wxID_PAGE_SETUP standard id +wxMSW: + +- Implemented wxComboBox::SetEditable() + wxMac: - Add parameter to the --enable-universal_binary configure option for the path diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index 937e23ea06..2f3f338f46 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -592,11 +592,13 @@ bool wxComboBox::IsEditable() const return !HasFlag(wxCB_READONLY); } -void wxComboBox::SetEditable(bool WXUNUSED(editable)) +void wxComboBox::SetEditable(bool editable) { - // Can't implement in MSW? -// HWND hWnd = GetHwnd(); -// SendMessage(hWnd, EM_SETREADONLY, (WPARAM)!editable, (LPARAM)0L); + HWND hWnd = (HWND)GetEditHWND(); + if ( !::SendMessage(hWnd, EM_SETREADONLY, !editable, 0) ) + { + wxLogLastError(_T("SendMessage(EM_SETREADONLY)")); + } } void wxComboBox::SetInsertionPoint(long pos) @@ -604,7 +606,6 @@ void wxComboBox::SetInsertionPoint(long pos) if ( GetWindowStyle() & wxCB_READONLY ) return; -#ifdef __WIN32__ HWND hWnd = GetHwnd(); ::SendMessage(hWnd, CB_SETEDITSEL, 0, MAKELPARAM(pos, pos)); HWND hEditWnd = (HWND) GetEditHWND(); @@ -615,7 +616,6 @@ void wxComboBox::SetInsertionPoint(long pos) // Why is this necessary? (Copied from wxTextCtrl::SetInsertionPoint) SendMessage(hEditWnd, EM_REPLACESEL, 0, (LPARAM) wxEmptyString); } -#endif // __WIN32__ } void wxComboBox::SetInsertionPointEnd() -- 2.45.2