from pyfbsdk import * from pyfbsdk_additions import * region1 = FBLabel() region2 = FBEdit() region3 = FBLabel() region4 = FBEdit() region5 = FBButton() def BtnCallbackregion5(control, event): list = FBModelList() FBGetSelectedModels(list) for obj in list: obj.Name = obj.Name.replace( region2.Text, region4.Text) def PopulateTool(t): #populate regions here x = FBAddRegionParam(43,FBAttachType.kFBAttachNone,"") y = FBAddRegionParam(59,FBAttachType.kFBAttachNone,"") w = FBAddRegionParam(100,FBAttachType.kFBAttachNone,"") h = FBAddRegionParam(27,FBAttachType.kFBAttachNone,"") t.AddRegion("region1","region1", x, y, w, h) t.SetControl("region1", region1) region1.Caption = "Mask" region1.Style = FBTextStyle.kFBTextStyleNone region1.Justify = FBTextJustify.kFBTextJustifyLeft region1.WordWrap = True x = FBAddRegionParam(44,FBAttachType.kFBAttachNone,"") y = FBAddRegionParam(94,FBAttachType.kFBAttachNone,"") w = FBAddRegionParam(107,FBAttachType.kFBAttachNone,"") h = FBAddRegionParam(36,FBAttachType.kFBAttachNone,"") t.AddRegion("region2","region2", x, y, w, h) t.SetControl("region2", region2) region2.Text = "Text" region2.PasswordMode = False x = FBAddRegionParam(207,FBAttachType.kFBAttachNone,"") y = FBAddRegionParam(57,FBAttachType.kFBAttachNone,"") w = FBAddRegionParam(104,FBAttachType.kFBAttachNone,"") h = FBAddRegionParam(28,FBAttachType.kFBAttachNone,"") t.AddRegion("region3","region3", x, y, w, h) t.SetControl("region3", region3) region3.Caption = "Replace" region3.Style = FBTextStyle.kFBTextStyleNone region3.Justify = FBTextJustify.kFBTextJustifyLeft region3.WordWrap = True x = FBAddRegionParam(208,FBAttachType.kFBAttachNone,"") y = FBAddRegionParam(91,FBAttachType.kFBAttachNone,"") w = FBAddRegionParam(105,FBAttachType.kFBAttachNone,"") h = FBAddRegionParam(39,FBAttachType.kFBAttachNone,"") t.AddRegion("region4","region4", x, y, w, h) t.SetControl("region4", region4) region4.Text = "Text" region4.PasswordMode = False x = FBAddRegionParam(112,FBAttachType.kFBAttachNone,"") y = FBAddRegionParam(148,FBAttachType.kFBAttachNone,"") w = FBAddRegionParam(137,FBAttachType.kFBAttachNone,"") h = FBAddRegionParam(42,FBAttachType.kFBAttachNone,"") t.AddRegion("region5","region5", x, y, w, h) t.SetControl("region5", region5) region5.Caption = "Rename" region5.State = 0 region5.Style = FBButtonStyle.kFBPushButton region5.Justify = FBTextJustify.kFBTextJustifyCenter region5.Look = FBButtonLook.kFBLookNormal region5.OnClick.Add(BtnCallbackregion5) def CreateTool(): t = CreateUniqueTool("Tool") t.StartSizeX = 586 t.StartSizeY = 362 PopulateTool(t) ShowTool(t) CreateTool()