亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? button.java

?? 源碼為Eclipse開源開發(fā)平臺(tái)桌面開發(fā)工具SWT的源代碼,
?? JAVA
?? 第 1 頁 / 共 2 頁
字號(hào):
/******************************************************************************* * Copyright (c) 2000, 2003 IBM Corporation and others. * All rights reserved. This program and the accompanying materials  * are made available under the terms of the Common Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/cpl-v10.html *  * Contributors: *     IBM Corporation - initial API and implementation *******************************************************************************/package org.eclipse.swt.widgets;import org.eclipse.swt.internal.win32.*;import org.eclipse.swt.*;import org.eclipse.swt.graphics.*;import org.eclipse.swt.events.*;/** * Instances of this class represent a selectable user interface object that * issues notification when pressed and released.  * <dl> * <dt><b>Styles:</b></dt> * <dd>ARROW, CHECK, PUSH, RADIO, TOGGLE, FLAT</dd> * <dd>UP, DOWN, LEFT, RIGHT, CENTER</dd> * <dt><b>Events:</b></dt> * <dd>Selection</dd> * </dl> * <p> * Note: Only one of the styles ARROW, CHECK, PUSH, RADIO, and TOGGLE  * may be specified. * </p><p> * Note: Only one of the styles LEFT, RIGHT, and CENTER may be specified. * </p><p> * Note: Only one of the styles UP, DOWN, LEFT, and RIGHT may be specified * when the ARROW style is specified. * </p><p> * IMPORTANT: This class is intended to be subclassed <em>only</em> * within the SWT implementation. * </p> */public class Button extends Control {	Image image;	static final int ButtonProc;	static final TCHAR ButtonClass = new TCHAR (0,"BUTTON", true);	static final int CheckWidth, CheckHeight;	static {		int hBitmap = OS.LoadBitmap (0, OS.OBM_CHECKBOXES);		if (hBitmap == 0) {			CheckWidth = OS.GetSystemMetrics (OS.IsWinCE ? OS.SM_CXSMICON : OS.SM_CXVSCROLL);			CheckHeight = OS.GetSystemMetrics (OS.IsWinCE ? OS.SM_CYSMICON : OS.SM_CYVSCROLL);		} else {			BITMAP bitmap = new BITMAP ();			OS.GetObject (hBitmap, BITMAP.sizeof, bitmap);			OS.DeleteObject (hBitmap);			CheckWidth = bitmap.bmWidth / 4;			CheckHeight =  bitmap.bmHeight / 3;		}		WNDCLASS lpWndClass = new WNDCLASS ();		OS.GetClassInfo (0, ButtonClass, lpWndClass);		ButtonProc = lpWndClass.lpfnWndProc;	}/** * Constructs a new instance of this class given its parent * and a style value describing its behavior and appearance. * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this * class, or must be built by <em>bitwise OR</em>'ing together  * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. * Style bits are also inherited from superclasses. * </p> * * @param parent a composite control which will be the parent of the new instance (cannot be null) * @param style the style of control to construct * * @exception IllegalArgumentException <ul> *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li> * </ul> * @exception SWTException <ul> *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> * </ul> * * @see SWT#ARROW * @see SWT#CHECK * @see SWT#PUSH * @see SWT#RADIO * @see SWT#TOGGLE * @see SWT#FLAT * @see SWT#LEFT * @see SWT#RIGHT * @see SWT#CENTER * @see Widget#checkSubclass * @see Widget#getStyle */public Button (Composite parent, int style) {	super (parent, checkStyle (style));}/** * Adds the listener to the collection of listeners who will * be notified when the control is selected, by sending * it one of the messages defined in the <code>SelectionListener</code> * interface. * <p> * <code>widgetSelected</code> is called when the control is selected. * <code>widgetDefaultSelected</code> is not called. * </p> * * @param listener the listener which should be notified * * @exception IllegalArgumentException <ul> *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @exception SWTException <ul> *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * * @see SelectionListener * @see #removeSelectionListener * @see SelectionEvent */public void addSelectionListener (SelectionListener listener) {	checkWidget ();	if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);	TypedListener typedListener = new TypedListener (listener);	addListener (SWT.Selection,typedListener);	addListener (SWT.DefaultSelection,typedListener);}int callWindowProc (int msg, int wParam, int lParam) {	if (handle == 0) return 0;	return OS.CallWindowProc (ButtonProc, handle, msg, wParam, lParam);}static int checkStyle (int style) {	style = checkBits (style, SWT.PUSH, SWT.ARROW, SWT.CHECK, SWT.RADIO, SWT.TOGGLE, 0);	if ((style & (SWT.PUSH | SWT.TOGGLE)) != 0) {		return checkBits (style, SWT.CENTER, SWT.LEFT, SWT.RIGHT, 0, 0, 0);	}	if ((style & (SWT.CHECK | SWT.RADIO)) != 0) {		return checkBits (style, SWT.LEFT, SWT.RIGHT, SWT.CENTER, 0, 0, 0);	}	if ((style & SWT.ARROW) != 0) {		style |= SWT.NO_FOCUS;		return checkBits (style, SWT.UP, SWT.DOWN, SWT.LEFT, SWT.RIGHT, 0, 0);	}	return style;}void click () {	/*	* Note: BM_CLICK sends WM_LBUTTONDOWN and WM_LBUTTONUP.	*/	OS.SendMessage (handle, OS.BM_CLICK, 0, 0);}public Point computeSize (int wHint, int hHint, boolean changed) {	checkWidget ();	int border = getBorderWidth ();	int width = 0, height = 0;	if ((style & SWT.ARROW) != 0) {		if ((style & (SWT.UP | SWT.DOWN)) != 0) {			width += OS.GetSystemMetrics (OS.SM_CXVSCROLL);			height += OS.GetSystemMetrics (OS.SM_CYVSCROLL);		} else {			width += OS.GetSystemMetrics (OS.SM_CXHSCROLL);			height += OS.GetSystemMetrics (OS.SM_CYHSCROLL);		}		if (wHint != SWT.DEFAULT) width = wHint;		if (hHint != SWT.DEFAULT) height = hHint;		width += border * 2; height += border * 2;		return new Point (width, height);	}	int extra = 0;	int bits = OS.GetWindowLong (handle, OS.GWL_STYLE);	if ((bits & (OS.BS_BITMAP | OS.BS_ICON)) == 0) {		int oldFont = 0;		int hDC = OS.GetDC (handle);		int newFont = OS.SendMessage (handle, OS.WM_GETFONT, 0, 0);		if (newFont != 0) oldFont = OS.SelectObject (hDC, newFont);		TEXTMETRIC lptm = OS.IsUnicode ? (TEXTMETRIC) new TEXTMETRICW () : new TEXTMETRICA ();		OS.GetTextMetrics (hDC, lptm);		int length = OS.GetWindowTextLength (handle);		if (length == 0) {			height += lptm.tmHeight;		} else {			extra = Math.max (8, lptm.tmAveCharWidth);			TCHAR buffer = new TCHAR (getCodePage (), length + 1);			OS.GetWindowText (handle, buffer, length + 1);			RECT rect = new RECT ();			int flags = OS.DT_CALCRECT | OS.DT_SINGLELINE;			OS.DrawText (hDC, buffer, length, rect, flags);			width += rect.right - rect.left;			height += rect.bottom - rect.top;		}		if (newFont != 0) OS.SelectObject (hDC, oldFont);		OS.ReleaseDC (handle, hDC);	} else {		if (image != null) {			Rectangle rect = image.getBounds ();			width = rect.width;			height = rect.height;			extra = 8;		}	}	if ((style & (SWT.CHECK | SWT.RADIO)) != 0) {		width += CheckWidth + extra;		height = Math.max (height, CheckHeight + 3);	}	if ((style & (SWT.PUSH | SWT.TOGGLE)) != 0) {		width += 12;  height += 10;	}	if (wHint != SWT.DEFAULT) width = wHint;	if (hHint != SWT.DEFAULT) height = hHint;	width += border * 2; height += border * 2;	return new Point (width, height);}int defaultBackground () {	if ((style & (SWT.PUSH | SWT.TOGGLE)) != 0) {		return OS.GetSysColor (OS.COLOR_BTNFACE);	}	return super.defaultBackground ();}int defaultForeground () {	return OS.GetSysColor (OS.COLOR_BTNTEXT);}/** * Returns a value which describes the position of the * text or image in the receiver. The value will be one of * <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code> * unless the receiver is an <code>ARROW</code> button, in  * which case, the alignment will indicate the direction of * the arrow (one of <code>LEFT</code>, <code>RIGHT</code>,  * <code>UP</code> or <code>DOWN</code>). * * @return the alignment  * * @exception SWTException <ul> *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */public int getAlignment () {	checkWidget ();	if ((style & SWT.ARROW) != 0) {		if ((style & SWT.UP) != 0) return SWT.UP;		if ((style & SWT.DOWN) != 0) return SWT.DOWN;		if ((style & SWT.LEFT) != 0) return SWT.LEFT;		if ((style & SWT.RIGHT) != 0) return SWT.RIGHT;		return SWT.UP;	}	if ((style & SWT.LEFT) != 0) return SWT.LEFT;	if ((style & SWT.CENTER) != 0) return SWT.CENTER;	if ((style & SWT.RIGHT) != 0) return SWT.RIGHT;	return SWT.LEFT;}boolean getDefault () {	if ((style & SWT.PUSH) == 0) return false;	int bits = OS.GetWindowLong (handle, OS.GWL_STYLE);	return (bits & OS.BS_DEFPUSHBUTTON) != 0;}/** * Returns the receiver's image if it has one, or null * if it does not. * * @return the receiver's image * * @exception SWTException <ul> *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */public Image getImage () {	checkWidget ();	return image;}String getNameText () {	return getText ();}/** * Returns <code>true</code> if the receiver is selected, * and false otherwise. * <p> * When the receiver is of type <code>CHECK</code> or <code>RADIO</code>, * it is selected when it is checked. When it is of type <code>TOGGLE</code>, * it is selected when it is pushed in. If the receiver is of any other type, * this method returns false. * * @return the selection state * * @exception SWTException <ul> *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */public boolean getSelection () {	checkWidget ();	if ((style & (SWT.CHECK | SWT.RADIO | SWT.TOGGLE)) == 0) return false;	int state = OS.SendMessage (handle, OS.BM_GETCHECK, 0, 0);	return (state & OS.BST_CHECKED) != 0;}/** * Returns the receiver's text, which will be an empty * string if it has never been set or if the receiver is * an <code>ARROW</code> button. * * @return the receiver's text * * @exception SWTException <ul> *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */public String getText () {	checkWidget ();	if ((style & SWT.ARROW) != 0) return "";	int length = OS.GetWindowTextLength (handle);	if (length == 0) return "";	TCHAR buffer = new TCHAR (getCodePage (), length + 1);	OS.GetWindowText (handle, buffer, length + 1);	return buffer.toString (0, length);}boolean isTabItem () {	//TEMPORARY CODE	//if ((style & SWT.PUSH) != 0) return true;	return super.isTabItem ();}boolean mnemonicHit (char ch) {	if (!setFocus ()) return false;	/*	* Feature in Windows.  When a radio button gets focus, 	* it selects the button in WM_SETFOCUS.  Therefore, it	* is not necessary to click the button or send events	* because this has already happened in WM_SETFOCUS.	*/	if ((style & SWT.RADIO) == 0) click ();	return true;}boolean mnemonicMatch (char key) {	char mnemonic = findMnemonic (getText ());	if (mnemonic == '\0') return false;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美一二区| √…a在线天堂一区| 91啦中文在线观看| 97精品电影院| 成人午夜在线播放| 国产在线精品免费av| 国产一区二区在线电影| 狠狠色狠狠色综合系列| 国产一区二区调教| 成人精品免费看| 色婷婷激情综合| 欧美日韩高清在线播放| 日韩一区二区免费在线电影| 欧美一级视频精品观看| 精品欧美乱码久久久久久1区2区| 精品国产一二三区| 国产欧美日韩激情| 亚洲视频一区在线观看| 亚洲成av人片在www色猫咪| 亚洲成人av一区二区三区| 麻豆一区二区三| 国产九色sp调教91| 成人h精品动漫一区二区三区| 北条麻妃国产九九精品视频| 波多野结衣91| 欧美精选一区二区| 久久精品一区二区三区av| 自拍偷拍亚洲综合| 日韩高清欧美激情| 成人性生交大片免费看视频在线| 色婷婷精品大在线视频| 精品国产91乱码一区二区三区 | 老汉av免费一区二区三区| 国模一区二区三区白浆| 一本久久精品一区二区| 欧美一区二区三区视频免费| 欧美激情资源网| 丝袜美腿一区二区三区| 懂色av中文字幕一区二区三区| 色婷婷激情久久| 久久亚洲精精品中文字幕早川悠里| 中文字幕亚洲一区二区av在线 | 成人一区二区三区视频| 欧美日韩一区三区四区| 国产精品国产馆在线真实露脸| 奇米在线7777在线精品| 一本久久综合亚洲鲁鲁五月天| 久久天天做天天爱综合色| 亚洲电影你懂得| 成人精品亚洲人成在线| 日韩精品一区在线| 美女视频黄久久| 色综合久久88色综合天天免费| 精品卡一卡二卡三卡四在线| 亚洲国产va精品久久久不卡综合| 国产成人无遮挡在线视频| 欧美一区二区在线视频| 一区二区国产盗摄色噜噜| 成人综合在线视频| 精品国产伦理网| 久久国产精品无码网站| 欧美日韩成人综合天天影院| 亚洲同性同志一二三专区| 国产精品综合视频| 久久久亚洲精品一区二区三区| 日产欧产美韩系列久久99| 欧美性猛片aaaaaaa做受| 亚洲伦在线观看| av亚洲精华国产精华精| 国产精品三级在线观看| 国产成人自拍在线| 国产清纯白嫩初高生在线观看91| 麻豆精品视频在线观看视频| 欧美卡1卡2卡| 亚洲高清视频的网址| 欧美日韩一级片网站| 亚洲综合男人的天堂| 欧美少妇xxx| 午夜精品久久久久久久蜜桃app| 91官网在线观看| 亚洲国产精品久久人人爱 | 免费看欧美美女黄的网站| 欧美日韩夫妻久久| 日本不卡一二三| 精品sm在线观看| 国产盗摄一区二区| 日韩理论片网站| 欧美日韩在线三区| 蜜臀av一区二区| 久久婷婷国产综合国色天香| 高清免费成人av| 亚洲色图19p| 欧美肥胖老妇做爰| 国产自产v一区二区三区c| 中文字幕精品—区二区四季| av在线一区二区| 无吗不卡中文字幕| 久久综合av免费| 色屁屁一区二区| 卡一卡二国产精品| 日本一区免费视频| 欧美影院午夜播放| 久久国产视频网| 亚洲色图丝袜美腿| 欧美群妇大交群的观看方式 | 国产午夜精品福利| 色综合久久88色综合天天免费| 亚洲成在人线在线播放| 欧美电影免费观看高清完整版| 国产二区国产一区在线观看| 一区二区三区在线影院| 欧美一区二区高清| 波多野结衣91| 美女在线观看视频一区二区| 国产蜜臀av在线一区二区三区| 在线视频你懂得一区二区三区| 美腿丝袜在线亚洲一区| 中文字幕日韩一区| 日韩免费一区二区| 色综合天天性综合| 激情偷乱视频一区二区三区| 中文字幕亚洲欧美在线不卡| 7777精品伊人久久久大香线蕉的 | 欧美一区永久视频免费观看| av爱爱亚洲一区| 另类小说欧美激情| 亚洲最大成人综合| 日本一区二区三区四区| 日韩视频免费观看高清完整版| 一本色道久久加勒比精品| 国产精品小仙女| 久久精品国产第一区二区三区| 亚洲欧美日韩在线| 国产精品网站在线观看| 日韩欧美的一区| 欧美日韩免费一区二区三区| 91免费国产在线| 福利电影一区二区| 国产尤物一区二区在线| 日本免费新一区视频| 亚洲成a人片在线不卡一二三区| 日韩毛片视频在线看| 中文字幕不卡在线观看| 久久久精品免费观看| 久久久午夜精品理论片中文字幕| 欧美精品777| 欧美一区二区视频观看视频| 欧美日韩一区视频| 欧美日韩亚洲丝袜制服| 欧美色成人综合| 91久久精品国产91性色tv| 色吧成人激情小说| 一本色道久久综合精品竹菊| 色婷婷av一区| 91麻豆精品秘密| 色婷婷亚洲精品| 在线观看日产精品| 欧美日韩国产中文| 日韩欧美综合一区| 精品久久久久一区二区国产| 日韩一级完整毛片| 精品久久久久99| 久久久精品影视| 中文字幕乱码亚洲精品一区| 国产亚洲欧美日韩在线一区| 国产欧美中文在线| 亚洲欧洲综合另类| 一区二区三区精品在线观看| 亚洲一区影音先锋| 日av在线不卡| 懂色av一区二区在线播放| 成人免费看黄yyy456| 在线这里只有精品| 欧美一区午夜精品| 欧美国产1区2区| 亚洲一本大道在线| 老司机午夜精品99久久| 国产成人免费网站| 99re视频精品| 91精品国产综合久久精品麻豆| 日韩欧美专区在线| 中文字幕五月欧美| 日本aⅴ亚洲精品中文乱码| 国产一区二区精品久久| 97se亚洲国产综合自在线观| 9l国产精品久久久久麻豆| 欧美巨大另类极品videosbest| 精品少妇一区二区三区在线视频| 久久九九国产精品| 午夜精品成人在线| 国产精品一区在线观看乱码 | 国产精品一二三四五| 91久久精品午夜一区二区| 欧美va在线播放| 亚洲人一二三区| 国产在线观看免费一区| 91福利在线导航| 中文字幕av资源一区| 日本伊人午夜精品| 在线精品视频一区二区三四|