from pyfbsdk import *
from pyfbsdk_additions import *
def PopulateLayout(mainLyt):
anchor = FBAttachType.kFBAttachTop
anchorRegion = ""
for i in range(3):
lytName = "Border" + str(i)
lyt = FBLayout()
x = FBAddRegionParam(10,FBAttachType.kFBAttachLeft,"")
y = FBAddRegionParam(10,FBAttachType.kFBAttachTop,"")
w = FBAddRegionParam(200,FBAttachType.kFBAttachNone,"")
h = FBAddRegionParam(200,FBAttachType.kFBAttachNone,"")
lyt.AddRegion(lytName,lytName, x, y, w, h)
lyt.SetBorder(lytName,FBBorderStyle.kFBStandardBorder,True, True,1,0,90,0)
arrowName = "ButtonArrow" + str(i)
x = FBAddRegionParam(10,FBAttachType.kFBAttachLeft,"")
y = FBAddRegionParam(10,anchor,anchorRegion)
w = FBAddRegionParam(0,FBAttachType.kFBAttachNone,"")
h = FBAddRegionParam(0,FBAttachType.kFBAttachNone,"")
mainLyt.AddRegion(arrowName ,arrowName , x, y, w, h)
b = FBArrowButton()
mainLyt.SetControl(arrowName ,b)
b.SetContent( "A layout border" + str(i), lyt, 250, 250 )
anchor = FBAttachType.kFBAttachBottom
anchorRegion = arrowName
x = FBAddRegionParam(10,FBAttachType.kFBAttachLeft,"")
y = FBAddRegionParam(10,FBAttachType.kFBAttachBottom,arrowName)
w = FBAddRegionParam(100,FBAttachType.kFBAttachNone,"")
h = FBAddRegionParam(25,FBAttachType.kFBAttachNone,"")
l = FBLabel()
l.Caption = "Dummy label!"
mainLyt.AddRegion("DummyLabel","DummyLabel", x, y, w, h)
mainLyt.SetControl("DummyLabel", l)
def CreateTool():
t = CreateUniqueTool("Arrow Button Example")
PopulateLayout(t)
ShowTool(t)
CreateTool()