PDA

View Full Version : tab widgets, there are not differents between tabs elements!!



webquinty
6th May 2009, 09:30
Hello,

I have a tab widget with two tabs.
In tab1 there is a button, and tab2 have other button.

But when I write my code, all buttons belong same class.
Is there any way to have a form but button of tab1 belong FormClass->Tab1class->button and other button belong FormClass->Tab2Class->button.

I am sorry if I dont explain well.

Best regards

Lykurg
6th May 2009, 10:25
But when I write my code, all buttons belong same class.
Is there any way to have a form but button of tab1 belong FormClass->Tab1class->button and other button belong FormClass->Tab2Class->button.

As I understand you: no. But you can name your button: buttonInTab1 which would have the same effect. Why are you need such a hierarchy?

webquinty
6th May 2009, 11:49
As I understand you: no. But you can name your button: buttonInTab1 which would have the same effect. Why are you need such a hierarchy?

Only to have a clear code.

Thank you very much.

Lykurg
6th May 2009, 13:20
Well what you can do is:

Create a widget with desiger, call it tab1
Create a widget with desiger, call it tab2
Create the new widget with the tabwidget (tw) and for the pages promote your classes tab1 and tab2


Then you could have such a hierarchy tw->tab1->xxx if xxx is public... So it's possible but not really recommendable.


Only to have a clear code.
this you can also archive with prefixes. Which is better than the solution above.

webquinty
7th May 2009, 08:27
Thank you very much for you advice.

Best regards