Fixed topmost window vs prompt problem

git-svn-id: svn://ultimatepp.org/upp/trunk@585 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2008-10-31 14:20:54 +00:00
parent 5978a9f87a
commit caf32ef3b8
3 changed files with 10 additions and 4 deletions

View file

@ -246,9 +246,8 @@ TopWindow& TopWindow::TopMost(bool b, bool stay_top)
{
HWND hwnd;
if(hwnd = GetHWND())
{
SetWindowPos(hwnd, b ? HWND_TOPMOST : (stay_top ? HWND_NOTOPMOST : HWND_BOTTOM),0,0,0,0,SWP_NOMOVE|SWP_NOSIZE );
}
SetWindowPos(hwnd, b ? HWND_TOPMOST : (stay_top ? HWND_NOTOPMOST : HWND_BOTTOM),
0,0,0,0,SWP_NOMOVE|SWP_NOSIZE );
return ExStyle(b ? GetExStyle() | WS_EX_TOPMOST : GetExStyle() & ~WS_EX_TOPMOST);
}

View file

@ -276,7 +276,6 @@ void TopWindow::Maximize(bool effect)
void TopWindow::Overlap(bool effect)
{
state = OVERLAPPED;
}
TopWindow& TopWindow::TopMost(bool b, bool)

View file

@ -107,6 +107,14 @@ int Prompt(Callback1<const String&> WhenLink,
}
dlg.WhenClose = dlg.Breaker(button3 ? -1 : 0);
dlg.Open();
Vector<Ctrl *> wins = Ctrl::GetTopWindows();
for(int i = 0; i < wins.GetCount(); i++) {
TopWindow *w = dynamic_cast<TopWindow *>(wins[i]);
if(w->GetScreenRect().Intersects(dlg.GetScreenRect()) && w->IsTopMost()) {
dlg.TopMost();
break;
}
}
dlg.Title(title);
return dlg.RunAppModal();
}