m_dfc_control_popupmenu_way.srm 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. $PBExportHeader$m_dfc_control_popupmenu_way.srm
  2. $PBExportComments$超级菜单
  3. forward
  4. global type m_dfc_control_popupmenu_way from menu
  5. end type
  6. type m_commonpopup from menu within m_dfc_control_popupmenu_way
  7. end type
  8. global type m_dfc_control_popupmenu_way from menu
  9. m_commonpopup m_commonpopup
  10. end type
  11. end forward
  12. global type m_dfc_control_popupmenu_way from menu
  13. m_commonpopup m_commonpopup
  14. end type
  15. global m_dfc_control_popupmenu_way m_dfc_control_popupmenu_way
  16. type variables
  17. end variables
  18. forward prototypes
  19. public subroutine mf_buildline ()
  20. public subroutine mf_popmenu ()
  21. public subroutine mf_buildmenu (any pgoobject, string psmenulist)
  22. private subroutine mf_builditem (any pgoobject, string psmenutext, string pstag)
  23. public subroutine mf_setenabled (string psmenuname, boolean pbchecked)
  24. public subroutine mf_setchecked (string psmenuname, boolean pbchecked)
  25. end prototypes
  26. public subroutine mf_buildline ();//====================================================================
  27. // 过程(Subroutine): m_dfc_control_popupmenu::mf_buildline()
  28. //--------------------------------------------------------------------
  29. // 描述(Description):
  30. //--------------------------------------------------------------------
  31. // 参数(Arguments): (None)
  32. //--------------------------------------------------------------------
  33. // 返回(Returns): (None)
  34. //--------------------------------------------------------------------
  35. // 作者: 董伟勇 日期: 2003.05.15
  36. //--------------------------------------------------------------------
  37. // 修改历史:
  38. //
  39. //--------------------------------------------------------------------
  40. // 1998-2003 上海亿用软件有限公司 | DongSoft Team
  41. //====================================================================
  42. integer diPos
  43. String dsItemText
  44. diPos = upperbound(m_commonpopup.item)+1 // can only append now
  45. m_dfc_control_popupmenu_Item dm
  46. dm=create m_dfc_control_popupmenu_Item
  47. dsItemText = "OK"
  48. dm.item[1].Enabled = True
  49. m_commonpopup.item[diPos] = dm.item[1] //must be item[1], or you'll find a funny result
  50. m_commonpopup.item[diPos].text = "-"
  51. m_commonpopup.item[diPos].tag = "-"
  52. end subroutine
  53. public subroutine mf_popmenu ();//====================================================================
  54. // 过程(Subroutine): m_dfc_control_popupmenu::mf_popmenu()
  55. //--------------------------------------------------------------------
  56. // 描述(Description):
  57. //--------------------------------------------------------------------
  58. // 参数(Arguments): (None)
  59. //--------------------------------------------------------------------
  60. // 返回(Returns): (None)
  61. //--------------------------------------------------------------------
  62. // 作者: 董伟勇 日期: 2003.05.15
  63. //--------------------------------------------------------------------
  64. // 修改历史:
  65. //
  66. //--------------------------------------------------------------------
  67. // 1998-2003 上海亿用软件有限公司 | DongSoft Team
  68. //====================================================================
  69. m_CommonPopup.PopMenu(ParentWindow.PointerX(), ParentWindow.PointerY())
  70. end subroutine
  71. public subroutine mf_buildmenu (any pgoobject, string psmenulist);//====================================================================
  72. // 过程(Subroutine): m_dfc_control_popupmenu::mf_buildmenu()
  73. //--------------------------------------------------------------------
  74. // 描述(Description): 建立菜单
  75. //--------------------------------------------------------------------
  76. // 参数(Arguments):
  77. // string psmenulist 菜单描述
  78. //--------------------------------------------------------------------
  79. // 返回(Returns): (None)
  80. //--------------------------------------------------------------------
  81. // 作者: 董伟勇 日期: 2003.05.15
  82. //--------------------------------------------------------------------
  83. // 修改历史:
  84. //
  85. //--------------------------------------------------------------------
  86. // 1998-2003 上海亿用软件有限公司 | DongSoft Team
  87. //====================================================================
  88. u_Dfc_Base_Func duFunc
  89. String dsList[]
  90. String dsMenuText
  91. String dsEvent
  92. String dsNote // 说明
  93. Integer i
  94. duFunc.uf_Split(psMenuList, "|", dsList)
  95. For i = 1 To UpperBound(dsList)
  96. dsMenuText = duFunc.uf_GetKeyValue(dsList[i], "Text")
  97. mf_BuildItem(pgoObject, dsMenuText, dsList[i])
  98. Next
  99. end subroutine
  100. private subroutine mf_builditem (any pgoobject, string psmenutext, string pstag);//====================================================================
  101. // 过程(Subroutine): m_dfc_control_popupmenu::mf_builditem()
  102. //--------------------------------------------------------------------
  103. // 描述(Description): 内部函数: 增加菜单条
  104. //--------------------------------------------------------------------
  105. // 参数(Arguments):
  106. // string psmenutext 菜单名称
  107. // string pstag Tag
  108. //--------------------------------------------------------------------
  109. // 返回(Returns): (None)
  110. //--------------------------------------------------------------------
  111. // 作者: 董伟勇 日期: 2003.05.15
  112. //--------------------------------------------------------------------
  113. // 修改历史:
  114. //
  115. //--------------------------------------------------------------------
  116. // 1998-2003 上海亿用软件有限公司 | DongSoft Team
  117. //====================================================================
  118. u_Dfc_Base_Func duFunc
  119. Integer diPos
  120. diPos = upperbound(m_commonpopup.item)+1 // can only append now
  121. m_dfc_control_popupmenu_Item dm
  122. dm=create m_dfc_control_popupmenu_Item
  123. dm.igoObject = pgoObject
  124. dm.item[1].Enabled = True
  125. If Upper(duFunc.uf_GetKeyValue(psTag, "Checked")) = "TRUE" Then
  126. dm.item[1].Checked = True
  127. End If
  128. m_commonpopup.item[diPos] = dm.item[1]
  129. m_commonpopup.item[diPos].text = psMenuText
  130. m_commonpopup.item[diPos].tag = psTag
  131. end subroutine
  132. public subroutine mf_setenabled (string psmenuname, boolean pbchecked);//====================================================================
  133. // 过程(Subroutine): m_dfc_control_popupmenu::mf_setchecked()
  134. //--------------------------------------------------------------------
  135. // 描述(Description): 选择或者不选择指定菜单名称
  136. //--------------------------------------------------------------------
  137. // 参数(Arguments):
  138. // string psmenuname 菜单名称
  139. // boolean pbchecked 是否选择
  140. //--------------------------------------------------------------------
  141. // 返回(Returns): (None)
  142. //--------------------------------------------------------------------
  143. // 作者: 董伟勇 日期: 2003.05.15
  144. //--------------------------------------------------------------------
  145. // 修改历史:
  146. //
  147. //--------------------------------------------------------------------
  148. // 1998-2003 上海亿用软件有限公司 | DongSoft Team
  149. //====================================================================
  150. Integer diPos
  151. For diPos = 1 To UpperBound(m_commonpopup.Item)
  152. If Trim(Upper(m_commonpopup.item[diPos].Text)) = Trim(Upper(psMenuName)) Then
  153. m_commonpopup.item[diPos].Enabled = pbChecked
  154. End If
  155. Next
  156. end subroutine
  157. public subroutine mf_setchecked (string psmenuname, boolean pbchecked);//====================================================================
  158. // 过程(Subroutine): m_dfc_control_popupmenu::mf_setchecked()
  159. //--------------------------------------------------------------------
  160. // 描述(Description): 选择或者不选择指定菜单名称
  161. //--------------------------------------------------------------------
  162. // 参数(Arguments):
  163. // string psmenuname 菜单名称
  164. // boolean pbchecked 是否选择
  165. //--------------------------------------------------------------------
  166. // 返回(Returns): (None)
  167. //--------------------------------------------------------------------
  168. // 作者: 董伟勇 日期: 2003.05.15
  169. //--------------------------------------------------------------------
  170. // 修改历史:
  171. //
  172. //--------------------------------------------------------------------
  173. // 1998-2003 上海亿用软件有限公司 | DongSoft Team
  174. //====================================================================
  175. Integer diPos
  176. For diPos = 1 To UpperBound(m_commonpopup.Item)
  177. If Trim(Upper(m_commonpopup.item[diPos].Text)) = Trim(Upper(psMenuName)) Then
  178. m_commonpopup.item[diPos].Checked = pbChecked
  179. End If
  180. Next
  181. end subroutine
  182. on m_dfc_control_popupmenu_way.create
  183. m_dfc_control_popupmenu_way=this
  184. call super::create
  185. this.menutextcolor = 134217735
  186. this.menubackcolor = 134217732
  187. this.menuhighlightcolor = 134217741
  188. this.textsize = 8
  189. this.weight = 400
  190. this.facename = "Tahoma"
  191. this.titlebackcolor = 134217730
  192. this.bitmapbackcolor = 12632256
  193. this.menubitmaps = true
  194. this.titlegradient = true
  195. this.toolbartextcolor = 134217746
  196. this.toolbarbackcolor = 67108864
  197. this.toolbarhighlightcolor = 134217741
  198. this.toolbargradient = true
  199. this.bitmapgradient = true
  200. this.m_commonpopup=create m_commonpopup
  201. this.Item[UpperBound(this.Item)+1]=this.m_commonpopup
  202. end on
  203. on m_dfc_control_popupmenu_way.destroy
  204. call super::destroy
  205. destroy(this.m_commonpopup)
  206. end on
  207. type m_commonpopup from menu within m_dfc_control_popupmenu_way
  208. end type
  209. on m_commonpopup.create
  210. call super::create
  211. this.text = "CommonPopup"
  212. this.menutextcolor = 134217735
  213. this.menubackcolor = 134217732
  214. this.menuhighlightcolor = 134217741
  215. this.textsize = 8
  216. this.weight = 400
  217. this.facename = "Tahoma"
  218. this.titlebackcolor = 134217730
  219. this.bitmapbackcolor = 12632256
  220. this.menubitmaps = true
  221. this.titlegradient = true
  222. this.toolbartextcolor = 134217746
  223. this.toolbarbackcolor = 67108864
  224. this.toolbarhighlightcolor = 134217741
  225. this.toolbargradient = true
  226. this.bitmapgradient = true
  227. end on
  228. on m_commonpopup.destroy
  229. call super::destroy
  230. end on
  231. event clicked;
  232. //w_fj_bill_mng.triggerevent('ue_fileway')
  233. //m_commonpopup.item[diPos] = dm.item[1]
  234. //m_commonpopup.item[diPos].text = psMenuText
  235. //m_commonpopup.item[diPos].tag = psTag
  236. end event