123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- $PBExportHeader$m_dfc_msg.srm
- $PBExportComments$超级菜单
- forward
- global type m_dfc_msg from menu
- end type
- type m_commonpopup from menu within m_dfc_msg
- end type
- global type m_dfc_msg from menu
- m_commonpopup m_commonpopup
- end type
- end forward
- global type m_dfc_msg from menu
- m_commonpopup m_commonpopup
- end type
- global m_dfc_msg m_dfc_msg
- 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_msg_item dm
- dm = CREATE m_dfc_msg_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[]
- String dsMenuText
- String dsEvent
- String dsNote // 说明
- Integer i
- duFunc.uf_Split(psMenuList, "|", dsList)
- For i = 1 To UpperBound(dsList)
- dsMenuText = duFunc.uf_GetKeyValue(dsList[i], "Text")
- mf_BuildItem(pgoObject, dsMenuText, dsList[i])
- Next
- 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_msg_item dm
- dm = CREATE m_dfc_msg_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_msg.create
- m_dfc_msg=this
- call super::create
- this.m_commonpopup=create m_commonpopup
- this.Item[UpperBound(this.Item)+1]=this.m_commonpopup
- end on
- on m_dfc_msg.destroy
- call super::destroy
- destroy(this.m_commonpopup)
- end on
- type m_commonpopup from menu within m_dfc_msg
- end type
- on m_commonpopup.create
- call super::create
- this.text = "CommonPopup"
- end on
- on m_commonpopup.destroy
- call super::destroy
- end on
|