uo_text_m_main.sru 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. $PBExportHeader$uo_text_m_main.sru
  2. forward
  3. global type uo_text_m_main from statictext
  4. end type
  5. end forward
  6. global type uo_text_m_main 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_main uo_text_m_main
  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. ib_mousein = false
  59. end event
  60. event clicked;this.TextColor = colour_leave
  61. THIS.Underline = FALSE
  62. ib_mousein = NOT ib_mousein
  63. //this.Border=true
  64. //this.BorderStyle=Stylelowered!
  65. end event
  66. on uo_text_m_main.create
  67. end on
  68. on uo_text_m_main.destroy
  69. end on