X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..924b84ab9461c95cf5c5386d1091ae0f7a8e7ce7:/src/msw/popupwin.cpp diff --git a/src/msw/popupwin.cpp b/src/msw/popupwin.cpp index 2417fc0e89..20f337d99a 100644 --- a/src/msw/popupwin.cpp +++ b/src/msw/popupwin.cpp @@ -6,7 +6,7 @@ // Created: 08.05.02 // RCS-ID: $Id$ // Copyright: (c) 2002 Vadim Zeitlin -// License: wxWidgets licence +// License: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -38,8 +38,6 @@ #include "wx/msw/private.h" // for GetDesktopWindow() -IMPLEMENT_DYNAMIC_CLASS(wxPopupWindow, wxWindow) - // ============================================================================ // implementation // ============================================================================ @@ -50,7 +48,7 @@ bool wxPopupWindow::Create(wxWindow *parent, int flags) Hide(); return wxPopupWindowBase::Create(parent) && - wxWindow::Create(parent, -1, + wxWindow::Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, flags | wxPOPUP_WINDOW); } @@ -100,7 +98,7 @@ WXHWND wxPopupWindow::MSWGetParent() const bool wxPopupWindow::Show(bool show) { if ( !wxWindowMSW::Show(show) ) - return FALSE; + return false; if ( show ) { @@ -109,9 +107,12 @@ bool wxPopupWindow::Show(bool show) { wxLogLastError(_T("SetWindowPos")); } + + // and set it as the foreground window so the mouse can be captured + ::SetForegroundWindow(GetHwnd()); } - return TRUE; + return true; } #endif // #if wxUSE_POPUPWIN