from pyfbsdk import *
from pyfbsdk_additions import *
def OnEventCb(control,event):
print event.Name
def OnInputCb(control,event):
print event.Name, event.InputType
def PopulateLayout(mainLyt):
lyt = FBLayout()
x = FBAddRegionParam(10,FBAttachType.kFBAttachLeft,"")
y = FBAddRegionParam(10,FBAttachType.kFBAttachTop,"")
w = FBAddRegionParam(400,FBAttachType.kFBAttachNone,"")
h = FBAddRegionParam(40,FBAttachType.kFBAttachNone,"")
lyt.AddRegion("Border1","Border2", x, y, w, h)
lyt.SetBorder("Border1",FBBorderStyle.kFBStandardBorder,True, True,1,0,90,0)
lyt.OnInput.Add(OnInputCb)
lyt.OnResize.Add(OnEventCb)
lyt.OnShow.Add(OnEventCb)
x = FBAddRegionParam(10,FBAttachType.kFBAttachLeft,"")
y = FBAddRegionParam(10,FBAttachType.kFBAttachTop,"")
w = FBAddRegionParam(-10,FBAttachType.kFBAttachRight,"")
h = FBAddRegionParam(-10,FBAttachType.kFBAttachBottom,"")
mainLyt.AddRegion("Reg","Reg", x, y, w, h)
mainLyt.SetControl("Reg",lyt)
def CreateTool():
t = CreateUniqueTool("Tool Layout")
PopulateLayout(t)
ShowTool(t)
CreateTool()