button.java.svn-base

来自「开发框架。 一.说明: 此框架的意图是解决手机软件开发中常遇到」· SVN-BASE 代码 · 共 36 行

SVN-BASE
36
字号
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 + =
减小字号Ctrl + -
显示快捷键?