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 » Derived Layouts Show/Hide & Run/Close in the Same Window
Re: Derived Layouts Show/Hide & Run/Close in the Same Window [message #37715 is a reply to message #37712] Mon, 05 November 2012 07:06 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

What about something like this (note: I haven't tested the code, but I believe it should work):
class App : public TopWindow {
	WithBaseLayout<ParentCtrl> base;
	WithDerivedLayout<ParentCtrl> derived;
	public:
		typedef App CLASSNAME;
		Base() {
			Add(base.SizePos());
			Add(derived.SizePos());
			derived.Hide();
		}
		void DisplayBase(){
			base.Show();
			derived.Hide();
		}
		void DisplayDerived(){
			base.Hide();
			derived.Show();
		}
};

There is one more level in the Ctrl hierarchy, but everything is in one window. Note that instead of Show/Hide, you can also use Add/Remove (e.g. Add(derived); Remove(base); to display derived) because Ctrls retain state even when removed.

Regarding the parallel execution: have a look at the GUI manual, paragraph 6. It shows the most general way of running multiple windows at once, with freedom to close any of them without terminating the application and to use them in any order and combination.

Best regards,
Honza
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: TabDlg Change Default Background Window
Next Topic: UserClass Layout Placeholder
Goto Forum:
  


Current Time: Sun Aug 24 11:20:40 CEST 2025

Total time taken to generate the page: 0.04748 seconds