w_toast.srw 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. $PBExportHeader$w_toast.srw
  2. $PBExportComments$弹窗提示
  3. forward
  4. global type w_toast from window
  5. end type
  6. type st_1 from statictext within w_toast
  7. end type
  8. end forward
  9. global type w_toast from window
  10. integer width = 1001
  11. integer height = 200
  12. boolean border = false
  13. windowtype windowtype = popup!
  14. long backcolor = 67108864
  15. string icon = "AppIcon!"
  16. integer transparency = 10
  17. st_1 st_1
  18. end type
  19. global w_toast w_toast
  20. type prototypes
  21. //function long shCenterWindow(long hWnd) library "pbvm90.dll"
  22. end prototypes
  23. on w_toast.create
  24. this.st_1=create st_1
  25. this.Control[]={this.st_1}
  26. end on
  27. on w_toast.destroy
  28. destroy(this.st_1)
  29. end on
  30. event open;s_toast_parm s_parm
  31. s_parm = Message.PowerObjectParm
  32. if not IsValid(s_parm) then
  33. Close(this)
  34. return
  35. end if
  36. if IsNull(s_parm) then
  37. Close(this)
  38. return
  39. end if
  40. if (s_parm.showtime <= 0) then
  41. Close(this)
  42. return
  43. end if////////
  44. // 窗口居中
  45. this.Width = s_parm.Width
  46. this.Height = s_parm.Height
  47. long ll_ScreenH,ll_ScreenW
  48. Environment le_Env
  49. GetEnvironment(le_Env)
  50. ll_ScreenH = PixelsToUnits(le_Env.ScreenHeight, YPixelsToUnits!)
  51. ll_ScreenW = PixelsToUnits(le_Env.ScreenWidth , XPixelsToUnits!)
  52. this.Y = (ll_ScreenH - this.Height) / 2
  53. this.X = (ll_ScreenW - this.Width ) / 2
  54. //shCenterWindow(handle(this))
  55. long halfHeight
  56. halfHeight = s_parm.Height / 2
  57. st_1.Width = this.Width
  58. st_1.Y = (this.Height - st_1.Height) / 2
  59. st_1.Text = s_parm.msg
  60. Timer(s_parm.showtime)
  61. end event
  62. event timer;Close(this)
  63. end event
  64. type st_1 from statictext within w_toast
  65. integer y = 60
  66. integer width = 567
  67. integer height = 80
  68. integer textsize = -12
  69. integer weight = 400
  70. fontcharset fontcharset = gb2312charset!
  71. fontpitch fontpitch = fixed!
  72. fontfamily fontfamily = modern!
  73. string facename = "幼圆"
  74. long textcolor = 33554432
  75. long backcolor = 67108864
  76. string text = "none"
  77. alignment alignment = center!
  78. boolean focusrectangle = false
  79. end type