script for DzTabWidget
YudinEd
Posts: 90
I've found a script for DzTabWidget. Perhaps it is required someone.
wDlg = new DzDialog;
wTabStack = new DzTabWidget( wDlg );
wOptionPage = new DzVGroupBox( wTabStack );
wPrefsPage = new DzVGroupBox( wTabStack );
var wDlgLayout = new DzGridLayout( wDlg );
wDlgLayout.addMultiCellWidget( wTabStack, 0, 1, 0, 0 );
var wDlgBtnsGB = new DzGroupBox( wDlg );
wDlgBtnsGB.flat = true;
var wDlgBtnsLyt = new DzGridLayout( wDlgBtnsGB );
wDlgBtnsLyt.setColStretch( 1, 1 );
wDlgLayout.addMultiCellWidget( wDlgBtnsGB,1, 1,0, 0 );
wOptionPage.flat = true;
wTabStack.addTab( wOptionPage, "1 page" );
wPrefsPage.flat = true;
wTabStack.addTab( wPrefsPage, "2 page" );
wDlg.maxWidth = wDlg.minWidth;
wDlg.maxHeight = wDlg.minHeight;
wDlg.exec()
Comments
If that's found, did the source give permission to post? If it did you should still give the source.
Although that displays the tabs, I think (very hazy recollection) that in order to get itt o do anything useful you need code to populate each of the tabs with controls, and you need a function connected to the currentChanged signal for the widget to handle drawing the right set of controls.
:) It's DAZ Script API ( see please here examples for v3.x version). http://docs.daz3d.com/doku.php/public/software/dazstudio/3/start
This is clear and I have no problem with this.
But this script can be used even in this form using different GroupBoxes for different Pages. Script is working...:)
You can test it. In first page - text "Is it working?"
In second page you can see the answer
Ah, I didn't realise it worked without user-intervention - that's good.
Implementation of pages will be even easier if you'll use DzTextBrowser, which can be used for decoration with HTML tags. They even allow you to insert images into the script inside in the 64-base format ... For beginners, it is very good, when the script code becomes simpler. Sorry for my English :)
Yes I'm working with DzTabWidget now, this is a very good widget, you can add as many pages as you want, and if you really need space, even add scrollbars in each page they are required. But the DzTextBrowser I had not remarked it before. It may be interesting to include documentation inside the interfaces.
Richard, You can not explain this function as an example of the script?
In documentation
I don't understand *wgt [signal] . These are the variables? How this might look in the script? - it is not clear :)
I guess I can do without this function. But it is useful. This is beyond doubt.
This page covers signals and slots http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/language_reference/signals_slots/start
OK, thanks
It's very strange...
I use Tab1.setTabEnabled(Content1,false) - tab is deactivated. It's true.
When I try to make it again as active Tab1.setTabEnabled(Content1,true) - tab is activated, but none of the tab element is not working (to examples, buttons connected with functions).
In fact, I get GUI of tab only.
Problem is no in Tab widget, how I understood.
I have big script and used include "My Function.dsa" . I have problems with this string
More information about INCLUDE http://www.daz3d.com/forums/discussion/10400/dazscript-import-external-script-file#latest
So, I continue...
About signal for Tab widget.
You can use the signal in this form - "currentChanged(int) "