uo_text_m.sru 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. $PBExportHeader$uo_text_m.sru
  2. forward
  3. global type uo_text_m from statictext
  4. end type
  5. end forward
  6. global type uo_text_m 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_text_m uo_text_m
  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. ELSE
  44. ReleaseCapture()
  45. this.TextColor = colour_leave
  46. END IF
  47. ib_mousein = NOT ib_mousein
  48. end event
  49. event key;If key = KeyEnter! Then //
  50. this.triggerevent(clicked!)
  51. End If
  52. end event
  53. event constructor;colour_on=RGB(0,0,255) //默认鼠标在的颜色
  54. colour_leave=RGB(0,0,0) //默认鼠标不在的颜色
  55. ifonraise=1 //默认鼠标在是突出
  56. end event
  57. event clicked;this.TextColor = colour_on
  58. //this.Border=true
  59. //this.BorderStyle=Stylelowered!
  60. end event
  61. on uo_text_m.create
  62. end on
  63. on uo_text_m.destroy
  64. end on