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 » What type are the tabs?
What type are the tabs? [message #37671] Thu, 01 November 2012 06:11 Go to next message
nejnadusho is currently offline  nejnadusho
Messages: 60
Registered: October 2012
Member
Hi,

I want to pass as a parameter a few tabs.
It is all about some code neatness. I can do it inside the constructor but it is too much code there acoording to my standards Very Happy

What type are they?
I was looking through the library and could not figure it out.

I thought they might be Tabs but after that I noticed that was a private struct.

Here is what I am trying to achieve.

WithAdminRegNewUserLayout<ParentCtrl> tab1;	
WithAdminDeleteUserLayout<ParentCtrl> tab2;
WithAdminCreateUserRoleLayout<ParentCtrl> tab3;	
		
adminDlg (tab1, "User Registration")
	(tab2, "User Deactivation")
	tab3, "Create Role")
.Title("Admin's Workspace")
.Sizeable()
.Zoomable();	

hideAttributes(tab1);		
adminDlg.Execute();
	
}	
	
void Admin::hideAttributes(???Tabs??? tab){
		//hide the lables in the CreateUser Tab
		tab.newGenID.Hide();
		tab.newGenLable.Hide();
		tab.newGenPass.Hide();


Thank you very much for your help.
nejnio
Re: What type are the tabs? [message #37673 is a reply to message #37671] Thu, 01 November 2012 08:32 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi nejnio,

The tabs are exactly the type that you declared Smile :
WithAdminRegNewUserLayout<ParentCtrl> tab1;	
WithAdminDeleteUserLayout<ParentCtrl> tab2;
WithAdminCreateUserRoleLayout<ParentCtrl> tab3;

They are each of different type, the only requirement is that they have to inherit from Ctrl. So you have to just specify the function as
void Admin::hideAttributes(WithAdminRegNewUserLayout<ParentCtrl> tab)


If you want a function that should work for more of them (e.g. to modify common properties), there is couple options, easiest is probably to use template:
template<class T>
void Admin::hideAttributes(T& tab){
		//hide the lables in the CreateUser Tab
		tab.newGenID.Hide();
		tab.newGenLable.Hide();
		tab.newGenPass.Hide();


Best regards,
Honza
Re: What type are the tabs? [message #37681 is a reply to message #37671] Thu, 01 November 2012 21:11 Go to previous message
nejnadusho is currently offline  nejnadusho
Messages: 60
Registered: October 2012
Member
Hi Honza,

Thank you very much again.

I got it and it is very helpful for me.

All the best,
nejnio
Previous Topic: example SetLayout question
Next Topic: TabDlg Remove 'Close' Button
Goto Forum:
  


Current Time: Sat May 04 09:46:43 CEST 2024

Total time taken to generate the page: 0.01841 seconds