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 » Community » Newbie corner » login and main window
Re: login and main window [message #55347 is a reply to message #55345] Sun, 01 November 2020 19:30 Go to previous messageGo to previous message
BetoValle is currently offline  BetoValle
Messages: 203
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member
There are 2 situations with different startup. What is the reason
for the second to generate exception error ?


( 1 )
	ok
	String saida = "";

struct Snh : public WithsnhLayout<TopWindow>
{
	typedef Snh CLASSNAME;

	Snh()
	{
		CtrlLayout ( *this, "Acesso inicial" );
		ok.SetImage ( ClassImg::btEdita );
		sai.SetImage ( ClassImg::btSai );
		ok <<= THISBACK ( fx );
		sai << [=] {Exit();
				   };

	}

	void fx()
	{
		saida = "okxxx";
		Close();
	}

};


struct MainSig : public WithmenuLayout<TopWindow>
{
	MainSig()
	{

		Snh se;
		se.Run();

		if ( saida == "okxxx" )
		{

			CtrlLayout ( *this, "Tela Principal" );
			menu.Set ( [=] ( Bar & bar )
			{

				bar.Sub ( "File", [=] ( Bar & bar )
				{
					bar.Separator();
				}

						);

				bar.Sub ( "File", [=] ( Bar & bar )
				{
					bar.Add ( "Item 1", [&]
					{
						Exit();
					} );
				}

						);

			}

					 );
		}

		else
		{
			Exit();
		}
	}

};

GUI_APP_MAIN
{
	MainSig sg;
	sg.Run();
}

( 2 ) error
String saida = "";

struct Snh : public WithsnhLayout<TopWindow>
{
	typedef Snh CLASSNAME;

	Snh()
	{
		CtrlLayout ( *this, "Acesso inicial" );
		ok.SetImage ( ClassImg::btEdita );
		sai.SetImage ( ClassImg::btSai );
		ok <<= THISBACK ( fx );
		sai << [=] {Exit();
				   };

	}

	void fx()
	{
		saida = "okxxx";
		Close();
	}

};


struct MainSig : public WithmenuLayout<TopWindow>
{
	MainSig()
	{

		CtrlLayout ( *this, "Tela Principal" );
		menu.Set ( [=] ( Bar & bar )
		{

			bar.Sub ( "File", [=] ( Bar & bar )
			{
				bar.Separator();
			}

					);

			bar.Sub ( "File", [=] ( Bar & bar )
			{
				bar.Add ( "Item 1", [&]
				{
					Exit();
				} );
			}

					);

		}

				 );

	}

};

GUI_APP_MAIN
{

	Snh se;
	se.Run();

	if ( saida == "okxxx" )
	{
		MainSig sg;
		sg.Run();
	}

}

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to access base class function in this case?
Next Topic: report generator
Goto Forum:
  


Current Time: Sun Apr 28 02:11:46 CEST 2024

Total time taken to generate the page: 0.06009 seconds