]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch to implement wxChoice::SetString and to not send leave events
authorJulian Smart <julian@anthemion.co.uk>
Sun, 27 Jan 2002 10:05:49 +0000 (10:05 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sun, 27 Jan 2002 10:05:49 +0000 (10:05 +0000)
when window is captured.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13849 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/choice.cpp
src/msw/window.cpp

index 8ef52dbcff5e8855a10be52fb43dae6598911153..fc53d9298daf0b914f3ff3b2845f503e1819197d 100644 (file)
@@ -191,14 +191,11 @@ int wxChoice::FindString(const wxString& s) const
 #endif // Watcom/!Watcom
 }
 
-void wxChoice::SetString(int WXUNUSED(n), const wxString& WXUNUSED(s))
+void wxChoice::SetString(int n, const wxString& s)
 {
-    wxFAIL_MSG(wxT("not implemented"));
-
-#if 0 // should do this, but no Insert() so far
-    Delete(n);
-    Insert(n + 1, s);
-#endif
+    wxCHECK_RET( (n>=0)&&(n<GetCount()), wxT("invalid item index in wxChoice::SetString") );
+    SendMessage(GetHwnd(), CB_DELETESTRING, n, 0);
+    SendMessage(GetHwnd(), CB_INSERTSTRING, n, (LONG)s.c_str() );
 }
 
 wxString wxChoice::GetString(int n) const
index 271f8f0cb8f678137cd5a277e2a63ae8c5d11e2b..ccd1fa6a251176e56ea307242890abf748402a3d 100644 (file)
@@ -1180,7 +1180,7 @@ void wxWindowMSW::OnIdle(wxIdleEvent& WXUNUSED(event))
     // Check if we need to send a LEAVE event
     if ( m_mouseInWindow )
     {
-        if ( !IsMouseInWindow() )
+        if ( !IsMouseInWindow() && HasCapture())
         {
             // Generate a LEAVE event
             m_mouseInWindow = FALSE;