mainmenu.mpr

来自「人力资源Visual FoxPro 6.0」· MPR 代码 · 共 274 行

MPR
274
字号
*       *********************************************************
*       *                                                         
*       * 12/08/05            MAINMENU.MPR              18:33:03  
*       *                                                         
*       *********************************************************
*       *                                                         
*       * coolgou@smth                                            
*       *                                                         
*       * 版权所有 (C) 2005 tsinghua                             
*       * 地址                                                    
*       * Beijing, BJ  邮编                                       
*       * CN                                                
*       *                                                         
*       * 说明:                                            
*       * 此程序由 GENMENU 自动生成。    
*       *                                                         
*       *********************************************************

* To attach this menu to your Top-Level form, 
* call it from the Init event of the form:

* Syntax: DO <mprname> WITH <oFormRef> [,<cMenuname>|<lRename>][<lUniquePopups>]

*	oFormRef - form object reference (THIS)
*	cMenuname - name for menu (this is required for Append menus - see below)
*	lRename - renames Name property of your form
*	lUniquePopups - determines whether to generate unique ids for popup names
			
* 	example:

*	PROCEDURE Init
*		DO mymenu.mpr WITH THIS,.T.
*	ENDPROC

* Use the optional 2nd parameter if you plan on running multiple instances
* of your Top-Level form. The preferred method is to create an empty string
* variable and pass it by reference so you can receive the form name after
* the MPR file is run. You can later use this reference to destroy the menu.

*	PROCEDURE Init
*		LOCAL cGetMenuName
*		cGetMenuName = ""
*		DO mymenu.mpr WITH THIS, m.cGetMenuName
*	ENDPROC

* The logical lRename parameter will change the name property of your 
* form to the same name given the menu and may cause conflicts in your 
* code if you directly reference the form by name.

* You will also need to remove the menu when the form is destroyed so that it does 
* not remain in memory unless you wish to reactivate it later in a new form.

* If you passed the optional lRename parameter as .T. as in the above example, 
* you can easily remove the menu in the form's Destroy event as shown below.
* This strategy is ideal when using multiple instances of Top-Level forms.

*	example:

*	PROCEDURE Destroy
*		RELEASE MENU (THIS.Name) EXTENDED
*	ENDPROC

* Using Append/Before/After location options:

*   You might want to append a menu to an existing Top-Level form by setting 
*   the Location option in the General Options dialog. In order to do this, you 
*   must pass the name of the menu in which to attach the new one. The second
*   parameter is required here. If you originally created the menu with the lRename 
*   parameter = .T., then you can update the menu with code similar to the following:

*	example:

*	DO mymenu2.mpr WITH THISFORM,THISFORM.name
*
* Using lUniquePopups:

*   If you are running this menu multiple times in your application, such as in multiple 
*   instances of the same top-level form, you should pass .T. to the lUniquePopups 
*   parameter so that unique popup names are generated to avoid possible conflicts.

*	example:

*	PROCEDURE Init
*		DO mymenu.mpr WITH THIS,.T.,.T.
*	ENDPROC
*
* Note: Parm4-Parm9 are not reserved and freely available for use with your menu code.
*

LPARAMETERS oFormRef, getMenuName, lUniquePopups, parm4, parm5, parm6, parm7, parm8, parm9
LOCAL cMenuName, nTotPops, a_menupops, cTypeParm2, cSaveFormName
IF TYPE("m.oFormRef") # "O" OR ;
  LOWER(m.oFormRef.BaseClass) # 'form' OR ;
  m.oFormRef.ShowWindow # 2
	MESSAGEBOX([只能从顶层表单调用该菜单。请确认您表单的 ShowWindow 属性已设为 2。阅读此菜单 MPR 文件的头部分,可以获得详细信息。])
	RETURN
ENDIF
m.cTypeParm2 = TYPE("m.getMenuName")
m.cMenuName = SYS(2015)
m.cSaveFormName = m.oFormRef.Name
IF m.cTypeParm2 = "C" OR (m.cTypeParm2 = "L" AND m.getMenuName)
	m.oFormRef.Name = m.cMenuName
ENDIF
IF m.cTypeParm2 = "C" AND !EMPTY(m.getMenuName)
	m.cMenuName = m.getMenuName
ENDIF
DIMENSION a_menupops[5]
IF TYPE("m.lUniquePopups")="L" AND m.lUniquePopups
	FOR nTotPops = 1 TO ALEN(a_menupops)
		a_menupops[m.nTotPops]= SYS(2015)
	ENDFOR
ELSE
	a_menupops[1]="基础数据b"
	a_menupops[2]="数据管理a"
	a_menupops[3]="数据查询s"
	a_menupops[4]="数据输出o"
	a_menupops[5]="系统管理d"
ENDIF


*       *********************************************************
*       *                                                         
*       *                         菜单定义                        
*       *                                                         
*       *********************************************************
*

DEFINE MENU (m.cMenuName) IN (m.oFormRef.Name) BAR

DEFINE PAD _1oh13repu OF (m.cMenuName) PROMPT "基础数据(\<B)" COLOR SCHEME 3 ;
	KEY ALT+B, ""
DEFINE PAD _1oh13repv OF (m.cMenuName) PROMPT "数据管理(\<A)" COLOR SCHEME 3 ;
	KEY ALT+A, ""
DEFINE PAD _1oh13repw OF (m.cMenuName) PROMPT "数据查询(\<S)" COLOR SCHEME 3 ;
	KEY ALT+S, ""
DEFINE PAD _1oh13repx OF (m.cMenuName) PROMPT "数据输出(\<O)" COLOR SCHEME 3 ;
	KEY ALT+O, ""
DEFINE PAD _1oh13repy OF (m.cMenuName) PROMPT "系统管理(\<D)" COLOR SCHEME 3 ;
	KEY ALT+D, ""
ON PAD _1oh13repu OF (m.cMenuName) ACTIVATE POPUP (a_menupops[1])
ON PAD _1oh13repv OF (m.cMenuName) ACTIVATE POPUP (a_menupops[2])
ON PAD _1oh13repw OF (m.cMenuName) ACTIVATE POPUP (a_menupops[3])
ON PAD _1oh13repx OF (m.cMenuName) ACTIVATE POPUP (a_menupops[4])
ON PAD _1oh13repy OF (m.cMenuName) ACTIVATE POPUP (a_menupops[5])

DEFINE POPUP (a_menupops[1]) MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF (a_menupops[1]) PROMPT "部门设置(\<D)" ;
	SKIP FOR GotAuth[1] = .F. .AND. cUser != "admin"
DEFINE BAR 2 OF (a_menupops[1]) PROMPT "\-"
DEFINE BAR 3 OF (a_menupops[1]) PROMPT "学历设置(\<A)" ;
	SKIP FOR GotAuth[1] = .F. .AND. cUser != "admin"
DEFINE BAR 4 OF (a_menupops[1]) PROMPT "职务设置(\<U)" ;
	SKIP FOR GotAuth[1] = .F. .AND. cUser != "admin"
DEFINE BAR 5 OF (a_menupops[1]) PROMPT "民族设置(\<P)" ;
	SKIP FOR GotAuth[1] = .F. .AND. cUser != "admin"
DEFINE BAR 6 OF (a_menupops[1]) PROMPT "\-"
DEFINE BAR 7 OF (a_menupops[1]) PROMPT "电脑水平(\<C)" ;
	SKIP FOR GotAuth[1] = .F. .AND. cUser != "admin"
DEFINE BAR 8 OF (a_menupops[1]) PROMPT "外语水平(\<F)" ;
	SKIP FOR GotAuth[1] = .F. .AND. cUser != "admin"
DEFINE BAR 9 OF (a_menupops[1]) PROMPT "政治面貌(\<O)" ;
	SKIP FOR GotAuth[1] = .F. .AND. cUser != "admin"
DEFINE BAR 10 OF (a_menupops[1]) PROMPT "\-"
DEFINE BAR 11 OF (a_menupops[1]) PROMPT "惩罚类别(\<N)" ;
	SKIP FOR GotAuth[1] = .F. .AND. cUser != "admin"
DEFINE BAR 12 OF (a_menupops[1]) PROMPT "奖励类别(\<E)" ;
	SKIP FOR GotAuth[1] = .F. .AND. cUser != "admin"
DEFINE BAR 13 OF (a_menupops[1]) PROMPT "考评类别(\<R)" ;
	SKIP FOR GotAuth[1] = .F. .AND. cUser != "admin"
ON SELECTION BAR 1 OF (a_menupops[1]) DO Form DepSet
ON SELECTION BAR 3 OF (a_menupops[1]) DO Form BasicInfo With 1
ON SELECTION BAR 4 OF (a_menupops[1]) DO Form BasicInfo With 2
ON SELECTION BAR 5 OF (a_menupops[1]) DO Form BasicInfo With 3
ON SELECTION BAR 7 OF (a_menupops[1]) DO Form BasicInfo With 4
ON SELECTION BAR 8 OF (a_menupops[1]) DO Form BasicInfo With 5
ON SELECTION BAR 9 OF (a_menupops[1]) DO Form BasicInfo With 6
ON SELECTION BAR 11 OF (a_menupops[1]) DO Form BasicInfo With 7
ON SELECTION BAR 12 OF (a_menupops[1]) DO Form BasicInfo With 8
ON SELECTION BAR 13 OF (a_menupops[1]) DO Form BasicInfo With 9

DEFINE POPUP (a_menupops[2]) MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF (a_menupops[2]) PROMPT "员工档案管理(\<P)" ;
	SKIP FOR GotAuth[2] = .F. .AND. cUser != "admin"
DEFINE BAR 2 OF (a_menupops[2]) PROMPT "\-"
DEFINE BAR 3 OF (a_menupops[2]) PROMPT "员工奖励管理(\<E)" ;
	SKIP FOR GotAuth[3] = .F. .AND. cUser != "admin"
DEFINE BAR 4 OF (a_menupops[2]) PROMPT "员工惩罚管理(\<U)" ;
	SKIP FOR GotAuth[4] = .F. .AND. cUser != "admin"
DEFINE BAR 5 OF (a_menupops[2]) PROMPT "\-"
DEFINE BAR 6 OF (a_menupops[2]) PROMPT "培训项目管理(\<O)" ;
	SKIP FOR GotAuth[17] = .F. .AND. cUser != "admin"
DEFINE BAR 7 OF (a_menupops[2]) PROMPT "员工培训管理(\<T)" ;
	SKIP FOR GotAuth[5] = .F. .AND. cUser != "admin"
DEFINE BAR 8 OF (a_menupops[2]) PROMPT "\-"
DEFINE BAR 9 OF (a_menupops[2]) PROMPT "员工考评管理(\<R)" ;
	SKIP FOR GotAuth[7] = .F. .AND. cUser != "admin"
DEFINE BAR 10 OF (a_menupops[2]) PROMPT "员工调动管理(\<D)" ;
	SKIP FOR GotAuth[6] = .F. .AND. cUser != "admin"
ON SELECTION BAR 1 OF (a_menupops[2]) DO FORM Personnal
ON SELECTION BAR 3 OF (a_menupops[2]) DO FORM EncLog
ON SELECTION BAR 4 OF (a_menupops[2]) DO FORM PunishLog
ON SELECTION BAR 6 OF (a_menupops[2]) DO FORM TrainPrj
ON SELECTION BAR 7 OF (a_menupops[2]) DO FORM TrainLog
ON SELECTION BAR 9 OF (a_menupops[2]) DO FORM ReviewLog
ON SELECTION BAR 10 OF (a_menupops[2]) DO FORM RedeployLog

DEFINE POPUP (a_menupops[3]) MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF (a_menupops[3]) PROMPT "员工档案查询(\<P)" ;
	SKIP FOR GotAuth[15] = .F. .AND. cUser != "admin"
DEFINE BAR 2 OF (a_menupops[3]) PROMPT "\-"
DEFINE BAR 3 OF (a_menupops[3]) PROMPT "奖励记录查询(\<E)" ;
	SKIP FOR GotAuth[10] = .F. .AND. cUser != "admin"
DEFINE BAR 4 OF (a_menupops[3]) PROMPT "惩罚记录查询(\<U)" ;
	SKIP FOR GotAuth[11] = .F. .AND. cUser != "admin"
DEFINE BAR 5 OF (a_menupops[3]) PROMPT "\-"
DEFINE BAR 6 OF (a_menupops[3]) PROMPT "培训记录查询(\<T)" ;
	SKIP FOR GotAuth[12] = .F. .AND. cUser != "admin"
DEFINE BAR 7 OF (a_menupops[3]) PROMPT "考评记录查询(\<R)" ;
	SKIP FOR GotAuth[13] = .F. .AND. cUser != "admin"
DEFINE BAR 8 OF (a_menupops[3]) PROMPT "调动记录查询(\<D)" ;
	SKIP FOR GotAuth[14] = .F. .AND. cUser != "admin"
ON SELECTION BAR 1 OF (a_menupops[3]) DO Form PerView
ON SELECTION BAR 3 OF (a_menupops[3]) DO Form EncView
ON SELECTION BAR 4 OF (a_menupops[3]) DO Form PunView
ON SELECTION BAR 6 OF (a_menupops[3]) DO Form TrainView
ON SELECTION BAR 7 OF (a_menupops[3]) DO Form ReviewView
ON SELECTION BAR 8 OF (a_menupops[3]) DO Form RedView

DEFINE POPUP (a_menupops[4]) MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF (a_menupops[4]) PROMPT "员工档案输出(\<P)" ;
	SKIP FOR GotAuth[15] = .F. .AND. cUser != "admin"
DEFINE BAR 2 OF (a_menupops[4]) PROMPT "\-"
DEFINE BAR 3 OF (a_menupops[4]) PROMPT "奖励记录输出(\<E)" ;
	SKIP FOR GotAuth[10] = .F. .AND. cUser != "admin"
DEFINE BAR 4 OF (a_menupops[4]) PROMPT "惩罚记录输出(\<U)" ;
	SKIP FOR GotAuth[11] = .F. .AND. cUser != "admin"
DEFINE BAR 5 OF (a_menupops[4]) PROMPT "\-"
DEFINE BAR 6 OF (a_menupops[4]) PROMPT "培训记录输出(\<T)" ;
	SKIP FOR GotAuth[12] = .F. .AND. cUser != "admin"
DEFINE BAR 7 OF (a_menupops[4]) PROMPT "考评记录输出(\<R)" ;
	SKIP FOR GotAuth[13] = .F. .AND. cUser != "admin"
DEFINE BAR 8 OF (a_menupops[4]) PROMPT "调动记录输出(\<D)" ;
	SKIP FOR GotAuth[14] = .F. .AND. cUser != "admin"
ON SELECTION BAR 1 OF (a_menupops[4]) REPORT FORM Personnel Preview
ON SELECTION BAR 3 OF (a_menupops[4]) REPORT FORM EncDetail Preview
ON SELECTION BAR 4 OF (a_menupops[4]) REPORT FORM PunishDetail Preview
ON SELECTION BAR 6 OF (a_menupops[4]) REPORT FORM TrainDetail Preview
ON SELECTION BAR 7 OF (a_menupops[4]) REPORT FORM ReviewDetail Preview
ON SELECTION BAR 8 OF (a_menupops[4]) REPORT FORM RedeployDetail Preview

DEFINE POPUP (a_menupops[5]) MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF (a_menupops[5]) PROMPT "修改密码(\<P)" ;
	SKIP FOR GotAuth[16] = .F. .AND. cUser != "admin"
DEFINE BAR 2 OF (a_menupops[5]) PROMPT "\-"
DEFINE BAR 3 OF (a_menupops[5]) PROMPT "用户组管理(\<G)" ;
	SKIP FOR GotAuth[8] = .F. .AND. cUser != "admin"
DEFINE BAR 4 OF (a_menupops[5]) PROMPT "用户管理(\<U)" ;
	SKIP FOR GotAuth[9] = .F. .AND. cUser != "admin"
DEFINE BAR 5 OF (a_menupops[5]) PROMPT "\-"
DEFINE BAR 6 OF (a_menupops[5]) PROMPT "关于系统(\<A)"
DEFINE BAR 7 OF (a_menupops[5]) PROMPT "退出系统(\<E)"
ON SELECTION BAR 1 OF (a_menupops[5]) DO FORM SetPass
ON SELECTION BAR 3 OF (a_menupops[5]) DO FORM UserGroup
ON SELECTION BAR 4 OF (a_menupops[5]) DO FORM UserAdmin
ON SELECTION BAR 6 OF (a_menupops[5]) DO About.prg
ON SELECTION BAR 7 OF (a_menupops[5]) Clear Events

ACTIVATE MENU (m.cMenuName) NOWAIT

IF m.cTypeParm2 = "C"
	m.getMenuName = m.cMenuName
	m.oFormRef.Name = m.cSaveFormName 
ENDIF

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?