Anybody familiar with the UI of MB? I want to achieve such an interface, as shown in the figure, I want to display two such formats in a UI window, I tried many methods but could not display two, I really do not know what to do, I hope to get help
Here’s my code:
from pyfbsdk import *
from pyfbsdk_additions import *
Normal Edit
def OnChange(control,event):
print control.Text
def PopulateLayout(mainLyt):
editStyles = [“FBEditVector”, “FBEditNumber”, “FBEditNumber”] # “FBEdit”,“FBEditColor”,“FBEditNumber”,“FBEditTimeCode”
edits = {}
anchor = “”
attachType = FBAttachType.kFBAttachTop
# Generically create different types of edit
for style in editStyles:
# Create label
labId = "Label" + style
l = FBLabel()
l.Caption = style
x = FBAddRegionParam(10,FBAttachType.kFBAttachLeft,"")
y = FBAddRegionParam(10,attachType,anchor)
w = FBAddRegionParam(100,FBAttachType.kFBAttachNone,"")
h = FBAddRegionParam(25,FBAttachType.kFBAttachNone,"")
mainLyt.AddRegion(labId,labId, x, y, w, h)
mainLyt.SetControl(labId,l)
# Create edit
editId = "Edit" + style
initCall = "%s()" % (style)
e = eval( initCall )
edits[style] = e
x = FBAddRegionParam(10,FBAttachType.kFBAttachRight,labId)
y = FBAddRegionParam(10,attachType,anchor)
w = FBAddRegionParam(200,FBAttachType.kFBAttachNone,"")
h = FBAddRegionParam(25,FBAttachType.kFBAttachNone,"")
mainLyt.AddRegion(editId,editId, x, y, w, h)
mainLyt.SetControl(editId,e)
attachType = FBAttachType.kFBAttachBottom
anchor = labId
# Do specific edit initialization according to its type
# Vector Edit
e = edits['FBEditVector']
e.Value = FBVector3d(0.0, 0.0,0.0)
def CreateTool():
# Tool creation will serve as the hub for all other controls
t = FBCreateUniqueTool(“Edit Example”)
PopulateLayout(t)
ShowTool(t)
CreateTool()