| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1187 人关注过本帖
标题:那位高手帮忙看下,我的菜单生成后为什么运行不了??
只看楼主 加入收藏
cxspring
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2009-9-15
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:6 
那位高手帮忙看下,我的菜单生成后为什么运行不了??

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([This menu can only be called from a Top-Level form. Ensure that your form's ShowWindow property is set to 2. Read the header section of the menu's MPR file for more details.])
    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_menupops[2]="查询功能"
    a_menupops[3]="统计功能"
    a_menupops[4]="系统管理"
ENDIF



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

DEFINE PAD _2qy10gxju OF (m.cMenuName) PROMPT "处理" COLOR SCHEME 3
DEFINE PAD _2qy10gxjv OF (m.cMenuName) PROMPT "查询功能" COLOR SCHEME 3
DEFINE PAD _2qy10gxjw OF (m.cMenuName) PROMPT "统计功能" COLOR SCHEME 3
DEFINE PAD _2qy10gxjx OF (m.cMenuName) PROMPT "系统管理" COLOR SCHEME 3
DEFINE PAD _2qy10gxjy OF (m.cMenuName) PROMPT "退出系统" COLOR SCHEME 3
ON PAD _2qy10gxju OF (m.cMenuName) ACTIVATE POPUP (a_menupops[1])
ON PAD _2qy10gxjv OF (m.cMenuName) ACTIVATE POPUP (a_menupops[2])
ON PAD _2qy10gxjw OF (m.cMenuName) ACTIVATE POPUP (a_menupops[3])
ON PAD _2qy10gxjx OF (m.cMenuName) ACTIVATE POPUP (a_menupops[4])
ON SELECTION PAD _2qy10gxjy OF (m.cMenuName) set sysmeun to default

DEFINE POPUP (a_menupops[1]) MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF (a_menupops[1]) PROMPT "数据处理"
DEFINE BAR 2 OF (a_menupops[1]) PROMPT "票据处理"
ON SELECTION BAR 1 OF (a_menupops[1]) do form 处理.scx
ON SELECTION BAR 2 OF (a_menupops[1]) do form 票据处理.scx

DEFINE POPUP (a_menupops[2]) MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF (a_menupops[2]) PROMPT "按车辆行驶证号"
DEFINE BAR 2 OF (a_menupops[2]) PROMPT "按车辆类型"
DEFINE BAR 3 OF (a_menupops[2]) PROMPT "按吨位"
ON SELECTION BAR 1 OF (a_menupops[2]) do form 按车辆行驶证号查询
ON SELECTION BAR 2 OF (a_menupops[2]) do form 按车辆类型查询
ON SELECTION BAR 3 OF (a_menupops[2]) do form 按吨位查询

DEFINE POPUP (a_menupops[3]) MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF (a_menupops[3]) PROMPT "按单位统计"
DEFINE BAR 2 OF (a_menupops[3]) PROMPT "按经营范围统计"
DEFINE BAR 3 OF (a_menupops[3]) PROMPT "按吨位统计"
ON SELECTION BAR 1 OF (a_menupops[3]) do form 单位统计
ON SELECTION BAR 2 OF (a_menupops[3]) do form 范围统计
ON SELECTION BAR 3 OF (a_menupops[3]) do form 输入吨位

DEFINE POPUP (a_menupops[4]) MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF (a_menupops[4]) PROMPT "系统维护"
DEFINE BAR 2 OF (a_menupops[4]) PROMPT "修改密码"
ON SELECTION BAR 1 OF (a_menupops[4]) do form 系统维护
ON SELECTION BAR 2 OF (a_menupops[4]) do form 修改密码

ACTIVATE MENU (m.cMenuName) NOWAIT

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


运行提示this menu can only be called from a TOP-level form,ensure than your form's showwiondow property is set to 2.read the header section of the menu's MPR file for more details.但是我已经把要添加菜单的表单的showwiondow都为2了,而且表单的int都加了do (菜单名).mpr with this ,帮忙小妹噢,论文急着交了……
搜索更多相关主题的帖子: 运行 菜单 
2009-09-16 17:11
Tiger5392
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:88
帖 子:2775
专家分:2237
注 册:2006-5-17
收藏
得分:5 
do 菜单名.mpr with this,.t.

感言:学以致用。 博客:http://www./blog/user14/65009/index.shtml email:Tiger5392@
2009-09-16 20:21
cxspring
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2009-9-15
收藏
得分:0 
试过了,也不行
2009-09-17 08:39
Tiger5392
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:88
帖 子:2775
专家分:2237
注 册:2006-5-17
收藏
得分:5 
你的菜单需要重新生成的

感言:学以致用。 博客:http://www./blog/user14/65009/index.shtml email:Tiger5392@
2009-09-17 09:33
cxspring
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2009-9-15
收藏
得分:0 
改过、生成,试过好多次了,不明确下面这句是什么意思:ON SELECTION PAD _2qy10gxjy OF (m.cMenuName) set sysmeun to default
2009-09-17 10:24
茵梦湖
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:31
帖 子:545
专家分:2180
注 册:2009-4-25
收藏
得分:10 
以下是引用cxspring在2009-9-17 10:24的发言:

改过、生成,试过好多次了,不明确下面这句是什么意思:ON SELECTION PAD _2qy10gxjy OF (m.cMenuName) set sysmeun to default
 
这句代码的意思似乎是: 当选定 菜单中的"退出系统"时, 将vfp菜单 设为默认状态~~代码中有个单词错了~~~

ON SELECTION PAD _2qy10gxjy OF (m.cMenuName) set sysmenu to default




[ 本帖最后由 茵梦湖 于 2009-9-17 14:22 编辑 ]
2009-09-17 14:18
cuituo
Rank: 2
等 级:论坛游民
威 望:2
帖 子:28
专家分:22
注 册:2008-6-21
收藏
得分:0 
这个问题也困惑了我半天,解决办法是  生产菜单后把菜单从项目中移去 不是删除,注意,就ok了。
2010-08-12 08:53
快速回复:那位高手帮忙看下,我的菜单生成后为什么运行不了??
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.025073 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved