bring the parent of a wxFRAME_FLOAT_ON_PARENT frame to the top when deleting it as Windows doesn't do it automatically

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15756 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-06-05 22:37:24 +00:00
parent 57fc4c1a2c
commit d6fb86a81c

View File

@@ -473,6 +473,19 @@ wxTopLevelWindowMSW::~wxTopLevelWindowMSW()
if ( wxModelessWindows.Find(this) )
wxModelessWindows.DeleteObject(this);
// after destroying an owned window, Windows activates the next top level
// window in Z order but it may be different from our owner (to reproduce
// this simply Alt-TAB to another application and back before closing the
// owned frame) whereas we always want to yield activation to our parent
if ( HasFlag(wxFRAME_FLOAT_ON_PARENT) )
{
wxWindow *parent = GetParent();
if ( parent )
{
::BringWindowToTop(GetHwndOf(parent));
}
}
// If this is the last top-level window, exit.
if ( wxTheApp && (wxTopLevelWindows.Number() == 0) )
{
@@ -757,11 +770,14 @@ long wxTopLevelWindowMSW::HandleNcActivate(bool activate)
long
wxTopLevelWindowMSW::MSWWindowProc(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam)
{
if ( msg == WM_NCACTIVATE && HandleNcActivate(wParam != 0) )
if ( msg == WM_NCACTIVATE )
{
if ( HandleNcActivate(wParam != 0) )
{
// we processed WM_NCACTIVATE ourselves
return TRUE;
}
}
return wxTopLevelWindowBase::MSWWindowProc(msg, wParam, lParam);
}