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

📄 button.java

📁 开发框架。 一.说明: 此框架的意图是解决手机软件开发中常遇到
💻 JAVA
字号:
package org.gggeye.easymf.ui;

public class Button extends View {
	 
	/**
	 * 如果存在form,则提交数据的时候先提交Form
	 */
	HtmlForm htmlForm;
 
	public Button(String _name, String _action, HtmlForm _htmlForm){
		this.action = _action;
		this.name = _name==null?"":_name;
		this.hasFocus = true;
		this.backColor = 0xCCCFFF;
		this.fontColor = 0xFFFFFF;
		this.htmlForm = _htmlForm;
	}
	public void doPaint(Pen _point, HtmlDocument _htmlDocument) {
		 
		if (_htmlDocument.focusIndex == this.index) {
            _point.drawRects(new int[]{0xCEF,0xCEF}, left, top, width, height);
        }
		_point.save();
		_point.setColor(backColor);
		_point.fillRect(left + ViewBuilder.LEFT_SPACE, top + ViewBuilder.TOP_SPACE, 
				width - ViewBuilder.LEFT_SPACE, height-(ViewBuilder.TOP_SPACE));
		_point.setFont(font);
		_point.setColor(this.fontColor);
		int x = left + (ViewBuilder.LEFT_SPACE*2 );
		_point.drawString(name, x, top + ViewBuilder.TOP_SPACE , 20);
		_point.reset();
		
	}

}

⌨️ 快捷键说明

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