请教:怎样才能实现单击鼠标右键时,在光标处弹出一个选择菜单
我在 MouseDown 事件里放置下列代码,但弹出的菜单位置不能确定,请高手指点迷津,或者有更好的办法建立弹出式菜单?LPARAMETERS nButton, nShift, nXCoord, nYCoord
IF nButton=2
DEFINE POPUP popExam FONT '宋体', 12 TITLE "复制粘贴菜单" FROM nXCoord, nYCoord
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