?? mainmenu.mpr
字號:
* *********************************************************
* *
* * 11/17/04 MAINMENU.MPR 17:17:02
* *
* *********************************************************
* *
* * 華亭
* *
* * 版權所有 (C) 2004 北京建工
* * 北京海淀區
* * 北京, 北京 100000
* * 中國
* *
* * 說明:
* * 此程序由 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[4]
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]="信息管理a"
a_menupops[2]="日常操作d"
a_menupops[3]="新菜單項"
a_menupops[4]="系統管理m"
ENDIF
* *********************************************************
* *
* * 菜單定義
* *
* *********************************************************
*
DEFINE MENU (m.cMenuName) IN (m.oFormRef.Name) BAR
DEFINE PAD _1dq111n8t OF (m.cMenuName) PROMPT "信息管理(\<A)" COLOR SCHEME 3 ;
KEY ALT+A, ""
DEFINE PAD _1dq111n8u OF (m.cMenuName) PROMPT "日常操作(\<D)" COLOR SCHEME 3 ;
KEY ALT+D, ""
DEFINE PAD _1dq111n8v OF (m.cMenuName) PROMPT "信息查詢(\<S)" COLOR SCHEME 3 ;
KEY ALT+S, ""
DEFINE PAD _1dq111n8w OF (m.cMenuName) PROMPT "系統管理(\<M)" COLOR SCHEME 3 ;
KEY ALT+M, ""
ON PAD _1dq111n8t OF (m.cMenuName) ACTIVATE POPUP (a_menupops[1])
ON PAD _1dq111n8u OF (m.cMenuName) ACTIVATE POPUP (a_menupops[2])
ON PAD _1dq111n8v OF (m.cMenuName) ACTIVATE POPUP (a_menupops[3])
ON PAD _1dq111n8w OF (m.cMenuName) ACTIVATE POPUP (a_menupops[4])
DEFINE POPUP (a_menupops[1]) MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF (a_menupops[1]) PROMPT "商品信息管理(\<P)"
ON SELECTION BAR 1 OF (a_menupops[1]) do form ProAdmin
DEFINE POPUP (a_menupops[2]) MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF (a_menupops[2]) PROMPT "商品進貨操作(\<I)"
DEFINE BAR 2 OF (a_menupops[2]) PROMPT "\-"
DEFINE BAR 3 OF (a_menupops[2]) PROMPT "商品出貨操作(\<O)"
ON SELECTION BAR 1 OF (a_menupops[2]) DO FORM InAct
ON SELECTION BAR 3 OF (a_menupops[2]) DO FORM OutAct
DEFINE POPUP (a_menupops[3]) MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF (a_menupops[3]) PROMPT "進貨信息查詢(\<I)"
DEFINE BAR 2 OF (a_menupops[3]) PROMPT "\-"
DEFINE BAR 3 OF (a_menupops[3]) PROMPT "出貨信息查詢(\<O)"
DEFINE BAR 4 OF (a_menupops[3]) PROMPT "\-"
DEFINE BAR 5 OF (a_menupops[3]) PROMPT "庫存信息查詢(\<S)"
ON SELECTION BAR 1 OF (a_menupops[3]) DO FORM InSearch
ON SELECTION BAR 3 OF (a_menupops[3]) DO FORM OutSearch
ON SELECTION BAR 5 OF (a_menupops[3]) DO FORM StoreSearch
DEFINE POPUP (a_menupops[4]) MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF (a_menupops[4]) PROMPT "修改密碼(\<M)"
DEFINE BAR 2 OF (a_menupops[4]) PROMPT "\-"
DEFINE BAR 3 OF (a_menupops[4]) PROMPT "關于系統(\<A)"
DEFINE BAR 4 OF (a_menupops[4]) PROMPT "\-"
DEFINE BAR 5 OF (a_menupops[4]) PROMPT "退出系統(\<E)"
ON SELECTION BAR 1 OF (a_menupops[4]) DO FORM SetPass
ON SELECTION BAR 3 OF (a_menupops[4]) DO About.prg
ON SELECTION BAR 5 OF (a_menupops[4]) 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 + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -