from pyfbsdk import *
from pyfbsdk_additions import *
def PopulateLayout(mainLyt):
x = FBAddRegionParam(0,FBAttachType.kFBAttachLeft,"")
y = FBAddRegionParam(0,FBAttachType.kFBAttachTop,"")
w = FBAddRegionParam(0,FBAttachType.kFBAttachRight,"")
h = FBAddRegionParam(0,FBAttachType.kFBAttachBottom,"")
mainLyt.AddRegion("main","main", x, y, w, h)
scroll = FBScrollBox()
mainLyt.SetControl("main",scroll)
scroll.Content.AddRegion( "content", "content", x, y, w, h )
lyt = GridLayout()
scroll.Content.SetControl("content", lyt)
scroll.SetContentSize(800, 800)
for i in range(7):
for j in range(7):
b = FBButton()
b.Caption = "%d, %d" % (i, j)
lyt.Add(b, i, j)
def CreateTool():
t = CreateUniqueTool("Scrollbox Tool Example")
t.StartSizeX = 400
t.StartSizeY = 400
PopulateLayout(t)
ShowTool(t)
CreateTool()