m_dfc_control_popupmenu.srm 9.7 KB

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