Added corrected Show() to wxPopupWindow

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21197 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-06-17 08:26:01 +00:00
parent 577baeef5a
commit 25b1b442d6
2 changed files with 24 additions and 0 deletions

View File

@@ -30,6 +30,8 @@ public:
bool Create(wxWindow *parent, int flags = wxBORDER_NONE); bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
virtual bool Show(bool show = TRUE);
protected: protected:
// popups handle the position like wxTopLevelWindow, not wxWindow // popups handle the position like wxTopLevelWindow, not wxWindow
virtual void DoGetPosition(int *x, int *y) const; virtual void DoGetPosition(int *x, int *y) const;

View File

@@ -87,4 +87,26 @@ WXHWND wxPopupWindow::MSWGetParent() const
return (WXHWND)::GetDesktopWindow(); 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 #endif // #if wxUSE_POPUPWIN