Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: Mon Aug 18 23:49:48 CEST 2025

Total time taken to generate the page: 0.06044 seconds