U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » TopWindow&PopUp, TrayIcon » Bug: TopMost blocks Prompt dialog
Re: Bug: TopMost blocks Prompt dialog [message #20357 is a reply to message #18914] Fri, 13 March 2009 14:09 Go to previous messageGo to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
luzr wrote on Fri, 31 October 2008 14:21


In the end, I have used this desperate solution:

	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();


Mirek

I've discovered that this doens't work on X11. For whatever reason TopMost must be set before the window opens. On Win32 however, it only works the other way round Rolling Eyes

I changed my version to:
#ifdef PLATFORM_WIN32
	dlg.Open();
#endif
	Vector<Ctrl *> wins = Ctrl::GetTopWindows();
	for(int i = 0; i < wins.GetCount(); i++) {
		TopWindow *w = dynamic_cast<TopWindow *>(wins[i]);
		if(w && w->GetScreenRect().Intersects(dlg.GetScreenRect()) && w->IsTopMost()) {
			dlg.TopMost();
			break;
		}
	}	
#ifdef PLATFORM_X11
	dlg.Open();
#endif

but obviously that's a bit of a horrible bodge.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Howto Drop Files into a TopWindow please?
Next Topic: starting program hidden and putting it in start up
Goto Forum:
  


Current Time: Sat Oct 03 14:28:23 GMT+2 2026

Total time taken to generate the page: 0.14588 seconds