m_dfc_control_popupmenu_item.srm 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. $PBExportHeader$m_dfc_control_popupmenu_item.srm
  2. $PBExportComments$超级菜单
  3. forward
  4. global type m_dfc_control_popupmenu_item from menu
  5. end type
  6. type m_temp from menu within m_dfc_control_popupmenu_item
  7. end type
  8. global type m_dfc_control_popupmenu_item from menu
  9. m_temp m_temp
  10. end type
  11. end forward
  12. shared variables
  13. end variables
  14. global type m_dfc_control_popupmenu_item from menu
  15. m_temp m_temp
  16. end type
  17. global m_dfc_control_popupmenu_item m_dfc_control_popupmenu_item
  18. type variables
  19. GraphicObject igoObject
  20. end variables
  21. forward prototypes
  22. public subroutine wf_setlayout (string psmenulist)
  23. end prototypes
  24. public subroutine wf_setlayout (string psmenulist);
  25. String dsList[], dsList_save[]
  26. String dsMenuText, dsMenuText_save
  27. String dsMenuEvent,dsMenuEvent_save
  28. Long i,j, lrow, ll_pos, ll_showflag
  29. datastore ls_ds
  30. ls_ds = Create datastore
  31. ls_ds.DataObject = 'dw_dfc_control_popupmenu_setlayout'
  32. s_dw_rbtnfilter_setlayout_rt ls_s_rt
  33. u_Dfc_Base_Func duFunc
  34. duFunc.uf_Split(psMenuList, "|", dsList)
  35. Int li_line
  36. String ls_window, ls_object
  37. String ls_mdfstr, ls_mdfstr_single
  38. String ls_dwname
  39. string ls_visible
  40. i = UpperBound(dsList)
  41. ls_window = duFunc.uf_GetKeyValue(dsList[i], "Window")
  42. ls_object = duFunc.uf_GetKeyValue(dsList[i], "Object")
  43. ls_dwname = ls_window+"|"+ls_object
  44. SELECT dwnSyntax_filter INTO :ls_mdfstr
  45. FROM sys_user_dwnSyntax
  46. WHERE empid = 0
  47. And dwname = :ls_dwname;
  48. IF sqlca.SQLCode <> 0 THEN
  49. ls_mdfstr = ""
  50. END IF
  51. IF IsNull(ls_mdfstr) THEN ls_mdfstr = ""
  52. duFunc.uf_Split(ls_mdfstr, "|", dsList_save)
  53. FOR i = 1 To UpperBound(dsList) - 1
  54. dsMenuText = duFunc.uf_GetKeyValue(dsList[i], "Text")
  55. dsMenuEvent = duFunc.uf_GetKeyValue(dsList[i], "Event")
  56. IF dsMenuText = "-" And dsMenuEvent = "" THEN
  57. li_line++
  58. dsMenuEvent = "Line"+String(li_line)
  59. END IF
  60. ls_visible = "1"
  61. FOR j = 1 To UpperBound(dsList_save)
  62. dsMenuText_save = duFunc.uf_GetKeyValue(dsList_save[j], "Text")
  63. dsMenuEvent_save = duFunc.uf_GetKeyValue(dsList_save[j], "Event")
  64. IF dsMenuText = dsMenuText_save And dsMenuEvent = dsMenuEvent_save THEN
  65. ls_visible = duFunc.uf_GetKeyValue(dsList_save[j], "Visible")
  66. EXIT
  67. END IF
  68. NEXT
  69. lrow = ls_ds.InsertRow( 0)
  70. ls_ds.SetItem( lrow, "ctitle", dsMenuText)
  71. ls_ds.SetItem( lrow, "cname", dsMenuEvent)
  72. ls_ds.SetItem( lrow, "cshow_flag", long(ls_visible))
  73. NEXT
  74. s_dw_rbtn_tran s_rb_tran
  75. s_rb_tran.dwr_ds = ls_ds
  76. s_rb_tran.Title = "窗口:"+ls_window+" 控件:"+ls_object
  77. //---打开设置窗口
  78. OpenWithParm(w_dfc_control_popupmenu_setlayout,s_rb_tran)
  79. ls_s_rt = Message.PowerObjectParm
  80. //---处理设置
  81. ls_dwname = ls_window+"|"+ls_object
  82. IF ls_s_rt.flag = 1 THEN //要保存修改 //保存个性化方案
  83. ls_ds.SetFullState( ls_s_rt.b_changes )
  84. // ls_mdfstr = ""
  85. FOR i = 1 To ls_ds.RowCount()
  86. ll_showflag = ls_ds.Object.cshow_flag[i]
  87. // ls_mdfstr_single = "|Text="+ls_ds.Object.ctitle[i]+'~tEVent='+ls_ds.Object.cname[i]+'~tVisible='+String(ls_ds.Object.cshow_flag[i])
  88. ls_mdfstr_single = "|Text="+ls_ds.Object.ctitle[i]+'~tEVent='+ls_ds.Object.cname[i]+'~tVisible='
  89. ll_pos = pos(ls_mdfstr, ls_mdfstr_single)
  90. if ll_pos > 0 then
  91. ls_mdfstr = replace(ls_mdfstr, ll_pos + len(ls_mdfstr_single), 1, string(ll_showflag))
  92. else
  93. ls_mdfstr = ls_mdfstr+ ls_mdfstr_single+string(ll_showflag)
  94. end if
  95. // ls_mdfstr = ls_mdfstr+ "|Text="+ls_ds.Object.ctitle[i]+'~tEVent='+ls_ds.Object.cname[i]+'~tVisible='+String(ls_ds.Object.cshow_flag[i])
  96. NEXT
  97. UPDATE sys_user_dwnSyntax
  98. SET dwnSyntax_filter = :ls_mdfstr
  99. WHERE empid = 0
  100. And dwname = :ls_dwname;
  101. IF sqlca.SQLCode = 0 THEN
  102. IF sqlca.SQLNRows = 0 THEN
  103. INSERT INTO sys_user_dwnSyntax
  104. (empid, dwname, dwnSyntax_filter)
  105. VALUES
  106. (0, :ls_dwname, :ls_mdfstr);
  107. IF sqlca.SQLCode <> 0 THEN
  108. ROLLBACK;
  109. ELSE
  110. COMMIT;
  111. END IF
  112. else
  113. commit;
  114. END IF
  115. ELSE
  116. ROLLBACK;
  117. END IF
  118. END IF
  119. Destroy ls_ds
  120. end subroutine
  121. on m_dfc_control_popupmenu_item.create
  122. m_dfc_control_popupmenu_item=this
  123. call super::create
  124. this.menutextcolor = 134217735
  125. this.menubackcolor = 134217732
  126. this.menuhighlightcolor = 134217741
  127. this.textsize = 8
  128. this.weight = 400
  129. this.facename = "Tahoma"
  130. this.titlebackcolor = 134217730
  131. this.bitmapbackcolor = 12632256
  132. this.menubitmaps = true
  133. this.titlegradient = true
  134. this.toolbartextcolor = 134217746
  135. this.toolbarbackcolor = 67108864
  136. this.toolbarhighlightcolor = 134217741
  137. this.toolbargradient = true
  138. this.bitmapgradient = true
  139. this.m_temp=create m_temp
  140. this.Item[UpperBound(this.Item)+1]=this.m_temp
  141. end on
  142. on m_dfc_control_popupmenu_item.destroy
  143. call super::destroy
  144. destroy(this.m_temp)
  145. end on
  146. type m_temp from menu within m_dfc_control_popupmenu_item
  147. end type
  148. on m_temp.create
  149. call super::create
  150. this.text = "Temp"
  151. this.menutextcolor = 134217735
  152. this.menubackcolor = 134217732
  153. this.menuhighlightcolor = 134217741
  154. this.textsize = 8
  155. this.weight = 400
  156. this.facename = "Tahoma"
  157. this.titlebackcolor = 134217730
  158. this.bitmapbackcolor = 12632256
  159. this.menubitmaps = true
  160. this.titlegradient = true
  161. this.toolbartextcolor = 134217746
  162. this.toolbarbackcolor = 67108864
  163. this.toolbarhighlightcolor = 134217741
  164. this.toolbargradient = true
  165. this.bitmapgradient = true
  166. end on
  167. on m_temp.destroy
  168. call super::destroy
  169. end on
  170. event clicked;//====================================================================
  171. // 事件(Event): m_temp::clicked()
  172. //--------------------------------------------------------------------
  173. // 描述(Description): 菜单条触发时
  174. //--------------------------------------------------------------------
  175. // 参数(Arguments): (None)
  176. //--------------------------------------------------------------------
  177. // 返回(Returns): (None)
  178. //--------------------------------------------------------------------
  179. // 作者: 董伟勇 日期: 2003.05.15
  180. //--------------------------------------------------------------------
  181. // 修改历史:
  182. //
  183. //--------------------------------------------------------------------
  184. // 1998-2003 上海亿用软件有限公司 | DongSoft Team
  185. //====================================================================
  186. IF UpperBound(Item) = 0 THEN
  187. String dsEventName
  188. string dsMenuText
  189. u_Dfc_Base_Func duFunc
  190. dsMenuText = duFunc.uf_GetKeyValue(Tag, "Text")
  191. dsEventName = duFunc.uf_GetKeyValue(Tag, "Event")
  192. IF dsEventName <> "" THEN
  193. IF dsEventName = 'SetMenu' and sys_power_issuper THEN
  194. Long ll_pos
  195. String ls_menustr
  196. ll_pos = Pos(Tag, "MenuStr=")
  197. ls_menustr = Mid(Tag, ll_pos + 8)
  198. //messagebox('',ls_menustr)
  199. wf_setlayout(ls_menustr)
  200. ELSE
  201. File_Way = dsMenuText
  202. ParentWindow.TriggerEvent(dsEventName)
  203. END IF
  204. // ParentWindow.TriggerEvent(dsEventName)
  205. // 如果有效
  206. // If IsValid(igoObject) Then
  207. // igoObject.TriggerEvent(dsEventName)
  208. // Else
  209. // ParentWindow.TriggerEvent(dsEventName)
  210. // End If
  211. END IF
  212. END IF
  213. end event