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 » Multi Layout App
Re: Multi Layout App [message #37542 is a reply to message #37519] Mon, 15 October 2012 19:54 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1791
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi nejnio

While it is possible to switch layouts in a running application, it is not something you would really need very often. In most cases, yours included, it is much easier to just use two windows. It is fairly easy to coordinate them in such way, that only one is visible at any time. E.g.:
struct Logged : public WithTestLayout2<TopWindow> {
	typedef Logged CLASSNAME;
	
	Logged() {
		Title("Logged in").Sizeable();
		CtrlLayout(*this);
		back <<= THISBACK(Close);
	}
};

struct App : public WithTestLayout<TopWindow> {
	typedef App CLASSNAME;
	
	void Login(){
		Hide();
		Logged().Execute();
		Show();
	}
	
	App() {
		Title("Test").Sizeable();
		CtrlLayout(*this);
		login <<= THISBACK(Login);
	}
};

GUI_APP_MAIN{
	App().Run();
};
(Full source is included in the attachment.)

Best regards,
Honza
  • Attachment: guitest.zip
    (Size: 1.00KB, Downloaded 217 times)
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Report & sch file
Next Topic: error LNK2019 when using CtrlLib/CtrlLib.h
Goto Forum:
  


Current Time: Tue Jul 08 01:19:22 CEST 2025

Total time taken to generate the page: 0.03527 seconds