⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qmenuitem.java

📁 j2me 高级UI
💻 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 QMenuItem 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 QMenuItem(String label) {
		super(0, QMenuBar.frame.frm_Height, 75, 20);
		this.label = label;
	}

	public void paint(Graphics g) {
		g.setFont(font);
		g.setColor(fr, fg, fb);
		int offx = 0;
		if (level != 0) {
			if (root == 0) {
				offx = level * width;
			} else if (root == 1) {
				offx = -level * width;
			}
		}
		int str_offy = 10 - font.getHeight() / 2;
		g.drawImage(UIManager.menu_back, x+ offx, y ,  Graphics.LEFT | Graphics.TOP);
		g.drawString(getLabel(), x + offx + 2, y  + str_offy, Graphics.LEFT| Graphics.TOP);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -