]> git.saurik.com Git - wxWidgets.git/commitdiff
Added corrected Show() to wxPopupWindow
authorJulian Smart <julian@anthemion.co.uk>
Tue, 17 Jun 2003 08:26:01 +0000 (08:26 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 17 Jun 2003 08:26:01 +0000 (08:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21197 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/popupwin.h
src/msw/popupwin.cpp

index ae220bc388d4e14090b603261c06cef4b9537e35..1dffaa67ee8d2d433306cade0f181ab8f122a8a2 100644 (file)
@@ -30,6 +30,8 @@ public:
 
     bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
 
+    virtual bool Show(bool show = TRUE);
+
 protected:
     // popups handle the position like wxTopLevelWindow, not wxWindow
     virtual void DoGetPosition(int *x, int *y) const;
index 7e44f08a0e3b2798e3795d8e1ae98e96d4e370c5..6cddce9ae3b565234e353b67e143068bc337d14e 100644 (file)
@@ -87,4 +87,26 @@ WXHWND wxPopupWindow::MSWGetParent() const
     return (WXHWND)::GetDesktopWindow();
 }
 
+bool wxPopupWindow::Show(bool show)
+{
+    if ( !wxWindowBase::Show(show) )
+        return FALSE;
+
+    HWND hWnd = GetHwnd();
+    int cshow = show ? SW_SHOW : SW_HIDE;
+    ::ShowWindow(hWnd, cshow);
+
+    if ( show )
+    {
+        // raise to top of z order
+        if (!::SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE))
+        {
+            wxLogLastError(_T("SetWindowPos"));
+        }
+    }
+
+    return TRUE;
+}
+
 #endif // #if wxUSE_POPUPWIN
+