m_dfc_control_popupmenu.srm 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  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_setchecked (string psmenuname, boolean pbchecked)
  21. public subroutine mf_popmenu ()
  22. public subroutine mf_buildmenu (any pgoobject, string psmenulist)
  23. private subroutine mf_builditem (any pgoobject, string psmenutext, string pstag)
  24. end prototypes
  25. public subroutine mf_buildline ();//====================================================================
  26. // 过程(Subroutine): m_dfc_control_popupmenu::mf_buildline()
  27. //--------------------------------------------------------------------
  28. // 描述(Description):
  29. //--------------------------------------------------------------------
  30. // 参数(Arguments): (None)
  31. //--------------------------------------------------------------------
  32. // 返回(Returns): (None)
  33. //--------------------------------------------------------------------
  34. // 作者: 董伟勇 日期: 2003.05.15
  35. //--------------------------------------------------------------------
  36. // 修改历史:
  37. //
  38. //--------------------------------------------------------------------
  39. // 1998-2003 上海亿用软件有限公司 | DongSoft Team
  40. //====================================================================
  41. integer diPos
  42. String dsItemText
  43. diPos = upperbound(m_commonpopup.item)+1 // can only append now
  44. m_dfc_control_popupmenu_Item dm
  45. dm=create m_dfc_control_popupmenu_Item
  46. dsItemText = "OK"
  47. dm.item[1].Enabled = True
  48. m_commonpopup.item[diPos] = dm.item[1] //must be item[1], or you'll find a funny result
  49. m_commonpopup.item[diPos].text = "-"
  50. m_commonpopup.item[diPos].tag = "-"
  51. end subroutine
  52. public subroutine mf_setchecked (string psmenuname, boolean pbchecked);//====================================================================
  53. // 过程(Subroutine): m_dfc_control_popupmenu::mf_setchecked()
  54. //--------------------------------------------------------------------
  55. // 描述(Description): 选择或者不选择指定菜单名称
  56. //--------------------------------------------------------------------
  57. // 参数(Arguments):
  58. // string psmenuname 菜单名称
  59. // boolean pbchecked 是否选择
  60. //--------------------------------------------------------------------
  61. // 返回(Returns): (None)
  62. //--------------------------------------------------------------------
  63. // 作者: 董伟勇 日期: 2003.05.15
  64. //--------------------------------------------------------------------
  65. // 修改历史:
  66. //
  67. //--------------------------------------------------------------------
  68. // 1998-2003 上海亿用软件有限公司 | DongSoft Team
  69. //====================================================================
  70. Integer diPos
  71. For diPos = 1 To UpperBound(m_commonpopup.Item)
  72. If Trim(Upper(m_commonpopup.item[diPos].Text)) = Trim(Upper(psMenuName)) Then
  73. m_commonpopup.item[diPos].Checked = pbChecked
  74. End If
  75. Next
  76. end subroutine
  77. public subroutine mf_popmenu ();//====================================================================
  78. // 过程(Subroutine): m_dfc_control_popupmenu::mf_popmenu()
  79. //--------------------------------------------------------------------
  80. // 描述(Description):
  81. //--------------------------------------------------------------------
  82. // 参数(Arguments): (None)
  83. //--------------------------------------------------------------------
  84. // 返回(Returns): (None)
  85. //--------------------------------------------------------------------
  86. // 作者: 董伟勇 日期: 2003.05.15
  87. //--------------------------------------------------------------------
  88. // 修改历史:
  89. //
  90. //--------------------------------------------------------------------
  91. // 1998-2003 上海亿用软件有限公司 | DongSoft Team
  92. //====================================================================
  93. m_CommonPopup.PopMenu(ParentWindow.PointerX(), ParentWindow.PointerY())
  94. end subroutine
  95. public subroutine mf_buildmenu (any pgoobject, string psmenulist);//====================================================================
  96. // 过程(Subroutine): m_dfc_control_popupmenu::mf_buildmenu()
  97. //--------------------------------------------------------------------
  98. // 描述(Description): 建立菜单
  99. //--------------------------------------------------------------------
  100. // 参数(Arguments):
  101. // string psmenulist 菜单描述
  102. //--------------------------------------------------------------------
  103. // 返回(Returns): (None)
  104. //--------------------------------------------------------------------
  105. // 作者: 董伟勇 日期: 2003.05.15
  106. //--------------------------------------------------------------------
  107. // 修改历史:
  108. //
  109. //--------------------------------------------------------------------
  110. // 1998-2003 上海亿用软件有限公司 | DongSoft Team
  111. //====================================================================
  112. u_Dfc_Base_Func duFunc
  113. String dsList[], dsList_save[]
  114. String dsMenuText, dsMenuText_save
  115. String dsMenuEvent,dsMenuEvent_save
  116. String dsNote // 说明
  117. String ls_visible
  118. Integer i, j
  119. String ls_tolmenu
  120. ls_tolmenu = psMenuList
  121. Int li_line
  122. //lhd 20150314 实现菜单自由设置
  123. //String ls_window, ls_object, ls_title
  124. //ls_window = ParentWindow.ClassName()
  125. //ls_object = ClassName(pgoObject)
  126. //ls_title = "Window="+ls_window+"~tObject=" + ls_object
  127. //
  128. //String ls_mdfstr
  129. //String ls_dwname
  130. //ls_dwname = ls_window+"|"+ls_object
  131. //SELECT dwnSyntax_filter INTO :ls_mdfstr
  132. // FROM sys_user_dwnSyntax
  133. // WHERE empid = 0
  134. // And dwname = :ls_dwname;
  135. //IF sqlca.SQLCode <> 0 THEN
  136. // ls_mdfstr = ""
  137. //END IF
  138. //
  139. //IF IsNull(ls_mdfstr) THEN ls_mdfstr = ""
  140. //duFunc.uf_Split(ls_mdfstr, "|", dsList_save)
  141. //
  142. //处理
  143. IF Left(psMenuList,1) = "|" THEN
  144. psMenuList = Mid(psMenuList, 2, Len(psMenuList) - 1)
  145. END IF
  146. duFunc.uf_Split(psMenuList, "|", dsList)
  147. FOR i = 1 To UpperBound(dsList)
  148. dsMenuText = duFunc.uf_GetKeyValue(dsList[i], "Text")
  149. dsMenuEvent = duFunc.uf_GetKeyValue(dsList[i], "Event")
  150. IF dsMenuText = "-" And dsMenuEvent = "" THEN
  151. li_line++
  152. dsMenuEvent = "Line"+String(li_line)
  153. END IF
  154. ls_visible = "1"
  155. FOR j = 1 To UpperBound(dsList_save)
  156. dsMenuText_save = duFunc.uf_GetKeyValue(dsList_save[j], "Text")
  157. dsMenuEvent_save = duFunc.uf_GetKeyValue(dsList_save[j], "Event")
  158. IF dsMenuText = dsMenuText_save And dsMenuEvent = dsMenuEvent_save THEN
  159. ls_visible = duFunc.uf_GetKeyValue(dsList_save[j], "Visible")
  160. EXIT
  161. END IF
  162. NEXT
  163. IF ls_visible = "1" THEN
  164. mf_BuildItem(pgoObject, dsMenuText, dsList[i])
  165. END IF
  166. NEXT
  167. //IF sys_power_issuper THEN
  168. // dsMenuText = '-'
  169. // mf_BuildItem(pgoObject, dsMenuText, '-')
  170. // dsMenuText = '菜单设置~tEvent=SetMenu~tMenuStr='+ls_tolmenu+"|"+ls_title
  171. // mf_BuildItem(pgoObject, '菜单设置', dsMenuText)
  172. //END IF
  173. end subroutine
  174. private subroutine mf_builditem (any pgoobject, string psmenutext, string pstag);//====================================================================
  175. // 过程(Subroutine): m_dfc_control_popupmenu::mf_builditem()
  176. //--------------------------------------------------------------------
  177. // 描述(Description): 内部函数: 增加菜单条
  178. //--------------------------------------------------------------------
  179. // 参数(Arguments):
  180. // string psmenutext 菜单名称
  181. // string pstag Tag
  182. //--------------------------------------------------------------------
  183. // 返回(Returns): (None)
  184. //--------------------------------------------------------------------
  185. // 作者: 董伟勇 日期: 2003.05.15
  186. //--------------------------------------------------------------------
  187. // 修改历史:
  188. //
  189. //--------------------------------------------------------------------
  190. // 1998-2003 上海亿用软件有限公司 | DongSoft Team
  191. //====================================================================
  192. u_Dfc_Base_Func duFunc
  193. Integer diPos
  194. diPos = upperbound(m_commonpopup.item)+1 // can only append now
  195. m_dfc_control_popupmenu_Item dm
  196. dm=create m_dfc_control_popupmenu_Item
  197. dm.igoObject = pgoObject
  198. dm.item[1].Enabled = True
  199. If Upper(duFunc.uf_GetKeyValue(psTag, "Checked")) = "TRUE" Then
  200. dm.item[1].Checked = True
  201. End If
  202. m_commonpopup.item[diPos] = dm.item[1]
  203. m_commonpopup.item[diPos].text = psMenuText
  204. m_commonpopup.item[diPos].tag = psTag
  205. end subroutine
  206. on m_dfc_control_popupmenu.create
  207. m_dfc_control_popupmenu=this
  208. call super::create
  209. this.menutextcolor = 134217735
  210. this.menubackcolor = 134217732
  211. this.menuhighlightcolor = 134217741
  212. this.textsize = 8
  213. this.weight = 400
  214. this.facename = "Tahoma"
  215. this.titlebackcolor = 134217730
  216. this.bitmapbackcolor = 12632256
  217. this.menubitmaps = true
  218. this.titlegradient = true
  219. this.toolbartextcolor = 134217746
  220. this.toolbarbackcolor = 67108864
  221. this.toolbarhighlightcolor = 134217741
  222. this.toolbargradient = true
  223. this.bitmapgradient = true
  224. this.m_commonpopup=create m_commonpopup
  225. this.Item[UpperBound(this.Item)+1]=this.m_commonpopup
  226. end on
  227. on m_dfc_control_popupmenu.destroy
  228. call super::destroy
  229. destroy(this.m_commonpopup)
  230. end on
  231. type m_commonpopup from menu within m_dfc_control_popupmenu
  232. end type
  233. on m_commonpopup.create
  234. call super::create
  235. this.text = "CommonPopup"
  236. this.menutextcolor = 134217735
  237. this.menubackcolor = 134217732
  238. this.menuhighlightcolor = 134217741
  239. this.textsize = 8
  240. this.weight = 400
  241. this.facename = "Tahoma"
  242. this.titlebackcolor = 134217730
  243. this.bitmapbackcolor = 12632256
  244. this.menubitmaps = true
  245. this.titlegradient = true
  246. this.toolbartextcolor = 134217746
  247. this.toolbarbackcolor = 67108864
  248. this.toolbarhighlightcolor = 134217741
  249. this.toolbargradient = true
  250. this.bitmapgradient = true
  251. end on
  252. on m_commonpopup.destroy
  253. call super::destroy
  254. end on