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 » Modal vs non-modal window
icon5.gif  Modal vs non-modal window [message #11950] Wed, 03 October 2007 20:13 Go to previous message
NeonN is currently offline  NeonN
Messages: 8
Registered: September 2007
Location: Czech Republic
Promising Member
Hi, I'm new here. I found Ultimate++ few months ago... but until last week, i had no time to try it. And I have to say... I am starting to like it more and more Smile...

But there's a problem... I do not understand how to open dialog window (and block the windows behind) and how new main window or new dialog window without blocking the app...

I tried this
void ToDo2::AddProjectDlg()
{
	static 	WithAddProjectLayout<TopWindow> * opened = NULL;
	if (opened != NULL)
	{
		opened->TopMost(false,false);
		return;
	}
	bool * sent = new bool;
	WithAddProjectLayout<TopWindow> * layAddProject = new WithAddProjectLayout<TopWindow>;
	opened = layAddProject;
	CtrlLayoutOKCancel(*layAddProject, "Add Project");
	layAddProject->Open();
	*sent = false;
	while (!(*sent))
	{
		switch (layAddProject->Execute())
		{
			case IDOK:
				if ((String) layAddProject->esProjectName.GetData() != "")
				{
					AddProject(AsString(layAddProject->esProjectName.GetData()), AsString(layAddProject->deDescription.GetData()));
					*sent = true;
				}
				else
				{
					PromptOK("Project name is empty!");
				}
				break;
			
			case IDCANCEL:
			case IDEXIT:
				*sent = true;
		}
	}
	delete sent;
	delete layAddProject;
	opened = NULL;
}



GUI_APP_MAIN
{
	ToDo2 main_abc;
	main_abc.Sizeable().Zoomable().Run();
}


This is doing exactly what i need. Open window... if allready opened, just get it to the top of the screen (checked with EventLoop())... check some values entered by user and if everything is ok, use them (call some function) and close the window.
But how to open it as independet window or independent main window (show it on taskbar)?

I gues I have to use Execute() to check the dialog status... but Execute() blocks the main windows behind Sad... and EventLoop() doesn't return any value to check.

 
Read Message icon5.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: TopWindow Backup/Restore
Next Topic: Minor bug: TopWindow::GetStdSize()
Goto Forum:
  


Current Time: Wed Apr 24 04:39:48 CEST 2024

Total time taken to generate the page: 0.03687 seconds