Some advice to center tabs (to tabcontrol width)?

Answered
0
0

Hi!
Some advice to center tabs (to tabcontrol width)?
If have only 2 tabs and the tabcontrol width is 500px for example, tabs are aligned to left, but i don’t find a way to center tabs to tabcontrol width

Or some way to adjust them(grow) or justify to tabcontrol width?

Thanks!

  • You must to post comments
Best Answer
0
0

Hi Sergio,

with our latest Wisej development build (1.5.7) you can set the TabSizeMode to one of these values:

  • Normal
  • Fill
  • Center
  • Fixed

Best regards
Frank

  • You must to post comments
0
0

Either way:

  1. To make the tabs fill the width, add a JavaScript component from the toolbox. Then in the JavaScript property of the TabControl put this:
var children = this.getChildren();
for (var i=0; i<children.length; i++){
    children[i].getButton().setLayoutProperties({flex:1});
}

It tells each tab to stretch proportionally. You can even have different proportional values, for example flex:2 will stretch twice as flex:1.

2. To center the tabs, out this in the JavaScript field (same JavaScript component, which is an extender):

this.getChildControl("bar").getLayout().setAlignX("center");

It tells the layout engine to center the content.




 

  • Luca (ITG)
    This is actually a nice feature, will add an enhancement request – but don’t know how it will be implemented. Probably a themeable property.
  • You must to post comments
0
0

Do you mean fill the width or center?

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.