From: Ryan Norton Date: Fri, 19 Nov 2004 07:46:34 +0000 (+0000) Subject: part of patch [ 649438 ] Bug fixes from Netscape/AOL X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3f5ca6b1c36115d3cd90a6fa9665860a60abe26b part of patch [ 649438 ] Bug fixes from Netscape/AOL git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30626 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/msw/combobox.h b/include/wx/msw/combobox.h index 49415f636a..5d1a96acb1 100644 --- a/include/wx/msw/combobox.h +++ b/include/wx/msw/combobox.h @@ -94,6 +94,8 @@ public: virtual void Remove(long from, long to); virtual void SetSelection(int n) { wxChoice::SetSelection(n); } virtual void SetSelection(long from, long to); + virtual int GetSelection() const; + virtual void GetSelection(long* from, long* to) const; virtual void SetEditable(bool editable); virtual void Clear() { wxChoice::Clear(); m_selectionOld = -1; } diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index 73c6852660..202dd9de97 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -607,5 +607,19 @@ void wxComboBox::SetSelection(long from, long to) } } +void wxComboBox::GetSelection(long* from, long* to) const +{ + DWORD dwStart, dwEnd; + ::SendMessage(GetHwnd(), CB_GETEDITSEL, (WPARAM)&dwStart, (LPARAM)&dwEnd); + + *from = dwStart; + *to = dwEnd; +} + +int wxComboBox::GetSelection() const +{ + return wxChoice::GetSelection(); +} + #endif // wxUSE_COMBOBOX