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 » U++ Widgets - General questions or Mixed problems » What is ParentCtrl?
What is ParentCtrl? [message #19885] Thu, 29 January 2009 23:45 Go to next message
White_Owl is currently offline  White_Owl
Messages: 27
Registered: January 2009
Location: New York
Promising Member
ParentCtrl is mentioned in the list of widgets and judging by the tiny description "Parent for grouping widgets in TabCtrl and similar situations." it is what I am looking for. But how to work with it?
Tried:
ParentCtrl parent_ctrl;
WithPage1<Ctrl> page1;
WithPage2<Ctrl> page2;
....
CtrlLayout(page1);
CtrlLayout(page2);
parent_ctrl.Add(page1);
parent_ctrl.Add(page2);
and that gave me all pages one over the other. I now see all widgets from all layouts at the same time in a great mess.

I am looking for some way to stack several panels. Something like TabCtrl but without tabs.
Re: What is ParentCtrl? [message #19894 is a reply to message #19885] Fri, 30 January 2009 12:06 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
The only major differnce to Ctrl is that it ignores mouse actions and is transparent.

So you can use ParentCtrls as containers, but if you want layers then you have to handle the switching yourself by Hiding/Showing the containers:
WithPage1<ParentCtrl> page1;
WithPage2<ParentCtrl> page2;
....
CtrlLayout(page1);
CtrlLayout(page2);
Add(page1);
Add(page2);
page2.Hide();

virtual bool Key(dword key, int count) {
   if (key == K_CTRL_S) {
      page1.Show(!page1.IsShown());
      page2.Show(!page2.IsShown());
      return true;
   }
   return false;
}
Re: What is ParentCtrl? [message #19898 is a reply to message #19885] Fri, 30 January 2009 16:42 Go to previous messageGo to next message
White_Owl is currently offline  White_Owl
Messages: 27
Registered: January 2009
Location: New York
Promising Member
Oh... So ParentCtrl is actually a container which does not receive mouse messages? I think, I got it...
Re: What is ParentCtrl? [message #19991 is a reply to message #19898] Sun, 08 February 2009 08:23 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
White_Owl wrote on Fri, 30 January 2009 10:42

Oh... So ParentCtrl is actually a container which does not receive mouse messages? I think, I got it...


Actually, mrjt got it wrong, it in fact DOES receive mouse messages (but usually, they are just ignored).

ParentCtrl::ParentCtrl()
{
	NoWantFocus();
	Transparent();
	minsize = Null;
}


Really, the main purpose is that you need something to group widgets occassionally and that thing has to be Transparent (because there is usually something behind) and it must not get focus when pressing K_TAB.

Mirek
Previous Topic: how to define hot-keys not associated with any menu?
Next Topic: EditString validation
Goto Forum:
  


Current Time: Thu Mar 28 18:15:51 CET 2024

Total time taken to generate the page: 0.01264 seconds