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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? toolitem.java

?? 源碼為Eclipse開源開發平臺桌面開發工具SWT的源代碼,
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/******************************************************************************* * Copyright (c) 2000, 2004 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 represents a button in a tool bar. * <dl> * <dt><b>Styles:</b></dt> * <dd>PUSH, CHECK, RADIO, SEPARATOR, DROP_DOWN</dd> * <dt><b>Events:</b></dt> * <dd>Selection</dd> * </dl> * <p> * Note: Only one of the styles CHECK, PUSH, RADIO, SEPARATOR and DROP_DOWN  * may be specified. * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> */public class ToolItem extends Item {	ToolBar parent;	Control control;	String toolTipText;	Image disabledImage, hotImage;	Image disabledImage2;	int id;/** * Constructs a new instance of this class given its parent * (which must be a <code>ToolBar</code>) and a style value * describing its behavior and appearance. The item is added * to the end of the items maintained by its parent. * <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#PUSH * @see SWT#CHECK * @see SWT#RADIO * @see SWT#SEPARATOR * @see SWT#DROP_DOWN * @see Widget#checkSubclass * @see Widget#getStyle */public ToolItem (ToolBar parent, int style) {	super (parent, checkStyle (style));	this.parent = parent;	parent.createItem (this, parent.getItemCount ());}/** * Constructs a new instance of this class given its parent * (which must be a <code>ToolBar</code>), a style value * describing its behavior and appearance, and the index * at which to place it in the items maintained by its parent. * <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 * @param index the index to store the receiver in its parent * * @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#PUSH * @see SWT#CHECK * @see SWT#RADIO * @see SWT#SEPARATOR * @see SWT#DROP_DOWN * @see Widget#checkSubclass * @see Widget#getStyle */public ToolItem (ToolBar parent, int style, int index) {	super (parent, checkStyle (style));	this.parent = parent;	parent.createItem (this, index);}/** * 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> * When <code>widgetSelected</code> is called when the mouse is over the arrow portion of a drop-down tool, * the event object detail field contains the value <code>SWT.ARROW</code>. * <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);}static int checkStyle (int style) {	return checkBits (style, SWT.PUSH, SWT.CHECK, SWT.RADIO, SWT.SEPARATOR, SWT.DROP_DOWN, 0);}protected void checkSubclass () {	if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);}void click (boolean dropDown) {		/*	* In order to emulate all the processing that	* happens when a mnemonic key is pressed, fake	* a mouse press and release.  This will ensure	* that radio and pull down items are handled	* properly.	*/	int hwnd = parent.handle;	if (OS.GetKeyState (OS.VK_LBUTTON) < 0) return;	int index = OS.SendMessage (hwnd, OS.TB_COMMANDTOINDEX, id, 0);	RECT rect = new RECT ();	OS.SendMessage (hwnd, OS.TB_GETITEMRECT, index, rect);	int y = rect.top + (rect.bottom - rect.top) / 2;	int lParam = (dropDown ? rect.right - 1 : rect.left) | (y << 16);	int hotIndex = OS.SendMessage (hwnd, OS.TB_GETHOTITEM, 0, 0);	OS.SendMessage (hwnd, OS.WM_LBUTTONDOWN, 0, lParam);	OS.SendMessage (hwnd, OS.WM_LBUTTONUP, 0, lParam);	if (hotIndex != -1) {		OS.SendMessage (hwnd, OS.TB_SETHOTITEM, hotIndex, 0);	}}Image createDisabledImage (Image image, Color color) {  	/*  	* In order to be consistent with the way that disabled	* images appear in other places in the user interface,	* use the SWT Graphics to create a disabled image instead    * of calling DrawState().	*/	return new Image (display, image, SWT.IMAGE_DISABLE);	/*	* This code is intentionally commented.	*///	if (OS.IsWinCE) {//		return new Image (display, image, SWT.IMAGE_DISABLE);//	}//	Rectangle rect = image.getBounds ();//	Image disabled = new Image (display, rect);//	GC gc = new GC (disabled);//	gc.setBackground (color);//	gc.fillRectangle (rect);//	int hDC = gc.handle;//	int hImage = image.handle;//	int fuFlags = OS.DSS_DISABLED;//	switch (image.type) {//		case SWT.BITMAP: fuFlags |= OS.DST_BITMAP; break;//		case SWT.ICON: fuFlags |= OS.DST_ICON; break;//	}//	OS.DrawState (hDC, 0, 0, hImage, 0, 0, 0, rect.width, rect.height, fuFlags);//	gc.dispose ();//	return disabled;}/** * Returns a rectangle describing the receiver's size and location * relative to its parent. * * @return the receiver's bounding rectangle * * @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 Rectangle getBounds () {	checkWidget();	int hwnd = parent.handle;	int index = OS.SendMessage (hwnd, OS.TB_COMMANDTOINDEX, id, 0);	RECT rect = new RECT ();	OS.SendMessage (hwnd, OS.TB_GETITEMRECT, index, rect);	int width = rect.right - rect.left;	int height = rect.bottom - rect.top;	return new Rectangle (rect.left, rect.top, width, height);}/** * Returns the control that is used to fill the bounds of * the item when the items is a <code>SEPARATOR</code>. * * @return the control * * @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 Control getControl () {	checkWidget();	return control;}/** * Returns the receiver's disabled image if it has one, or null * if it does not. * <p> * The disabled image is displayed when the receiver is disabled. * </p> * * @return the receiver's disabled 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 getDisabledImage () {	checkWidget();	return disabledImage;}/** * Returns <code>true</code> if the receiver is enabled, and * <code>false</code> otherwise. A disabled control is typically * not selectable from the user interface and draws with an * inactive or "grayed" look. * * @return the receiver's enabled 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> *  * @see #isEnabled */public boolean getEnabled () {	checkWidget();	int hwnd = parent.handle;	int fsState = OS.SendMessage (hwnd, OS.TB_GETSTATE, id, 0);	return (fsState & OS.TBSTATE_ENABLED) != 0;}/** * Returns the receiver's hot image if it has one, or null * if it does not. * <p> * The hot image is displayed when the mouse enters the receiver. * </p> * * @return the receiver's hot 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 getHotImage () {	checkWidget();	return hotImage;}/** * Returns the receiver's parent, which must be a <code>ToolBar</code>. * * @return the receiver's parent * * @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 ToolBar getParent () {	checkWidget();	return parent;}/** * 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 (which some platforms draw as a * pushed in button). If the receiver is of any other type, this method * returns false. * </p> * * @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)) == 0) return false;	int hwnd = parent.handle;	int fsState = OS.SendMessage (hwnd, OS.TB_GETSTATE, id, 0);	return (fsState & OS.TBSTATE_CHECKED) != 0;}/** * Returns the receiver's tool tip text, or null if it has not been set. * * @return the receiver's tool tip 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 getToolTipText () {	checkWidget();	return toolTipText;}/** * Gets the width of the receiver. * * @return the width * * @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 getWidth () {	checkWidget();	int hwnd = parent.handle;	int index = OS.SendMessage (hwnd, OS.TB_COMMANDTOINDEX, id, 0);	RECT rect = new RECT ();	OS.SendMessage (hwnd, OS.TB_GETITEMRECT, index, rect);	return rect.right - rect.left;}/** * Returns <code>true</code> if the receiver is enabled and all * of the receiver's ancestors are enabled, and <code>false</code> * otherwise. A disabled control is typically not selectable from the * user interface and draws with an inactive or "grayed" look. * * @return the receiver's enabled 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> *  * @see #getEnabled */public boolean isEnabled () {	checkWidget();	return getEnabled () && parent.isEnabled ();}void releaseChild () {	super.releaseChild ();	parent.destroyItem (this);}void releaseWidget () {	super.releaseWidget ();	parent = null;	control = null;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
不卡视频一二三四| 欧美一二三区在线| 欧美色视频一区| 欧美精品久久99久久在免费线| 欧美亚洲国产bt| 欧美大片一区二区| 国产午夜精品福利| 亚洲影视在线播放| 国产麻豆视频精品| 91美女片黄在线观看91美女| 欧美日韩视频在线第一区 | 久久夜色精品国产欧美乱极品| 精品久久久久久无| 亚洲婷婷综合色高清在线| 亚洲福利视频导航| 国产在线麻豆精品观看| 欧洲av在线精品| 久久久天堂av| 日韩av网站免费在线| av电影在线观看不卡| 91精品国产乱码| 亚洲精品高清视频在线观看| 久久99久久久久久久久久久| 欧美性大战xxxxx久久久| 国产视频一区二区在线| 偷拍日韩校园综合在线| www.成人网.com| 久久在线观看免费| 日韩高清在线不卡| 欧美在线综合视频| 国产精品美女久久久久高潮| 久久99精品国产| 91精品国产麻豆国产自产在线 | 日韩视频一区二区在线观看| 国产日韩欧美综合一区| 日本一二三不卡| 免费成人你懂的| 91麻豆精品91久久久久同性| 亚洲精品视频自拍| 色国产综合视频| 亚洲精品欧美综合四区| 色94色欧美sute亚洲线路一久| 国产嫩草影院久久久久| 成人免费视频播放| 久久精品人人爽人人爽| 久久99久久精品欧美| 久久久久久**毛片大全| 国产激情一区二区三区四区 | 91精品久久久久久久99蜜桃| 成人国产免费视频| 亚洲欧洲99久久| 成人av手机在线观看| 欧美高清在线精品一区| 不卡一区中文字幕| 亚洲品质自拍视频| 欧美日韩高清一区| 久久精品国产亚洲aⅴ| 久久看人人爽人人| 成人动漫在线一区| 亚洲线精品一区二区三区| 欧美精品aⅴ在线视频| 亚洲h精品动漫在线观看| 欧美日韩不卡一区二区| 偷拍一区二区三区四区| 91偷拍与自偷拍精品| 国产精品资源在线看| 国产精品 欧美精品| 国产欧美一区二区三区沐欲| 国产69精品一区二区亚洲孕妇| 91免费看片在线观看| 亚洲综合一二三区| 日韩精品一区二区三区四区| 国v精品久久久网| 1000精品久久久久久久久| 色综合色狠狠天天综合色| 性做久久久久久| 国产日产欧美精品一区二区三区| 色综合久久久久| 亚洲与欧洲av电影| 26uuu色噜噜精品一区二区| 国产精品原创巨作av| 成人小视频在线观看| 国产精品嫩草99a| 91丨九色丨蝌蚪丨老版| 青娱乐精品视频| 亚洲日本中文字幕区| 久久先锋资源网| 3d动漫精品啪啪| 国产乱人伦偷精品视频免下载| 亚洲一区二区欧美日韩| 国产精品视频一二三区| 精品国产乱码久久久久久久| 91麻豆高清视频| 奇米精品一区二区三区四区| 日韩精品一区二区三区中文不卡| 91黄色在线观看| 91在线视频免费91| 国产成人精品亚洲午夜麻豆| 国产精一区二区三区| 精品一区二区免费看| 男人的j进女人的j一区| 人禽交欧美网站| 日韩中文字幕av电影| 性欧美大战久久久久久久久| 亚洲国产一二三| 一区二区高清视频在线观看| 最新日韩av在线| 1000精品久久久久久久久| 中文字幕av不卡| 亚洲丝袜另类动漫二区| 亚洲三级在线播放| 亚洲综合小说图片| 国产精品伦理一区二区| 中文字幕免费在线观看视频一区| 国产视频一区不卡| 18涩涩午夜精品.www| 国产精品久久99| 亚洲午夜久久久久久久久电影院| 洋洋av久久久久久久一区| 亚洲永久精品大片| 在线观看国产91| 黄一区二区三区| 国产精品自拍在线| 成人免费毛片片v| 欧美日韩五月天| 欧美日韩aaa| 国产欧美一区二区三区鸳鸯浴| 日韩一级高清毛片| 国产精品少妇自拍| 中文字幕在线不卡| 婷婷成人综合网| 懂色一区二区三区免费观看 | 亚洲高清视频在线| 奇米色一区二区| caoporn国产一区二区| 欧美日韩二区三区| 国产免费久久精品| 蜜桃视频第一区免费观看| 成人一区二区三区在线观看| 欧美日韩免费一区二区三区视频| 精品久久久久久无| 亚洲国产精品视频| 美女网站一区二区| 色呦呦日韩精品| 久久精品人人做人人综合 | 中文字幕亚洲一区二区av在线| 日本aⅴ精品一区二区三区| 99精品视频在线免费观看| 精品99一区二区三区| 午夜久久久久久| 一本色道久久综合精品竹菊| 中文字幕在线观看不卡视频| 精品视频色一区| 18成人在线视频| 国产91露脸合集magnet| 日韩一区二区三区在线| 玉米视频成人免费看| 国产一区福利在线| 欧美日韩中文另类| 亚洲一区二区三区四区不卡| 91美女在线视频| 亚洲精品免费在线观看| 91成人免费电影| 婷婷亚洲久悠悠色悠在线播放| 欧洲另类一二三四区| 日韩一区精品字幕| 91黄色免费网站| 午夜精品成人在线视频| 日韩一区二区在线免费观看| 免费观看在线综合色| 精品成人在线观看| 精品国产三级a在线观看| 一区二区三区国产| 欧美日韩国产欧美日美国产精品| 亚洲高清三级视频| 4438x亚洲最大成人网| 美腿丝袜在线亚洲一区| 精品美女被调教视频大全网站| 国产精品一区二区黑丝| 最新国产成人在线观看| 欧美性生活大片视频| 偷拍日韩校园综合在线| 欧美一级欧美三级在线观看| 美女www一区二区| 中文字幕一区二区在线播放| 欧美日韩一区在线| 久久99国产精品麻豆| 国产精品久久久久久久裸模| 欧美探花视频资源| 国内外精品视频| 精品一区二区三区影院在线午夜| 精品国一区二区三区| 欧美天天综合网| 成人一道本在线| 五月婷婷色综合| 亚洲一区二区四区蜜桃| 久久先锋影音av鲁色资源网| 日本高清视频一区二区| 艳妇臀荡乳欲伦亚洲一区| www欧美成人18+|