1
2
3
4
5
6
7
8
9
10
11
12from pyfbsdk import *
13from pyfbsdk_additions import *
14
15
16def ShowPopupCallback(control, event):
17 global t
18 popup.Show(t)
19
20
21def ClosePopupCallback(control, event):
22 popup.Close(True)
23
24
25def PopulateLayout(mainLyt):
26
28 b.Caption = "Pop up"
29
30 x = FBAddRegionParam(10,FBAttachType.kFBAttachLeft,"")
31 y = FBAddRegionParam(10,FBAttachType.kFBAttachTop,"")
32 w = FBAddRegionParam(50,FBAttachType.kFBAttachNone,"")
33 h = FBAddRegionParam(25,FBAttachType.kFBAttachNone,"")
34
35 mainLyt.AddRegion("Btn","Btn", x, y, w, h)
36 mainLyt.SetControl("Btn",b)
37
38 b.OnClick.Add(ShowPopupCallback)
39
40
41 global popup
43 popup.Caption = "Popup"
44 popup.Modal = False
45
46 popup.Left = 300
47 popup.Top = 300
48 popup.Width = 400
49 popup.Height = 500
50
52 b.Caption = "Close"
53 b.OnClick.Add(ClosePopupCallback)
54
55
56 popup.AddRegion( "Close", "Close", x, y ,w,h )
57 popup.SetControl("Close", b)
58
59def CreateTool():
60
61 global t
62 t = FBCreateUniqueTool("Popup Example")
63 PopulateLayout(t)
64 ShowTool(t)
65
66
67CreateTool()
68