Guest User

Untitled

a guest
Oct 17th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. #MB2011
  2. #なんの変哲もないVerticalListなんだけど、リストの値を上からlist mohi1,list mohi2,list mohi3...と複数選択していくと値が取得できず、
  3. #下からlist mohi10,list mohi9,list mohi8って選択していくとその時選択した値が得られる・・・。
  4.  
  5. from pyfbsdk import *
  6. from pyfbsdk_additions import *
  7.  
  8. def ListCallback(control, event):
  9. print control.Items[control.ItemIndex], "has been selected!"
  10.  
  11. def PopulateLayout(mainLyt):
  12. x = FBAddRegionParam(0,FBAttachType.kFBAttachLeft,"")
  13. y = FBAddRegionParam(0,FBAttachType.kFBAttachTop,"")
  14. w = FBAddRegionParam(200,FBAttachType.kFBAttachNone,"")
  15. h = FBAddRegionParam(0,FBAttachType.kFBAttachBottom,"")
  16. mainLyt.AddRegion("main","main", x,y,w,h)
  17. lyt = VBoxLayout()
  18. mainLyt.SetControl("main",lyt)
  19.  
  20. # List creation
  21. global controls
  22. controls = FBList()
  23. controls.OnChange.Add(ListCallback)
  24. # fill the list with dummy data
  25. for i in range(10):
  26. name = "list mohi %d" % (i + 1)
  27. controls.Items.append(name)
  28. controls.Style = FBListStyle.kFBVerticalList
  29. lyt.Add(controls, 200)
  30. controls.Selected(0,False)
  31. controls.MultiSelect =True
  32.  
  33.  
  34. def CreateTool():
  35. t = CreateUniqueTool("List Example")
  36. PopulateLayout(t)
  37. ShowTool(t)
  38.  
  39.  
  40. CreateTool()
Add Comment
Please, Sign In to add comment