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   |
|
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
|
|
|
Goto Forum:
Current Time: Sun Aug 24 11:20:40 CEST 2025
Total time taken to generate the page: 0.04748 seconds
|