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

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

?? combo.java

?? 源碼為Eclipse開源開發平臺桌面開發工具SWT的源代碼,
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
/******************************************************************************* * 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 are controls that allow the user * to choose an item from a list of items, or optionally  * enter a new value by typing it into an editable text * field. Often, <code>Combo</code>s are used in the same place * where a single selection <code>List</code> widget could * be used but space is limited. A <code>Combo</code> takes * less space than a <code>List</code> widget and shows * similar information. * <p> * Note: Since <code>Combo</code>s can contain both a list * and an editable text field, it is possible to confuse methods * which access one versus the other (compare for example, * <code>clearSelection()</code> and <code>deselectAll()</code>). * The API documentation is careful to indicate either "the * receiver's list" or the "the receiver's text field" to  * distinguish between the two cases. * </p><p> * Note that although this class is a subclass of <code>Composite</code>, * it does not make sense to add children to it, or set a layout on it. * </p> * <dl> * <dt><b>Styles:</b></dt> * <dd>DROP_DOWN, READ_ONLY, SIMPLE</dd> * <dt><b>Events:</b></dt> * <dd>DefaultSelection, Modify, Selection</dd> * </dl> * <p> * Note: Only one of the styles DROP_DOWN and SIMPLE  * may be specified. * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> * * @see List */public class Combo extends Composite {	boolean noSelection, ignoreCharacter;	int visibleCount = 5;		/**	 * the operating system limit for the number of characters	 * that the text field in an instance of this class can hold	 */	public static final int LIMIT;		/*	 * These values can be different on different platforms.	 * Therefore they are not initialized in the declaration	 * to stop the compiler from inlining.	 */	static {		LIMIT = OS.IsWinNT ? 0x7FFFFFFF : 0x7FFF;		}		/*	 * These are the undocumented control id's for the children of	 * a combo box.  Since there are no constants for these values,	 * they may change with different versions of Windows (but have	 * been the same since Windows 3.0).	 */	static final int CBID_LIST = 1000;	static final int CBID_EDIT = 1001;	static int EditProc, ListProc;		static final int ComboProc;	static final TCHAR ComboClass = new TCHAR (0, "COMBOBOX", true);	static {		WNDCLASS lpWndClass = new WNDCLASS ();		OS.GetClassInfo (0, ComboClass, lpWndClass);		ComboProc = 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#DROP_DOWN * @see SWT#READ_ONLY * @see SWT#SIMPLE * @see Widget#checkSubclass * @see Widget#getStyle */public Combo (Composite parent, int style) {	super (parent, checkStyle (style));}/** * Adds the argument to the end of the receiver's list. * * @param string the new item * * @exception IllegalArgumentException <ul> *    <li>ERROR_NULL_ARGUMENT - if the string 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> * @exception SWTError <ul> *    <li>ERROR_ITEM_NOT_ADDED - if the operation fails because of an operating system failure</li> * </ul> * * @see #add(String,int) */public void add (String string) {	checkWidget ();	if (string == null) error (SWT.ERROR_NULL_ARGUMENT);	TCHAR buffer = new TCHAR (getCodePage (), string, true);	int result = OS.SendMessage (handle, OS.CB_ADDSTRING, 0, buffer);	if (result == OS.CB_ERR) error (SWT.ERROR_ITEM_NOT_ADDED);	if (result == OS.CB_ERRSPACE) error (SWT.ERROR_ITEM_NOT_ADDED);}/** * Adds the argument to the receiver's list at the given * zero-relative index. * <p> * Note: To add an item at the end of the list, use the * result of calling <code>getItemCount()</code> as the * index or use <code>add(String)</code>. * </p> * * @param string the new item * @param index the index for the item * * @exception IllegalArgumentException <ul> *    <li>ERROR_NULL_ARGUMENT - if the string is null</li> *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list (inclusive)</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> * @exception SWTError <ul> *    <li>ERROR_ITEM_NOT_ADDED - if the operation fails because of an operating system failure</li> * </ul> * * @see #add(String) */public void add (String string, int index) {	checkWidget ();	if (string == null) error (SWT.ERROR_NULL_ARGUMENT);	int count = OS.SendMessage (handle, OS.CB_GETCOUNT, 0, 0);	if (!(0 <= index && index <= count)) {		error (SWT.ERROR_INVALID_RANGE);	}	TCHAR buffer = new TCHAR (getCodePage (), string, true);	int result = OS.SendMessage (handle, OS.CB_INSERTSTRING, index, buffer);	if (result == OS.CB_ERRSPACE || result == OS.CB_ERR) {		error (SWT.ERROR_ITEM_NOT_ADDED);	}}/** * Adds the listener to the collection of listeners who will * be notified when the receiver's text is modified, by sending * it one of the messages defined in the <code>ModifyListener</code> * interface. * * @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 ModifyListener * @see #removeModifyListener */public void addModifyListener (ModifyListener listener) {	checkWidget ();	if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);	TypedListener typedListener = new TypedListener (listener);	addListener (SWT.Modify, typedListener);}/** * Adds the listener to the collection of listeners who will * be notified when the receiver's selection changes, by sending * it one of the messages defined in the <code>SelectionListener</code> * interface. * <p> * <code>widgetSelected</code> is called when the combo's list selection changes. * <code>widgetDefaultSelected</code> is typically called when ENTER is pressed the combo's text area. * </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 (ComboProc, handle, msg, wParam, lParam);}protected void checkSubclass () {	if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);}static int checkStyle (int style) {	/*	 * Feature in Windows.  It is not possible to create	 * a combo box that has a border using Windows style	 * bits.  All combo boxes draw their own border and	 * do not use the standard Windows border styles.	 * Therefore, no matter what style bits are specified,	 * clear the BORDER bits so that the SWT style will	 * match the Windows widget.	 *	 * The Windows behavior is currently implemented on	 * all platforms.	 */	style &= ~SWT.BORDER;		/*	 * Even though it is legal to create this widget	 * with scroll bars, they serve no useful purpose	 * because they do not automatically scroll the	 * widget's client area.  The fix is to clear	 * the SWT style.	 */	style &= ~(SWT.H_SCROLL | SWT.V_SCROLL);	style = checkBits (style, SWT.DROP_DOWN, SWT.SIMPLE, 0, 0, 0, 0);	if ((style & SWT.SIMPLE) != 0) return style & ~SWT.READ_ONLY;	return style;}/** * Sets the selection in the receiver's text field to an empty * selection starting just before the first character. If the * text field is editable, this has the effect of placing the * i-beam at the start of the text. * <p> * Note: To clear the selected items in the receiver's list,  * use <code>deselectAll()</code>. * </p> * * @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 #deselectAll */public void clearSelection () {	checkWidget ();	OS.SendMessage (handle, OS.CB_SETEDITSEL, 0, -1);}public Point computeSize (int wHint, int hHint, boolean changed) {	checkWidget ();	int width = 0, height = 0, tmInternalLeading = 0;	if (wHint == SWT.DEFAULT) {		int newFont, oldFont = 0;		int hDC = OS.GetDC (handle);		newFont = OS.SendMessage (handle, OS.WM_GETFONT, 0, 0);		if (newFont != 0) oldFont = OS.SelectObject (hDC, newFont);		int count = OS.SendMessage (handle, OS.CB_GETCOUNT, 0, 0);		RECT rect = new RECT ();		int flags = OS.DT_CALCRECT | OS.DT_NOPREFIX;		if ((style & SWT.READ_ONLY) == 0) flags |= OS.DT_EDITCONTROL;		int length = OS.GetWindowTextLength (handle);		int cp = getCodePage ();		TCHAR buffer = new TCHAR (cp, length + 1);		OS.GetWindowText (handle, buffer, length + 1);		OS.DrawText (hDC, buffer, length, rect, flags);		width = Math.max (width, rect.right - rect.left);		for (int i=0; i<count; i++) {			length = OS.SendMessage (handle, OS.CB_GETLBTEXTLEN, i, 0);			if (length != OS.CB_ERR) {				if (length + 1 > buffer.length ()) buffer = new TCHAR (cp, length + 1);				int result = OS.SendMessage (handle, OS.CB_GETLBTEXT, i, buffer);				if (result != OS.CB_ERR) {					OS.DrawText (hDC, buffer, length, rect, flags);					width = Math.max (width, rect.right - rect.left);				}			}		}		if ((style & SWT.READ_ONLY) != 0) {			TEXTMETRIC tm = OS.IsUnicode ? (TEXTMETRIC) new TEXTMETRICW () : new TEXTMETRICA ();			OS.GetTextMetrics (hDC, tm);			tmInternalLeading = tm.tmInternalLeading;		}		if (newFont != 0) OS.SelectObject (hDC, oldFont);		OS.ReleaseDC (handle, hDC);	}	if (hHint == SWT.DEFAULT) {		if ((style & SWT.SIMPLE) != 0) {			int count = OS.SendMessage (handle, OS.CB_GETCOUNT, 0, 0);			int itemHeight = OS.SendMessage (handle, OS.CB_GETITEMHEIGHT, 0, 0);			height = count * itemHeight;		}	}		if (width == 0) width = DEFAULT_WIDTH;	if (height == 0) height = DEFAULT_HEIGHT;	if (wHint != SWT.DEFAULT) width = wHint;	if (hHint != SWT.DEFAULT) height = hHint;	if ((style & SWT.READ_ONLY) != 0) {		width += tmInternalLeading * 2;	} else {		int hwndText = OS.GetDlgItem (handle, CBID_EDIT);		if (hwndText != 0) {			int margins = OS.SendMessage (hwndText, OS.EM_GETMARGINS, 0, 0);			int marginWidth = (margins & 0xFFFF) + ((margins >> 16) & 0xFFFF);			width += marginWidth + 3;		}	}	int border = OS.GetSystemMetrics (OS.SM_CXEDGE);	width += OS.GetSystemMetrics (OS.SM_CXVSCROLL) + border * 2;	int textHeight = OS.SendMessage (handle, OS.CB_GETITEMHEIGHT, -1, 0);	if ((style & SWT.DROP_DOWN) != 0) {		height = textHeight + 6;	} else {		height += textHeight + 10;	}	return new Point (width, height);}/** * Copies the selected text. * <p> * The current selection is copied to the clipboard. * </p> * * @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> *  * @since 2.1 */public void copy () {	checkWidget ();	OS.SendMessage (handle, OS.WM_COPY, 0, 0);}void createHandle () {	super.createHandle ();	state &= ~CANVAS;	/* Get the text and list window procs */	int hwndText = OS.GetDlgItem (handle, CBID_EDIT);	if (hwndText != 0 && EditProc == 0) {		EditProc = OS.GetWindowLong (hwndText, OS.GWL_WNDPROC);	}	int hwndList = OS.GetDlgItem (handle, CBID_LIST);	if (hwndList != 0 && ListProc == 0) {		ListProc = OS.GetWindowLong (hwndList, OS.GWL_WNDPROC);	}	/*	* Bug in Windows.  If the combo box has the CBS_SIMPLE style,	* the list portion of the combo box is not drawn correctly the	* first time, causing pixel corruption.  The fix is to ensure	* that the combo box has been resized more than once.	*/	if ((style & SWT.SIMPLE) != 0) {		int flags = OS.SWP_NOZORDER | OS.SWP_DRAWFRAME | OS.SWP_NOACTIVATE;		SetWindowPos (handle, 0, 0, 0, 0x3FFF, 0x3FFF, flags);		SetWindowPos (handle, 0, 0, 0, 0, 0, flags);	}}/**

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品一区二区久久久| 在线视频一区二区免费| 欧美精品一区二区蜜臀亚洲| 青青草原综合久久大伊人精品优势| 欧美在线免费观看亚洲| 亚洲成人动漫在线观看| 欧美精品日韩一区| 久久99久久久久久久久久久| 久久先锋影音av鲁色资源网| 丁香一区二区三区| 中文字幕一区二区三区蜜月| 欧美日韩一区二区三区高清| 另类的小说在线视频另类成人小视频在线 | 三级精品在线观看| 日韩一区二区三区四区五区六区 | 精品国产凹凸成av人导航| 国产自产v一区二区三区c| 欧美激情资源网| 欧美日韩精品欧美日韩精品| 久久99国产精品久久| 国产精品免费视频网站| 欧美熟乱第一页| 久久99精品久久久久久国产越南| 久久精品一区蜜桃臀影院| 欧洲国内综合视频| 国产一区中文字幕| 亚洲自拍偷拍麻豆| 久久久久久久久99精品| 91黄色小视频| 国产在线播放一区三区四| 亚洲影院理伦片| 国产日韩欧美a| 91精品国产入口| 91在线观看美女| 精品一区二区日韩| 亚洲一区二区三区四区在线| 久久精品综合网| 宅男在线国产精品| 91在线观看成人| 国产精品综合网| 日韩高清在线不卡| 一区二区三区欧美在线观看| 国产性做久久久久久| 欧美挠脚心视频网站| 91香蕉视频污| 国产精品69毛片高清亚洲| 日韩中文字幕av电影| 亚洲色图一区二区三区| 2023国产一二三区日本精品2022| 在线观看中文字幕不卡| 不卡av在线免费观看| 国产麻豆成人精品| 卡一卡二国产精品 | 中文字幕日韩av资源站| 久久婷婷一区二区三区| 欧美精品久久一区| 欧美性色综合网| 91免费版在线看| 岛国av在线一区| 国产最新精品免费| 久久精品国产网站| 久久精品99国产国产精| 日本午夜一本久久久综合| 亚洲国产一区二区在线播放| 亚洲天堂免费看| 亚洲欧美日韩在线不卡| 日本一区二区高清| 久久久精品日韩欧美| 欧美成人国产一区二区| 欧美成人精品二区三区99精品| 666欧美在线视频| 欧美日高清视频| 制服丝袜亚洲网站| 日韩三级精品电影久久久| 欧美精品精品一区| 欧美群妇大交群中文字幕| 555夜色666亚洲国产免| 欧美一二三四区在线| 日韩视频不卡中文| 精品欧美乱码久久久久久| 久久婷婷久久一区二区三区| www久久精品| 日本一二三不卡| 国产精品乱码久久久久久| 亚洲私人黄色宅男| 夜夜揉揉日日人人青青一国产精品| 亚洲精品成人少妇| 亚洲va欧美va人人爽| 三级久久三级久久久| 美女在线视频一区| 日本欧美一区二区三区| 精品制服美女丁香| 成人免费毛片片v| 色av成人天堂桃色av| 5566中文字幕一区二区电影| 精品处破学生在线二十三| 欧美高清在线精品一区| 一区二区三区小说| 日本视频在线一区| 国产成人av电影| 欧美亚洲国产bt| 久久一区二区视频| 亚洲免费观看高清完整版在线观看熊 | 欧美一区二区三区白人| 久久久电影一区二区三区| 日韩毛片一二三区| 日韩国产一区二| 成人免费视频caoporn| 91成人看片片| 精品国产一区二区三区久久久蜜月 | 91视频www| 日韩免费观看高清完整版| 国产欧美一区二区三区在线看蜜臀 | 91小视频免费观看| 4438成人网| 亚洲欧洲精品一区二区三区| 午夜成人在线视频| 国产成人超碰人人澡人人澡| 色女孩综合影院| 日韩欧美电影一区| ㊣最新国产の精品bt伙计久久| 日韩影视精彩在线| 高清不卡在线观看av| 欧美日韩三级视频| 国产精品国产三级国产普通话99| 亚洲h在线观看| 成人国产亚洲欧美成人综合网| 欧美日韩aaa| 最好看的中文字幕久久| 国产在线乱码一区二区三区| 欧美视频在线不卡| 成人欧美一区二区三区在线播放| 日韩av不卡在线观看| 99久久99久久久精品齐齐| 日韩区在线观看| 午夜av一区二区三区| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 欧美日韩在线观看一区二区 | 亚洲精品一二三| 国产69精品久久99不卡| 91精品国产高清一区二区三区蜜臀| 中文字幕色av一区二区三区| 国产乱子轮精品视频| 日韩一区二区免费电影| 亚洲成人在线网站| 色爱区综合激月婷婷| 日韩一区欧美小说| 床上的激情91.| 久久久不卡网国产精品二区| 另类中文字幕网| 日韩三级伦理片妻子的秘密按摩| 亚洲一区免费观看| 在线观看欧美黄色| 一区二区三区成人在线视频| 91免费精品国自产拍在线不卡| 国产日韩精品久久久| 国产精品一二一区| 久久久久9999亚洲精品| 国产一级精品在线| 久久先锋影音av鲁色资源| 国产综合一区二区| 久久精品男人的天堂| 国产精品正在播放| 欧美激情综合五月色丁香 | 1区2区3区欧美| 99精品国产99久久久久久白柏| 国产调教视频一区| 国v精品久久久网| 国产精品成人在线观看| 99视频一区二区| 一区二区在线免费观看| 欧美色精品在线视频| 日日摸夜夜添夜夜添国产精品 | 成人午夜电影小说| 国产精品久久久久久久岛一牛影视| 国产a区久久久| 日韩一区在线免费观看| 在线精品视频一区二区| 丝袜美腿亚洲一区二区图片| 日韩视频中午一区| 国产精品一区二区三区99| 国产精品污www在线观看| 成人v精品蜜桃久久一区| 亚洲日本一区二区三区| 欧美群妇大交群中文字幕| 麻豆精品久久精品色综合| 精品少妇一区二区三区免费观看 | 国产亚洲一本大道中文在线| 国产大陆a不卡| 亚洲欧美在线另类| 色婷婷激情一区二区三区| 石原莉奈一区二区三区在线观看| 日韩免费高清av| 成人一区二区三区中文字幕| 亚洲精品乱码久久久久| 制服丝袜亚洲色图| 国产99久久久国产精品免费看 | 婷婷中文字幕综合| 337p粉嫩大胆噜噜噜噜噜91av| 国产91露脸合集magnet|