📄 qradiobuttonmenuitem.java
字号:
/**
* 作者:cat 戚永城
* 时间:2008-3-1
* QQ:415898635
* E-Mail: 415898635@qq.com
* qyc_12345@163.com
*
* */
package org.qui.menu;
import javax.microedition.lcdui.Graphics;
import org.qui.conmponent.QMenuBar;
import org.qui.container.QFrame;
import org.qui.manager.QAbstructButton;
import org.qui.manager.UIManager;
public class QRadioButtonMenuItem extends QAbstructButton {
// private Vector item = new Vector();// 0 menuItem 1 radio 2 check 3 menu
// private Vector style = new Vector();// 1表示拥有下级菜单
// private Vector open = new Vector();// 1表示打开
public int root = 0;// 0表示从左菜单衍生
public QRadioButtonMenuItem(String label) {
super(0, QMenuBar.frame.frm_Height, 75, 20);
this.label = label;
}
public void paint(Graphics g) {
int offx = 0;
if (level != 0) {
if (root == 0) {
offx = level * width;
} else if (root == 1) {
offx = -level * width;
}
}
//state
if(selected){
g.drawImage(UIManager.radio_normal_selected, x + offx+2, y +4,20);
}else{
g.drawImage(UIManager.radio_normal, x + offx+2, y +4,20);
}
//label
g.setFont(font);
g.setColor(fr, fg, fb);
int str_offy = 10 - font.getHeight() / 2;
g.drawImage(UIManager.menu_back, x+ offx, y , Graphics.LEFT | Graphics.TOP);
g.drawString(getLabel(), x + offx + 16, y + str_offy, Graphics.LEFT| Graphics.TOP);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -