uo_aifmb_text.sru 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. $PBExportHeader$uo_aifmb_text.sru
  2. forward
  3. global type uo_aifmb_text from statictext
  4. end type
  5. end forward
  6. global type uo_aifmb_text from statictext
  7. integer width = 261
  8. integer height = 72
  9. integer textsize = -11
  10. integer weight = 400
  11. fontcharset fontcharset = gb2312charset!
  12. fontpitch fontpitch = variable!
  13. string facename = "宋体"
  14. string pointer = "HAND.CUR"
  15. long textcolor = 33554432
  16. long backcolor = 16777215
  17. string text = "none"
  18. boolean focusrectangle = false
  19. event mousemove pbm_mousemove
  20. event key pbm_keydown
  21. end type
  22. global uo_aifmb_text uo_aifmb_text
  23. type variables
  24. long colour_on=0 ,colour_leave=0
  25. int ifonraise=0
  26. Boolean ib_mousein
  27. end variables
  28. event mousemove;IF ib_mousein <> (xpos > 0 AND ypos > 0 AND xpos < Width AND ypos < Height) THEN RETURN
  29. //if this.TextColor <> colour_on then
  30. // this.TextColor = colour_on
  31. // if ifonraise=1 then
  32. // this.Border=true
  33. // this.BorderStyle=StyleRaised!
  34. // end if
  35. //else
  36. // this.TextColor = colour_leave
  37. // this.Border=false
  38. //end if
  39. //
  40. IF ib_mousein THEN
  41. SetCapture(Handle(THIS))
  42. THIS.TextColor = colour_on
  43. THIS.Underline = TRUE
  44. ELSE
  45. ReleaseCapture()
  46. THIS.TextColor = colour_leave
  47. THIS.Underline = FALSE
  48. END IF
  49. ib_mousein = NOT ib_mousein
  50. end event
  51. event key;If key = KeyEnter! Then //
  52. this.triggerevent(clicked!)
  53. End If
  54. end event
  55. event constructor;colour_on=RGB(55,155,255) //默认鼠标在的颜色
  56. colour_leave=RGB(0,0,0) //默认鼠标不在的颜色
  57. ifonraise=1 //默认鼠标在是突出
  58. end event
  59. event clicked;this.TextColor = colour_leave
  60. THIS.Underline = FALSE
  61. ib_mousein = NOT ib_mousein
  62. //this.Border=true
  63. //this.BorderStyle=Stylelowered!
  64. end event
  65. on uo_aifmb_text.create
  66. end on
  67. on uo_aifmb_text.destroy
  68. end on