|
文本编辑器源文件(java语言)(7) g.drawRect(10,(index-1)*fh+6,w-20,fh); // g.setColor(Color.lightGray); // g.drawRect(0,0,w,h); draw_uplines(g,1,1,w-1,h-1); g.setColor(Color.black); g.drawString("Cut",13,fh); g.drawString("Copy",13,2*fh); g.drawString("Paste",13,3*fh); g.drawString("Delete",13,4*fh); }
public boolean mouseMove(Event evt,int x,int y) { for(int i=1;i<=4;i++) if((y>(i-1)*fh)&&(y<(i*fh))) { index= i; repaint(); } return super.mouseMove(evt,x,y); }
public boolean mouseDown(Event evt,int x,int y) { if(y>0&&y<fh) { fr.current_t.dels(); fr.eitem.enable(false); fr.eitem1.enable(false); fr.eitem3.enable(false); fr.eitem2.enable(true);
|