m_popup_shortcut_add.srm 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. $PBExportHeader$m_popup_shortcut_add.srm
  2. forward
  3. global type m_popup_shortcut_add from menu
  4. end type
  5. type m_main from menu within m_popup_shortcut_add
  6. end type
  7. type m_item1 from menu within m_main
  8. end type
  9. type m_main from menu within m_popup_shortcut_add
  10. m_item1 m_item1
  11. end type
  12. global type m_popup_shortcut_add from menu
  13. m_main m_main
  14. end type
  15. end forward
  16. global type m_popup_shortcut_add from menu
  17. m_main m_main
  18. end type
  19. global m_popup_shortcut_add m_popup_shortcut_add
  20. type variables
  21. Powerobject Anyobject
  22. end variables
  23. forward prototypes
  24. public subroutine popupmenu (integer x, integer y)
  25. public subroutine setmenuitem (string itemstring)
  26. public subroutine setitemdisabled (integer itemorder)
  27. public subroutine setiteminvisible (integer itemorder)
  28. end prototypes
  29. public subroutine popupmenu (integer x, integer y);this.m_main.popmenu(x,y)
  30. end subroutine
  31. public subroutine setmenuitem (string itemstring);int itempos,itemorder=1,i
  32. string currentitem
  33. if len(itemstring)=0 then return
  34. itempos=pos(itemstring,"|")
  35. DO WHILE itempos<>0
  36. // itempos为间隔符"|"的位置
  37. currentitem=left(itemstring,itempos - 1)
  38. //取出子串
  39. itemstring=mid(itemstring, itempos+1)
  40. this.m_main.item[itemorder].text=currentitem
  41. itempos=pos(itemstring,"|")
  42. itemorder++
  43. LOOP
  44. this.m_main.item[itemorder].text=itemstring
  45. for i=1 to itemorder
  46. this.m_main.item[i].visible=true
  47. this.m_main.item[i].enabled=true
  48. next
  49. for i=itemorder+1 to 15
  50. this.m_main.item[i].visible=false
  51. next
  52. end subroutine
  53. public subroutine setitemdisabled (integer itemorder);if itemorder<1 or itemorder>15 then return
  54. this.m_main.item[itemorder].enabled=false
  55. end subroutine
  56. public subroutine setiteminvisible (integer itemorder);if itemorder<1 or itemorder>15 then return
  57. this.m_main.item[itemorder].visible=false
  58. end subroutine
  59. on m_popup_shortcut_add.create
  60. m_popup_shortcut_add=this
  61. call super::create
  62. this.text = "m_popup_shortcut"
  63. this.m_main=create m_main
  64. this.Item[UpperBound(this.Item)+1]=this.m_main
  65. end on
  66. on m_popup_shortcut_add.destroy
  67. call super::destroy
  68. destroy(this.m_main)
  69. end on
  70. type m_main from menu within m_popup_shortcut_add
  71. m_item1 m_item1
  72. end type
  73. on m_main.create
  74. call super::create
  75. this.text = "main"
  76. this.m_item1=create m_item1
  77. this.Item[UpperBound(this.Item)+1]=this.m_item1
  78. end on
  79. on m_main.destroy
  80. call super::destroy
  81. destroy(this.m_item1)
  82. end on
  83. type m_item1 from menu within m_main
  84. end type
  85. on m_item1.create
  86. call super::create
  87. this.text = "添加快捷方式"
  88. end on
  89. on m_item1.destroy
  90. call super::destroy
  91. end on
  92. event clicked;w_shortcut_add.tv_func.triggerevent("ue_add_shortcut")
  93. end event