|
You need to create a region to put the FBImageContainer in, then you put the border on the region, if you play with the width and height of the region this will control the width and height of the border:
w2 = FBAddRegionParam(30,FBAttachType.kFBAttachNone,"")
h2 = FBAddRegionParam(30,FBAttachType.kFBAttachNone,"")
This might seem like a workaround but really everything goes in regions, I don’t think you can actual add borders around things like a button or text, you put it around the region and the item sits in the region…
from pyfbsdk import *
from pyfbsdk_additions import *
def PopulateLayout(mainLyt):
#1. Creating the instruction title
l = FBLabel()
l.Caption = “Select the shot track definition file to use:”
l.Style = FBTextStyle.kFBTextStyleBold
l.WordWrap = True
x = FBAddRegionParam(5,FBAttachType.kFBAttachLeft,"") # Create a label that is left justify
y = FBAddRegionParam(5,FBAttachType.kFBAttachTop,"") # ... and at the top of the layout.
w = FBAddRegionParam(300,FBAttachType.kFBAttachNone,"") # its width is fixed at 300 pixels
h = FBAddRegionParam(20,FBAttachType.kFBAttachNone,"") # and its height is fixed at 15 pixels
mainLyt.AddRegion("lab”,"lab", x, y, w, h)
mainLyt.SetControl("lab",l)
#2. Creating a temp button for a place holder
Con = FBImageContainer()
Con.Filename = “devices_body.tif”
x2 = FBAddRegionParam(5,FBAttachType.kFBAttachLeft,"")
y2 = FBAddRegionParam(5,FBAttachType.kFBAttachBottom,"lab")
w2 = FBAddRegionParam(30,FBAttachType.kFBAttachNone,"")
h2 = FBAddRegionParam(30,FBAttachType.kFBAttachNone,"")
mainLyt.AddRegion("con”,"con", x2, y2, w2, h2)
mainLyt.SetBorder("con",FBBorderStyle.kFBHighlightBorder,False, False,2,2,90,0)
mainLyt.SetControl("con",Con)
def CreateTool():
# Tool creation will serve as the hub for all other controls
global t
t = CreateUniqueTool("Region Shot Track Setup Tool")
t.StartSizeX = 300
t.StartSizeY = 143
PopulateLayout(t)
ShowTool(t)
KRISTINE MIDDLEMISS | DEVELOPER CONSULTANT
AUTODESK Media & Entertainment
|