📄 showmenuitem.java
字号:
package item;
import javax.microedition.lcdui.*;
import rms.*;
/**
* 用于显示菜品列表的控件
* @author hong
*
*/
public class ShowMenuItem extends GridItem {
private Menu aMenu;
public ShowMenuItem(String title,int itemWidth,int itemHeight) {
super(title,itemWidth,itemHeight,100,20,20);
}
protected void drawBottom(Graphics g) {
if (cur_content[curX][curY]!=null){
aMenu=(Menu)(cur_content[curX][curY]);
g.drawString("单价:"+aMenu.getPrice(),2,rows*dy+2,20);
g.drawString("单位:"+aMenu.getUnit(),80,rows*dy+2,20);
}
g.drawString((curPage+1)+"/"+pages,140,rows*dy+2,20);
}
protected void drawContent(Graphics g, int x, int y) {
aMenu=(Menu)(cur_content[x][y]);
if (aMenu!=null)
g.drawString(aMenu.getMenuId()+ "."+ aMenu.getMenuName(), dx * x + 3, dy * y
+ 1, 20);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -