主题:请教:弹出式菜单的位置,怎么不能按鼠标点击时的位置来确定?
我在 MouseDown 事件里放置下列代码,但弹出的菜单起始点位置不能由FROM [b]nXCoord, nYCoord[/b]确定,请高手指点迷津?
LPARAMETERS nButton, nShift, nXCoord, nYCoord
IF nButton=2
DEFINE POPUP popExam FONT '宋体', 12 TITLE "复制粘贴菜单" FROM [b]nXCoord, nYCoord[/b]
DEFINE BAR 1 OF popExam PROMPT '复制'
ON SELECTION BAR 1 OF popExam do jtxt with x1,1
DEFINE BAR 2 OF popExam PROMPT '粘贴' SKIP FOR EMPTY(_cliptext)
ON SELECTION BAR 2 OF popExam do jtxt with x1,2
DEFINE BAR 3 OF popExam PROMPT '取消粘贴' SKIP FOR yztkg
ON SELECTION BAR 3 OF popExam do jtxt with x1,3
ACTIVATE POPUP popExam
ENDIF
***************************************************************
PROCEDURE jtxt
parameter x1,jxj
x2=x1+".seltext"
x3=x1+".value"
x4=x1+".selstart"
IF jxj=1
_cliptext=&x2
ELSE
IF jxj=2
rxbak=&x3
&x3=STUFF(&x3,&x4+1,0,_cliptext)
yztkg=.f.
ELSE
&x3=rxbak
yztkg=.t.
ENDIF
ENDIF
DEACTIVATE POPUP popExam
RELEASE POPUP popExam
ENDPROC
LPARAMETERS nButton, nShift, nXCoord, nYCoord
IF nButton=2
DEFINE POPUP popExam FONT '宋体', 12 TITLE "复制粘贴菜单" FROM [b]nXCoord, nYCoord[/b]
DEFINE BAR 1 OF popExam PROMPT '复制'
ON SELECTION BAR 1 OF popExam do jtxt with x1,1
DEFINE BAR 2 OF popExam PROMPT '粘贴' SKIP FOR EMPTY(_cliptext)
ON SELECTION BAR 2 OF popExam do jtxt with x1,2
DEFINE BAR 3 OF popExam PROMPT '取消粘贴' SKIP FOR yztkg
ON SELECTION BAR 3 OF popExam do jtxt with x1,3
ACTIVATE POPUP popExam
ENDIF
***************************************************************
PROCEDURE jtxt
parameter x1,jxj
x2=x1+".seltext"
x3=x1+".value"
x4=x1+".selstart"
IF jxj=1
_cliptext=&x2
ELSE
IF jxj=2
rxbak=&x3
&x3=STUFF(&x3,&x4+1,0,_cliptext)
yztkg=.f.
ELSE
&x3=rxbak
yztkg=.t.
ENDIF
ENDIF
DEACTIVATE POPUP popExam
RELEASE POPUP popExam
ENDPROC