123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299 |
- $PBExportHeader$m_dfc_control_popupmenu.srm
- $PBExportComments$超级菜单
- forward
- global type m_dfc_control_popupmenu from menu
- end type
- type m_commonpopup from menu within m_dfc_control_popupmenu
- end type
- global type m_dfc_control_popupmenu from menu
- m_commonpopup m_commonpopup
- end type
- end forward
- global type m_dfc_control_popupmenu from menu
- m_commonpopup m_commonpopup
- end type
- global m_dfc_control_popupmenu m_dfc_control_popupmenu
- type variables
- end variables
- forward prototypes
- public subroutine mf_buildline ()
- public subroutine mf_setchecked (string psmenuname, boolean pbchecked)
- public subroutine mf_popmenu ()
- public subroutine mf_buildmenu (any pgoobject, string psmenulist)
- private subroutine mf_builditem (any pgoobject, string psmenutext, string pstag)
- end prototypes
- public subroutine mf_buildline ();//====================================================================
- // 过程(Subroutine): m_dfc_control_popupmenu::mf_buildline()
- //--------------------------------------------------------------------
- // 描述(Description):
- //--------------------------------------------------------------------
- // 参数(Arguments): (None)
- //--------------------------------------------------------------------
- // 返回(Returns): (None)
- //--------------------------------------------------------------------
- // 作者: 董伟勇 日期: 2003.05.15
- //--------------------------------------------------------------------
- // 修改历史:
- //
- //--------------------------------------------------------------------
- // 1998-2003 上海亿用软件有限公司 | DongSoft Team
- //====================================================================
- integer diPos
- String dsItemText
- diPos = upperbound(m_commonpopup.item)+1 // can only append now
- m_dfc_control_popupmenu_Item dm
- dm=create m_dfc_control_popupmenu_Item
- dsItemText = "OK"
- dm.item[1].Enabled = True
- m_commonpopup.item[diPos] = dm.item[1] //must be item[1], or you'll find a funny result
- m_commonpopup.item[diPos].text = "-"
- m_commonpopup.item[diPos].tag = "-"
- end subroutine
- public subroutine mf_setchecked (string psmenuname, boolean pbchecked);//====================================================================
- // 过程(Subroutine): m_dfc_control_popupmenu::mf_setchecked()
- //--------------------------------------------------------------------
- // 描述(Description): 选择或者不选择指定菜单名称
- //--------------------------------------------------------------------
- // 参数(Arguments):
- // string psmenuname 菜单名称
- // boolean pbchecked 是否选择
- //--------------------------------------------------------------------
- // 返回(Returns): (None)
- //--------------------------------------------------------------------
- // 作者: 董伟勇 日期: 2003.05.15
- //--------------------------------------------------------------------
- // 修改历史:
- //
- //--------------------------------------------------------------------
- // 1998-2003 上海亿用软件有限公司 | DongSoft Team
- //====================================================================
- Integer diPos
- For diPos = 1 To UpperBound(m_commonpopup.Item)
- If Trim(Upper(m_commonpopup.item[diPos].Text)) = Trim(Upper(psMenuName)) Then
- m_commonpopup.item[diPos].Checked = pbChecked
- End If
- Next
- end subroutine
- public subroutine mf_popmenu ();//====================================================================
- // 过程(Subroutine): m_dfc_control_popupmenu::mf_popmenu()
- //--------------------------------------------------------------------
- // 描述(Description):
- //--------------------------------------------------------------------
- // 参数(Arguments): (None)
- //--------------------------------------------------------------------
- // 返回(Returns): (None)
- //--------------------------------------------------------------------
- // 作者: 董伟勇 日期: 2003.05.15
- //--------------------------------------------------------------------
- // 修改历史:
- //
- //--------------------------------------------------------------------
- // 1998-2003 上海亿用软件有限公司 | DongSoft Team
- //====================================================================
- m_CommonPopup.PopMenu(ParentWindow.PointerX(), ParentWindow.PointerY())
- end subroutine
- public subroutine mf_buildmenu (any pgoobject, string psmenulist);//====================================================================
- // 过程(Subroutine): m_dfc_control_popupmenu::mf_buildmenu()
- //--------------------------------------------------------------------
- // 描述(Description): 建立菜单
- //--------------------------------------------------------------------
- // 参数(Arguments):
- // string psmenulist 菜单描述
- //--------------------------------------------------------------------
- // 返回(Returns): (None)
- //--------------------------------------------------------------------
- // 作者: 董伟勇 日期: 2003.05.15
- //--------------------------------------------------------------------
- // 修改历史:
- //
- //--------------------------------------------------------------------
- // 1998-2003 上海亿用软件有限公司 | DongSoft Team
- //====================================================================
- u_Dfc_Base_Func duFunc
- String dsList[], dsList_save[]
- String dsMenuText, dsMenuText_save
- String dsMenuEvent,dsMenuEvent_save
- String dsNote // 说明
- String ls_visible
- Integer i, j
- String ls_tolmenu
- ls_tolmenu = psMenuList
- Int li_line
- //lhd 20150314 实现菜单自由设置
- //String ls_window, ls_object, ls_title
- //ls_window = ParentWindow.ClassName()
- //ls_object = ClassName(pgoObject)
- //ls_title = "Window="+ls_window+"~tObject=" + ls_object
- //
- //String ls_mdfstr
- //String ls_dwname
- //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)
- //
- //处理
- IF Left(psMenuList,1) = "|" THEN
- psMenuList = Mid(psMenuList, 2, Len(psMenuList) - 1)
- END IF
- duFunc.uf_Split(psMenuList, "|", dsList)
- FOR i = 1 To UpperBound(dsList)
- 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
-
- IF ls_visible = "1" THEN
- mf_BuildItem(pgoObject, dsMenuText, dsList[i])
- END IF
- NEXT
- //IF sys_power_issuper THEN
- // dsMenuText = '-'
- // mf_BuildItem(pgoObject, dsMenuText, '-')
- // dsMenuText = '菜单设置~tEvent=SetMenu~tMenuStr='+ls_tolmenu+"|"+ls_title
- // mf_BuildItem(pgoObject, '菜单设置', dsMenuText)
- //END IF
- end subroutine
- private subroutine mf_builditem (any pgoobject, string psmenutext, string pstag);//====================================================================
- // 过程(Subroutine): m_dfc_control_popupmenu::mf_builditem()
- //--------------------------------------------------------------------
- // 描述(Description): 内部函数: 增加菜单条
- //--------------------------------------------------------------------
- // 参数(Arguments):
- // string psmenutext 菜单名称
- // string pstag Tag
- //--------------------------------------------------------------------
- // 返回(Returns): (None)
- //--------------------------------------------------------------------
- // 作者: 董伟勇 日期: 2003.05.15
- //--------------------------------------------------------------------
- // 修改历史:
- //
- //--------------------------------------------------------------------
- // 1998-2003 上海亿用软件有限公司 | DongSoft Team
- //====================================================================
- u_Dfc_Base_Func duFunc
- Integer diPos
- diPos = upperbound(m_commonpopup.item)+1 // can only append now
- m_dfc_control_popupmenu_Item dm
- dm=create m_dfc_control_popupmenu_Item
- dm.igoObject = pgoObject
- dm.item[1].Enabled = True
- If Upper(duFunc.uf_GetKeyValue(psTag, "Checked")) = "TRUE" Then
- dm.item[1].Checked = True
- End If
- m_commonpopup.item[diPos] = dm.item[1]
- m_commonpopup.item[diPos].text = psMenuText
- m_commonpopup.item[diPos].tag = psTag
- end subroutine
- on m_dfc_control_popupmenu.create
- m_dfc_control_popupmenu=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_commonpopup=create m_commonpopup
- this.Item[UpperBound(this.Item)+1]=this.m_commonpopup
- end on
- on m_dfc_control_popupmenu.destroy
- call super::destroy
- destroy(this.m_commonpopup)
- end on
- type m_commonpopup from menu within m_dfc_control_popupmenu
- end type
- on m_commonpopup.create
- call super::create
- this.text = "CommonPopup"
- 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_commonpopup.destroy
- call super::destroy
- end on
|