from pyfbsdk import *
from pyfbsdk_additions import *
def PopulateLayout(mainLyt):
tab = TabControl()
x = FBAddRegionParam(10,FBAttachType.kFBAttachLeft,"")
y = FBAddRegionParam(10,FBAttachType.kFBAttachTop,"")
w = FBAddRegionParam(-10,FBAttachType.kFBAttachRight,"")
h = FBAddRegionParam(-10,FBAttachType.kFBAttachBottom,"")
mainLyt.AddRegion("tab", "tab",x,y,w,h)
mainLyt.SetControl("tab", tab)
for i in range(3):
name = "%s %d" % ("Tab ", i + 1)
l = FBLayout()
x = FBAddRegionParam(10,FBAttachType.kFBAttachLeft,"")
y = FBAddRegionParam(10,FBAttachType.kFBAttachTop,"")
w = FBAddRegionParam(-10,FBAttachType.kFBAttachRight,"")
h = FBAddRegionParam(-10,FBAttachType.kFBAttachBottom,"")
l.AddRegion(name,name, x, y, w, h)
l.SetBorder(name,FBBorderStyle.kFBStandardBorder,True, True,1,0,90,0)
tab.Add(name,l)
tab.SetContent(0)
tab.TabPanel.TabStyle = 0
def CreateTool():
t = CreateUniqueTool("TabPanel Example")
t.StartSizeX = 400
t.StartSizeY = 400
PopulateLayout(t)
ShowTool(t)
CreateTool()