X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eefe6d4b7c63228b56b0688d289c39caab1f74d5..b9efe021b554fa3967d1442cf758435c5cd5ae8f:/src/msw/popupwin.cpp?ds=sidebyside diff --git a/src/msw/popupwin.cpp b/src/msw/popupwin.cpp index aa340cdc9f..20f337d99a 100644 --- a/src/msw/popupwin.cpp +++ b/src/msw/popupwin.cpp @@ -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