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

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

?? toolbar.java

?? 源碼為Eclipse開源開發平臺桌面開發工具SWT的源代碼,
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/******************************************************************************* * 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.*;/** * Instances of this class support the layout of selectable * tool bar items. * <p> * The item children that may be added to instances of this class * must be of type <code>ToolItem</code>. * </p><p> * Note that although this class is a subclass of <code>Composite</code>, * it does not make sense to add <code>Control</code> children to it, * or set a layout on it. * </p><p> * <dl> * <dt><b>Styles:</b></dt> * <dd>FLAT, WRAP, RIGHT, HORIZONTAL, VERTICAL, SHADOW_OUT</dd> * <dt><b>Events:</b></dt> * <dd>(none)</dd> * </dl> * <p> * Note: Only one of the styles HORIZONTAL and VERTICAL may be specified. * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> */public class ToolBar extends Composite {	int lastFocusId;	ToolItem [] items;	boolean ignoreResize;	ImageList imageList, disabledImageList, hotImageList;	static final int ToolBarProc;	static final TCHAR ToolBarClass = new TCHAR (0, OS.TOOLBARCLASSNAME, true);	static {		WNDCLASS lpWndClass = new WNDCLASS ();		OS.GetClassInfo (0, ToolBarClass, lpWndClass);		ToolBarProc = lpWndClass.lpfnWndProc;	}		/*	* From the Windows SDK for TB_SETBUTTONSIZE:	*	*   "If an application does not explicitly	*	set the button size, the size defaults	*	to 24 by 22 pixels". 	*/	static final int DEFAULT_WIDTH = 24;	static final int DEFAULT_HEIGHT = 22;/** * 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#FLAT * @see SWT#WRAP * @see SWT#RIGHT * @see SWT#HORIZONTAL * @see SWT#SHADOW_OUT * @see SWT#VERTICAL * @see Widget#checkSubclass() * @see Widget#getStyle() */public ToolBar (Composite parent, int style) {	super (parent, checkStyle (style));	/*	* Ensure that either of HORIZONTAL or VERTICAL is set.	* NOTE: HORIZONTAL and VERTICAL have the same values	* as H_SCROLL and V_SCROLL so it is necessary to first	* clear these bits to avoid scroll bars and then reset	* the bits using the original style supplied by the	* programmer.	*/	if ((style & SWT.VERTICAL) != 0) {		this.style |= SWT.VERTICAL;	} else {		this.style |= SWT.HORIZONTAL;	}}int callWindowProc (int msg, int wParam, int lParam) {	if (handle == 0) return 0;	/*	* Bug in Windows.  For some reason, during the processing	* of WM_SYSCHAR, the tool bar window proc does not call the	* default window proc causing mnemonics for the menu bar	* to be ignored.  The fix is to always call the default	* window proc for WM_SYSCHAR.	*/	if (msg == OS.WM_SYSCHAR) {		return OS.DefWindowProc (handle, msg, wParam, lParam);	}	return OS.CallWindowProc (ToolBarProc, handle, msg, wParam, lParam);}static int checkStyle (int style) {	/*	* On Windows, only flat tool bars can be traversed.	*/	if ((style & SWT.FLAT) == 0) style |= SWT.NO_FOCUS;		/*	* A vertical tool bar cannot wrap because TB_SETROWS	* fails when the toobar has TBSTYLE_WRAPABLE.	*/	if ((style & SWT.VERTICAL) != 0) style &= ~SWT.WRAP;			/*	* 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.	*/	return style & ~(SWT.H_SCROLL | SWT.V_SCROLL);}protected void checkSubclass () {	if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);}public Point computeSize (int wHint, int hHint, boolean changed) {	checkWidget ();	if (layout != null) {		return super.computeSize (wHint, hHint, changed);	}	int width = 0, height = 0;	if ((style & SWT.VERTICAL) != 0) {		RECT rect = new RECT ();		TBBUTTON lpButton = new TBBUTTON ();		int count = OS.SendMessage (handle, OS.TB_BUTTONCOUNT, 0, 0);		for (int i=0; i<count; i++) {			OS.SendMessage (handle, OS.TB_GETITEMRECT, i, rect);			height = Math.max (height, rect.bottom);			OS.SendMessage (handle, OS.TB_GETBUTTON, i, lpButton);			if ((lpButton.fsStyle & OS.BTNS_SEP) == 0) {				width = Math.max (width, rect.right);			}		}	} else {		RECT oldRect = new RECT ();		OS.GetWindowRect (handle, oldRect);		int oldWidth = oldRect.right - oldRect.left;		int oldHeight = oldRect.bottom - oldRect.top;		int border = getBorderWidth ();		int newWidth = wHint == SWT.DEFAULT ? 0x3FFF : wHint + border * 2;		int newHeight = hHint == SWT.DEFAULT ? 0x3FFF : hHint + border * 2;		boolean redraw = drawCount == 0 && OS.IsWindowVisible (handle);		ignoreResize = true;		if (redraw) OS.UpdateWindow (handle);		int flags = OS.SWP_NOACTIVATE | OS.SWP_NOMOVE | OS.SWP_NOREDRAW | OS.SWP_NOZORDER;		SetWindowPos (handle, 0, 0, 0, newWidth, newHeight, flags);		int count = OS.SendMessage (handle, OS.TB_BUTTONCOUNT, 0, 0);		if (count != 0) {			RECT rect = new RECT ();			OS.SendMessage (handle, OS.TB_GETITEMRECT, count - 1, rect);			width = Math.max (width, rect.right);			height = Math.max (height, rect.bottom);		}		SetWindowPos (handle, 0, 0, 0, oldWidth, oldHeight, flags);		if (redraw) OS.ValidateRect (handle, null);		ignoreResize = false;	}		/*	* From the Windows SDK for TB_SETBUTTONSIZE:	*	*   "If an application does not explicitly	*	set the button size, the size defaults	*	to 24 by 22 pixels". 	*/	if (width == 0) width = DEFAULT_WIDTH;	if (height == 0) height = DEFAULT_HEIGHT;	if (wHint != SWT.DEFAULT) width = wHint;	if (hHint != SWT.DEFAULT) height = hHint;	Rectangle trim = computeTrim (0, 0, width, height);	width = trim.width;  height = trim.height;	return new Point (width, height);}public Rectangle computeTrim (int x, int y, int width, int height) {	checkWidget ();	Rectangle trim = super.computeTrim (x, y, width, height);	int bits = OS.GetWindowLong (handle, OS.GWL_STYLE);	if ((bits & OS.CCS_NODIVIDER) == 0) trim.height += 2;	return trim;}void createHandle () {	super.createHandle ();	state &= ~CANVAS;	/*	* Feature in Windows.  Despite the fact that the	* tool tip text contains \r\n, the tooltip will	* not honour the new line unless TTM_SETMAXTIPWIDTH	* is set.  The fix is to set TTM_SETMAXTIPWIDTH to	* a large value.	*/	/*	* These lines are intentionally commented.  The tool	* bar currently sets this value to 300 so it is not	* necessary to set TTM_SETMAXTIPWIDTH.	*///	int hwndToolTip = OS.SendMessage (handle, OS.TB_GETTOOLTIPS, 0, 0);//	OS.SendMessage (hwndToolTip, OS.TTM_SETMAXTIPWIDTH, 0, 0x7FFF);	/*	* Feature in Windows.  When the control is created,	* it does not use the default system font.  A new HFONT	* is created and destroyed when the control is destroyed.	* This means that a program that queries the font from	* this control, uses the font in another control and then	* destroys this control will have the font unexpectedly	* destroyed in the other control.  The fix is to assign	* the font ourselves each time the control is created.	* The control will not destroy a font that it did not	* create.	*/	int hFont = OS.GetStockObject (OS.SYSTEM_FONT);	OS.SendMessage (handle, OS.WM_SETFONT, hFont, 0);	/* Set the button struct, bitmap and button sizes */	OS.SendMessage (handle, OS.TB_BUTTONSTRUCTSIZE, TBBUTTON.sizeof, 0);	OS.SendMessage (handle, OS.TB_SETBITMAPSIZE, 0, 0);	OS.SendMessage (handle, OS.TB_SETBUTTONSIZE, 0, 0);	/* Set the extended style bits */	int bits = OS.TBSTYLE_EX_DRAWDDARROWS | OS.TBSTYLE_EX_MIXEDBUTTONS;	OS.SendMessage (handle, OS.TB_SETEXTENDEDSTYLE, 0, bits);}void createItem (ToolItem item, int index) {	int count = OS.SendMessage (handle, OS.TB_BUTTONCOUNT, 0, 0);	if (!(0 <= index && index <= count)) error (SWT.ERROR_INVALID_RANGE);	int id = 0;	while (id < items.length && items [id] != null) id++;	if (id == items.length) {		ToolItem [] newItems = new ToolItem [items.length + 4];		System.arraycopy (items, 0, newItems, 0, items.length);		items = newItems;	}	int bits = item.widgetStyle ();	TBBUTTON lpButton = new TBBUTTON ();	lpButton.idCommand = id;	lpButton.fsStyle = (byte) bits;	lpButton.fsState = (byte) OS.TBSTATE_ENABLED;		/*	* Bug in Windows.  Despite the fact that the image list	* index has never been set for the item, Windows always	* assumes that the image index for the item is valid.	* When an item is inserted, the image index is zero.	* Therefore, when the first image is inserted and is	* assigned image index zero, every item draws with this	* image.  The fix is to set the image index to none	* when the item is created.  This is not necessary in	* the case when the item has the BTNS_SEP style because	* separators cannot show images.	*/	if ((bits & OS.BTNS_SEP) == 0) lpButton.iBitmap = OS.I_IMAGENONE;	if (OS.SendMessage (handle, OS.TB_INSERTBUTTON, index, lpButton) == 0) {		error (SWT.ERROR_ITEM_NOT_ADDED);	}	items [item.id = id] = item;	if ((style & SWT.VERTICAL) != 0) setRows (count + 1);	layoutItems ();}void createWidget () {	super.createWidget ();	items = new ToolItem [4];	lastFocusId = -1;}int defaultBackground () {	if (OS.IsWinCE) return OS.GetSysColor (OS.COLOR_BTNFACE);	return super.defaultBackground ();}void destroyItem (ToolItem item) {	TBBUTTONINFO info = new TBBUTTONINFO ();	info.cbSize = TBBUTTONINFO.sizeof;	info.dwMask = OS.TBIF_IMAGE | OS.TBIF_STYLE;	int index = OS.SendMessage (handle, OS.TB_GETBUTTONINFO, item.id, info);	/*	* Feature in Windows.  For some reason, a tool item that has	* the style BTNS_SEP does not return I_IMAGENONE when queried	* for an image index, despite the fact that no attempt has been	* made to assign an image to the item.  As a result, operations	* on an image list that use the wrong index cause random results.		* The fix is to ensure that the tool item is not a separator	* before using the image index.  Since separators cannot have	* an image and one is never assigned, this is not a problem.	*/	if ((info.fsStyle & OS.BTNS_SEP) == 0 && info.iImage != OS.I_IMAGENONE) {		if (imageList != null) imageList.put (info.iImage, null);		if (hotImageList != null) hotImageList.put (info.iImage, null);		if (disabledImageList != null) disabledImageList.put (info.iImage, null);	}	OS.SendMessage (handle, OS.TB_DELETEBUTTON, index, 0);	if (item.id == lastFocusId) lastFocusId = -1;	items [item.id] = null;	item.id = -1;	int count = OS.SendMessage (handle, OS.TB_BUTTONCOUNT, 0, 0);	if (count == 0) {		if (imageList != null) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久免费毛片精品| 国产精品女同一区二区三区| 国产丝袜在线精品| 亚洲图片欧美综合| 岛国一区二区三区| 欧美一区二区三区精品| 亚洲日本免费电影| 国产一区二区三区免费在线观看| 色综合色狠狠综合色| 久久精品一区二区三区av| 亚洲一区二区综合| 99久久综合色| 2021国产精品久久精品| 亚洲成人手机在线| 在线观看一区日韩| 国产精品不卡在线观看| 国产成人免费高清| 精品国产髙清在线看国产毛片| 亚洲福利一区二区三区| 色综合天天狠狠| 亚洲国产精品激情在线观看| 精品亚洲成a人在线观看| 欧美欧美欧美欧美首页| 一区二区久久久久| 色悠久久久久综合欧美99| 国产精品天天看| 懂色av一区二区三区蜜臀| 精品国产乱码久久久久久浪潮| 丝袜国产日韩另类美女| 欧美性欧美巨大黑白大战| 亚洲免费看黄网站| 91麻豆自制传媒国产之光| 欧美国产激情一区二区三区蜜月 | 日本一区二区三区在线不卡| 日本欧美加勒比视频| 7777精品伊人久久久大香线蕉超级流畅 | 91蜜桃婷婷狠狠久久综合9色| 欧美激情艳妇裸体舞| 国产v综合v亚洲欧| 国产精品久久久久久户外露出 | 制服丝袜在线91| 日韩成人dvd| 欧美成va人片在线观看| 国产毛片精品视频| 国产精品久久一卡二卡| 91在线精品一区二区三区| 亚洲美女在线一区| 国产精品日韩精品欧美在线| 福利一区在线观看| 国产精品伦理在线| 欧美日韩午夜在线| 久久99九九99精品| 中文字幕国产一区二区| 94-欧美-setu| 天堂久久一区二区三区| 久久久亚洲精品石原莉奈| www.日本不卡| 石原莉奈在线亚洲二区| 2021久久国产精品不只是精品| 高清不卡在线观看| 亚洲午夜羞羞片| 欧美不卡一区二区三区| www.欧美色图| 美日韩一区二区三区| 亚洲国产高清在线观看视频| 色噜噜狠狠一区二区三区果冻| 视频一区二区不卡| 国产精品天天摸av网| 欧美日韩国产三级| 国产高清在线精品| 亚洲综合自拍偷拍| 国产视频不卡一区| 欧美精品久久一区| 懂色av中文一区二区三区| 五月天激情综合| 国产精品高清亚洲| 欧美成人精品1314www| 91社区在线播放| 国内精品免费在线观看| 亚洲激情在线播放| 国产欧美精品在线观看| 欧美日本一道本| youjizz国产精品| 久久精品久久综合| 夜夜嗨av一区二区三区中文字幕| 欧美精品一区二区久久婷婷 | 亚洲午夜久久久久久久久久久| 精品成人一区二区三区| 欧美日韩激情在线| 不卡区在线中文字幕| 久久99精品久久久久婷婷| 亚洲精品免费视频| 中文成人综合网| 精品久久久久久久久久久久包黑料 | 91日韩精品一区| 国产福利91精品一区二区三区| 午夜婷婷国产麻豆精品| 亚洲欧美韩国综合色| 国产精品视频在线看| 欧美α欧美αv大片| 在线播放欧美女士性生活| 一本久久精品一区二区| 97超碰欧美中文字幕| 国产91精品一区二区麻豆网站| 久久精品国产精品亚洲综合| 天堂影院一区二区| 亚洲一区二区黄色| 亚洲欧美偷拍卡通变态| 亚洲天堂免费看| 中文字幕一区二区在线观看| 国产性色一区二区| 久久久久久久久久看片| 亚洲综合免费观看高清完整版在线 | 精品久久久久99| 欧美一级欧美一级在线播放| 欧美日韩国产影片| 欧美剧在线免费观看网站| 欧美亚一区二区| 欧美视频日韩视频| 欧美剧情电影在线观看完整版免费励志电影 | 欧美一区二区日韩| 日韩一级免费观看| 久久众筹精品私拍模特| 久久亚洲私人国产精品va媚药| 26uuu另类欧美亚洲曰本| 26uuu色噜噜精品一区二区| 久久久久综合网| 中文字幕高清一区| 亚洲久本草在线中文字幕| 亚洲一区二区三区四区在线免费观看| 亚洲一区二区在线播放相泽| 天堂成人国产精品一区| 精品一区二区三区久久| 国产成人免费视频网站| www.色精品| 欧美日韩成人综合天天影院| 欧美成人乱码一区二区三区| 国产亚洲一区二区三区在线观看 | 99久久久国产精品| 在线观看免费亚洲| 日韩欧美高清在线| 国产精品第五页| 偷拍亚洲欧洲综合| 国产成人午夜精品影院观看视频| 成人黄色软件下载| 在线观看视频欧美| 精品国产电影一区二区| 亚洲欧洲精品天堂一级| 亚洲国产另类av| 韩国理伦片一区二区三区在线播放| 成人午夜视频网站| 欧美酷刑日本凌虐凌虐| 中文字幕免费不卡| 秋霞电影网一区二区| 成人av综合在线| 91精品国产色综合久久不卡电影 | 2019国产精品| 亚洲最新视频在线观看| 国产乱一区二区| 欧美亚洲国产一区在线观看网站| 亚洲精品一区二区三区精华液 | 国产女人aaa级久久久级| 一区二区三区日本| 国产精品一区二区三区99| 在线日韩一区二区| 国产欧美精品区一区二区三区 | 国产精品亚洲第一区在线暖暖韩国| 91在线观看地址| 久久久久久电影| 亚洲成人av一区二区三区| 国产v综合v亚洲欧| 欧美一区二区三区四区在线观看| 中文字幕制服丝袜一区二区三区 | 国产白丝精品91爽爽久久| 欧美日产国产精品| 一区视频在线播放| 国产激情精品久久久第一区二区| 91精品国模一区二区三区| 亚洲美女视频在线| 成人午夜精品在线| 精品国产一二三| 日韩综合小视频| 欧洲一区二区三区在线| 中文字幕乱码日本亚洲一区二区 | 日本三级亚洲精品| 在线国产亚洲欧美| 樱花草国产18久久久久| 不卡一区二区三区四区| 欧美极品另类videosde| 国产乱人伦精品一区二区在线观看 | 成人小视频在线| 久久精品一区八戒影视| 国产乱人伦偷精品视频免下载| 日韩欧美国产一二三区| 日本不卡在线视频| 91麻豆精品国产91| 秋霞国产午夜精品免费视频| 91精品午夜视频| 日本美女一区二区三区视频| 欧美精品电影在线播放|