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 » Cannot get modal owned window
Cannot get modal owned window [message #15473] Fri, 25 April 2008 17:58 Go to previous message
indiocolifa is currently offline  indiocolifa
Messages: 49
Registered: January 2008
Location: Argentina
Member
What I want to do is the main window to open a modal window, which must be resized at 90% of the parent window size. I get different problems, but I can't get it right.

Here's what I'm doing.

The Main Window is opened with.

MainWindow mw;
mw.Run();


in the GUI_APP_MAIN block.

Now, the window I want to open is defined in the .lay file. It's class declaration is:

class CaseExp : public WithCaseExpLayout<TopWindow> {
	typedef CaseExp CLASSNAME;

	void PrintRemClick();
	void ResolCasoClick();
	void CerrarCasoClick();
	void FillGrid();
	void gridCasosWhenSelection();
	void exit();

public:
	CaseExp();
};


So, since I want MainWindow to be the parent of this CaseExp window, in MainWindow.h I put:

class MainWindow : public TopWindow
{
	MenuBar		mainMenu;
	StatusBar	statusBar;
	LoginWindow	loginWnd;
	CaseExp		caseexp; <<<<---- HERE

... (continues)

}


The window is activated with a menu which has a callback pointing to a function with this code:

void MainWindow::OpenCaseExp()
{	
	caseexp.Run(true);	
}


Ok, this window is modal. But I can close it breaking it's modal loop properly.

The window has no close button in the form, only the system window close button at the title bar is used to close the window.

This is the constructor of CaseExp (the 'child' window):

CaseExp::CaseExp()
{
	CtrlLayout(*this, "Explorador de Casos");
	Sizeable(true);
	
	gridCasos.AddColumn((Id)COL_NUMCASO, "Número de Caso");
	gridCasos.AddColumn((Id)COL_MARCAEQ, "Marca Equipo");
	gridCasos.AddColumn((Id)COL_MODEQ, "Modelo Equipo");
	gridCasos.AddColumn((Id)COL_NSERIE, "Número de Serie");
	gridCasos.AddColumn((Id)COL_ESTADO, "Estado");
	
	FillGrid();
	
	btnPrintRem.WhenAction=THISBACK(PrintRemClick);	
	btnResolCaso.WhenAction=THISBACK(ResolCasoClick);
	btnCerrarCaso.WhenAction=THISBACK(CerrarCasoClick);
	gridCasos.WhenSel=THISBACK(gridCasosWhenSelection);
	WhenClose = THISBACK(exit);
	
}


exit Calls:

void CaseExp::exit()
{	
	Break(999);		
}


But this window won't close !!!!

Now, If I use:
void CaseExp::exit()
{	
	Break(999);
        Close();		
}


The window closes with a 'beep' and the main window (it's parent) is not focused (i must focus it manually).

It's evident that I do not fully U++ mechanisms well...

Any guidelines?

Thank you for your help.


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Problem, prompt when moving the window.
Next Topic: Wrong LeftUp Message send
Goto Forum:
  


Current Time: Sun Apr 28 20:40:52 CEST 2024

Total time taken to generate the page: 0.02755 seconds