123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260 |
- $PBExportHeader$m_dfc_control_popupmenu_item.srm
- $PBExportComments$超级菜单
- forward
- global type m_dfc_control_popupmenu_item from menu
- end type
- type m_temp from menu within m_dfc_control_popupmenu_item
- end type
- global type m_dfc_control_popupmenu_item from menu
- m_temp m_temp
- end type
- end forward
- shared variables
- end variables
- global type m_dfc_control_popupmenu_item from menu
- m_temp m_temp
- end type
- global m_dfc_control_popupmenu_item m_dfc_control_popupmenu_item
- type variables
- GraphicObject igoObject
- end variables
- forward prototypes
- public subroutine wf_setlayout (string psmenulist)
- end prototypes
- public subroutine wf_setlayout (string psmenulist);
- String dsList[], dsList_save[]
- String dsMenuText, dsMenuText_save
- String dsMenuEvent,dsMenuEvent_save
- Long i,j, lrow, ll_pos, ll_showflag
- datastore ls_ds
- ls_ds = Create datastore
- ls_ds.DataObject = 'dw_dfc_control_popupmenu_setlayout'
- s_dw_rbtnfilter_setlayout_rt ls_s_rt
- u_Dfc_Base_Func duFunc
- duFunc.uf_Split(psMenuList, "|", dsList)
- Int li_line
- String ls_window, ls_object
- String ls_mdfstr, ls_mdfstr_single
- String ls_dwname
- string ls_visible
- i = UpperBound(dsList)
- ls_window = duFunc.uf_GetKeyValue(dsList[i], "Window")
- ls_object = duFunc.uf_GetKeyValue(dsList[i], "Object")
- ls_dwname = ls_window+"|"+ls_object
- SELECT dwnSyntax_filter INTO :ls_mdfstr
- FROM sys_user_dwnSyntax
- WHERE empid = 0
- And dwname = :ls_dwname;
- IF sqlca.SQLCode <> 0 THEN
- ls_mdfstr = ""
- END IF
- IF IsNull(ls_mdfstr) THEN ls_mdfstr = ""
- duFunc.uf_Split(ls_mdfstr, "|", dsList_save)
- FOR i = 1 To UpperBound(dsList) - 1
- dsMenuText = duFunc.uf_GetKeyValue(dsList[i], "Text")
- dsMenuEvent = duFunc.uf_GetKeyValue(dsList[i], "Event")
-
- IF dsMenuText = "-" And dsMenuEvent = "" THEN
- li_line++
- dsMenuEvent = "Line"+String(li_line)
- END IF
-
- ls_visible = "1"
- FOR j = 1 To UpperBound(dsList_save)
- dsMenuText_save = duFunc.uf_GetKeyValue(dsList_save[j], "Text")
- dsMenuEvent_save = duFunc.uf_GetKeyValue(dsList_save[j], "Event")
-
- IF dsMenuText = dsMenuText_save And dsMenuEvent = dsMenuEvent_save THEN
- ls_visible = duFunc.uf_GetKeyValue(dsList_save[j], "Visible")
- EXIT
- END IF
- NEXT
-
- lrow = ls_ds.InsertRow( 0)
- ls_ds.SetItem( lrow, "ctitle", dsMenuText)
- ls_ds.SetItem( lrow, "cname", dsMenuEvent)
- ls_ds.SetItem( lrow, "cshow_flag", long(ls_visible))
-
- NEXT
-
- s_dw_rbtn_tran s_rb_tran
- s_rb_tran.dwr_ds = ls_ds
- s_rb_tran.Title = "窗口:"+ls_window+" 控件:"+ls_object
- //---打开设置窗口
- OpenWithParm(w_dfc_control_popupmenu_setlayout,s_rb_tran)
- ls_s_rt = Message.PowerObjectParm
- //---处理设置
- ls_dwname = ls_window+"|"+ls_object
- IF ls_s_rt.flag = 1 THEN //要保存修改 //保存个性化方案
- ls_ds.SetFullState( ls_s_rt.b_changes )
- // ls_mdfstr = ""
- FOR i = 1 To ls_ds.RowCount()
- ll_showflag = ls_ds.Object.cshow_flag[i]
- // ls_mdfstr_single = "|Text="+ls_ds.Object.ctitle[i]+'~tEVent='+ls_ds.Object.cname[i]+'~tVisible='+String(ls_ds.Object.cshow_flag[i])
- ls_mdfstr_single = "|Text="+ls_ds.Object.ctitle[i]+'~tEVent='+ls_ds.Object.cname[i]+'~tVisible='
-
- ll_pos = pos(ls_mdfstr, ls_mdfstr_single)
- if ll_pos > 0 then
- ls_mdfstr = replace(ls_mdfstr, ll_pos + len(ls_mdfstr_single), 1, string(ll_showflag))
- else
- ls_mdfstr = ls_mdfstr+ ls_mdfstr_single+string(ll_showflag)
- end if
- // ls_mdfstr = ls_mdfstr+ "|Text="+ls_ds.Object.ctitle[i]+'~tEVent='+ls_ds.Object.cname[i]+'~tVisible='+String(ls_ds.Object.cshow_flag[i])
- NEXT
-
- UPDATE sys_user_dwnSyntax
- SET dwnSyntax_filter = :ls_mdfstr
- WHERE empid = 0
- And dwname = :ls_dwname;
- IF sqlca.SQLCode = 0 THEN
- IF sqlca.SQLNRows = 0 THEN
- INSERT INTO sys_user_dwnSyntax
- (empid, dwname, dwnSyntax_filter)
- VALUES
- (0, :ls_dwname, :ls_mdfstr);
- IF sqlca.SQLCode <> 0 THEN
- ROLLBACK;
- ELSE
- COMMIT;
- END IF
- else
- commit;
- END IF
- ELSE
- ROLLBACK;
- END IF
- END IF
- Destroy ls_ds
- end subroutine
- on m_dfc_control_popupmenu_item.create
- m_dfc_control_popupmenu_item=this
- call super::create
- this.menutextcolor = 134217735
- this.menubackcolor = 134217732
- this.menuhighlightcolor = 134217741
- this.textsize = 8
- this.weight = 400
- this.facename = "Tahoma"
- this.titlebackcolor = 134217730
- this.bitmapbackcolor = 12632256
- this.menubitmaps = true
- this.titlegradient = true
- this.toolbartextcolor = 134217746
- this.toolbarbackcolor = 67108864
- this.toolbarhighlightcolor = 134217741
- this.toolbargradient = true
- this.bitmapgradient = true
- this.m_temp=create m_temp
- this.Item[UpperBound(this.Item)+1]=this.m_temp
- end on
- on m_dfc_control_popupmenu_item.destroy
- call super::destroy
- destroy(this.m_temp)
- end on
- type m_temp from menu within m_dfc_control_popupmenu_item
- end type
- on m_temp.create
- call super::create
- this.text = "Temp"
- this.menutextcolor = 134217735
- this.menubackcolor = 134217732
- this.menuhighlightcolor = 134217741
- this.textsize = 8
- this.weight = 400
- this.facename = "Tahoma"
- this.titlebackcolor = 134217730
- this.bitmapbackcolor = 12632256
- this.menubitmaps = true
- this.titlegradient = true
- this.toolbartextcolor = 134217746
- this.toolbarbackcolor = 67108864
- this.toolbarhighlightcolor = 134217741
- this.toolbargradient = true
- this.bitmapgradient = true
- end on
- on m_temp.destroy
- call super::destroy
- end on
- event clicked;//====================================================================
- // 事件(Event): m_temp::clicked()
- //--------------------------------------------------------------------
- // 描述(Description): 菜单条触发时
- //--------------------------------------------------------------------
- // 参数(Arguments): (None)
- //--------------------------------------------------------------------
- // 返回(Returns): (None)
- //--------------------------------------------------------------------
- // 作者: 董伟勇 日期: 2003.05.15
- //--------------------------------------------------------------------
- // 修改历史:
- //
- //--------------------------------------------------------------------
- // 1998-2003 上海亿用软件有限公司 | DongSoft Team
- //====================================================================
- IF UpperBound(Item) = 0 THEN
- String dsEventName
- string dsMenuText
- u_Dfc_Base_Func duFunc
-
- dsMenuText = duFunc.uf_GetKeyValue(Tag, "Text")
- dsEventName = duFunc.uf_GetKeyValue(Tag, "Event")
- IF dsEventName <> "" THEN
- IF dsEventName = 'SetMenu' and sys_power_issuper THEN
- Long ll_pos
- String ls_menustr
- ll_pos = Pos(Tag, "MenuStr=")
- ls_menustr = Mid(Tag, ll_pos + 8)
- //messagebox('',ls_menustr)
- wf_setlayout(ls_menustr)
- ELSE
- File_Way = dsMenuText
- ParentWindow.TriggerEvent(dsEventName)
- END IF
- // ParentWindow.TriggerEvent(dsEventName)
- // 如果有效
- // If IsValid(igoObject) Then
- // igoObject.TriggerEvent(dsEventName)
- // Else
- // ParentWindow.TriggerEvent(dsEventName)
- // End If
- END IF
- END IF
- end event
|