X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/884a37aed25b5cdabcc6f9f7604878aa97ecb031..91edf16cb8823970f1ed5a2132b9a242150cf8a9:/src/msw/combobox.cpp diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index a9bb62cb5e..c8ccafc1a5 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -347,6 +347,7 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) if ( sel == -1 ) { m_value = wxGetWindowText(GetHwnd()); + m_selectionOld = -1; } else // we're synthesizing text updated event from sel change { @@ -619,7 +620,7 @@ void wxComboBox::SetInsertionPointEnd() // setting insertion point doesn't make sense for read only comboboxes if ( !(GetWindowStyle() & wxCB_READONLY) ) { - long pos = GetLastPosition(); + wxTextPos pos = GetLastPosition(); SetInsertionPoint(pos); } } @@ -634,15 +635,15 @@ long wxComboBox::GetInsertionPoint() const #endif } -long wxComboBox::GetLastPosition() const +wxTextPos wxComboBox::GetLastPosition() const { HWND hEditWnd = (HWND) GetEditHWND(); // Get number of characters in the last (only) line. We'll add this to the character // index for the last line, 1st position. - int lineLength = (int)SendMessage(hEditWnd, EM_LINELENGTH, (WPARAM) 0, (LPARAM)0L); + wxTextPos lineLength = (wxTextPos)SendMessage(hEditWnd, EM_LINELENGTH, (WPARAM) 0, (LPARAM)0L); - return (long)(lineLength); + return lineLength; } void wxComboBox::Replace(long from, long to, const wxString& value)