View | Details | Raw Unified | Return to bug 193318 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse SWT/win32/org/eclipse/swt/widgets/ToolItem.java (+97 lines)
Lines 39-44 Link Here
39
	String toolTipText;
39
	String toolTipText;
40
	Image disabledImage, hotImage;
40
	Image disabledImage, hotImage;
41
	Image disabledImage2;
41
	Image disabledImage2;
42
	Menu menu;
42
	int id;
43
	int id;
43
44
44
/**
45
/**
Lines 125-130 Link Here
125
126
126
/**
127
/**
127
 * Adds the listener to the collection of listeners who will
128
 * Adds the listener to the collection of listeners who will
129
 * be notified when the platform-specific context menu trigger
130
 * has occurred, by sending it one of the messages defined in
131
 * the <code>MenuDetectListener</code> interface.
132
 *
133
 * @param listener the listener which should be notified
134
 *
135
 * @exception IllegalArgumentException <ul>
136
 *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
137
 * </ul>
138
 * @exception SWTException <ul>
139
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
140
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
141
 * </ul>
142
 *
143
 * @see MenuDetectListener
144
 * @see #removeMenuDetectListener
145
 *
146
 * @since 3.3
147
 */
148
public void addMenuDetectListener (MenuDetectListener listener) {
149
	checkWidget ();
150
	if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
151
	TypedListener typedListener = new TypedListener (listener);
152
	addListener (SWT.MenuDetect, typedListener);
153
}
154
155
/**
156
 * Adds the listener to the collection of listeners who will
128
 * be notified when the control is selected by the user, by sending
157
 * be notified when the control is selected by the user, by sending
129
 * it one of the messages defined in the <code>SelectionListener</code>
158
 * it one of the messages defined in the <code>SelectionListener</code>
130
 * interface.
159
 * interface.
Lines 254-259 Link Here
254
}
283
}
255
284
256
/**
285
/**
286
 * Returns the receiver's drop-down menu if it has one, or null 
287
 * if it does not.
288
 * <p>
289
 * The drop-down menu is activated when the arrow of an {@link SWT#DROP_DOWN}-styled receiver is pressed.
290
 * </p>
291
 * 
292
 * @return the receiver's drop-down menu
293
 * @exception SWTException <ul>
294
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
295
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
296
 * </ul>
297
 */
298
public Menu getMenu () {
299
	checkWidget();
300
	return menu;
301
}
302
303
/**
257
 * Returns <code>true</code> if the receiver is enabled, and
304
 * Returns <code>true</code> if the receiver is enabled, and
258
 * <code>false</code> otherwise. A disabled control is typically
305
 * <code>false</code> otherwise. A disabled control is typically
259
 * not selectable from the user interface and draws with an
306
 * not selectable from the user interface and draws with an
Lines 435-440 Link Here
435
482
436
/**
483
/**
437
 * Removes the listener from the collection of listeners who will
484
 * Removes the listener from the collection of listeners who will
485
 * be notified when the platform-specific context menu trigger has
486
 * occurred.
487
 *
488
 * @param listener the listener which should no longer be notified
489
 *
490
 * @exception IllegalArgumentException <ul>
491
 *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
492
 * </ul>
493
 * @exception SWTException <ul>
494
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
495
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
496
 * </ul>
497
 *
498
 * @see MenuDetectListener
499
 * @see #addMenuDetectListener
500
 *
501
 * @since 3.3
502
 */
503
public void removeMenuDetectListener (MenuDetectListener listener) {
504
	checkWidget ();
505
	if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
506
	if (eventTable == null) return;
507
	eventTable.unhook (SWT.MenuDetect, listener);
508
}
509
510
/**
511
 * Removes the listener from the collection of listeners who will
438
 * be notified when the control is selected by the user.
512
 * be notified when the control is selected by the user.
439
 *
513
 *
440
 * @param listener the listener which should no longer be notified
514
 * @param listener the listener which should no longer be notified
Lines 638-643 Link Here
638
}
712
}
639
713
640
/**
714
/**
715
 * Sets the receiver's drop-down menu to the argument, which may be 
716
 * null indicating that no drop-down menu should be displayed.
717
 * <p>
718
 * If this property is null a drop-down menu can still be displayed manually by adding a
719
 * {@link SelectionListener} to the receiver and handling{@link SWT#ARROW} events.
720
 * <p>
721
 * The drop-down menu is activated when the arrow of an {@link SWT#DROP_DOWN}-styled receiver is pressed.
722
 * Attempts to set a drop-dwn menu for a receiver that does not have the {@link SWT#DROP_DOWN}
723
 * style are ignored.
724
 * </p>
725
 * 
726
 * @param menu the drop-down menu to be displayed when the receiver's arrow is pressed
727
 * @exception SWTException <ul>
728
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
729
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
730
 * </ul>
731
 */
732
public void setMenu (Menu menu) {
733
	checkWidget();
734
	this.menu = menu;
735
}
736
737
/**
641
 * Sets the receiver's hot image to the argument, which may be
738
 * Sets the receiver's hot image to the argument, which may be
642
 * null indicating that no hot image should be displayed.
739
 * null indicating that no hot image should be displayed.
643
 * <p>
740
 * <p>
(-)Eclipse SWT/win32/org/eclipse/swt/widgets/ToolBar.java (-1 / +105 lines)
Lines 44-49 Link Here
44
	ToolItem [] items;
44
	ToolItem [] items;
45
	boolean ignoreResize, ignoreMouse;
45
	boolean ignoreResize, ignoreMouse;
46
	ImageList imageList, disabledImageList, hotImageList;
46
	ImageList imageList, disabledImageList, hotImageList;
47
	boolean showingPushItemMenu;
47
	static final int ToolBarProc;
48
	static final int ToolBarProc;
48
	static final TCHAR ToolBarClass = new TCHAR (0, OS.TOOLBARCLASSNAME, true);
49
	static final TCHAR ToolBarClass = new TCHAR (0, OS.TOOLBARCLASSNAME, true);
49
	static {
50
	static {
Lines 1119-1124 Link Here
1119
			* application the opportunity to cancel the operation.
1120
			* application the opportunity to cancel the operation.
1120
			*/
1121
			*/
1121
			return LRESULT.ZERO;
1122
			return LRESULT.ZERO;
1123
		case OS.VK_DOWN:
1124
		case OS.VK_UP:
1125
			/*
1126
			 * SWT.DROPDOWN menus are automatically triggered by Windows on the
1127
			 * UP and DOWN keys. Here we mirror this behavior for PUSH items.
1128
			 */
1129
			int itemIndex = OS.SendMessage(handle, OS.TB_GETHOTITEM, 0, 0);
1130
			if (handlePushItemMenu(itemIndex)) {
1131
				return LRESULT.ZERO;
1132
			}
1122
	}
1133
	}
1123
	return result;
1134
	return result;
1124
}
1135
}
Lines 1131-1138 Link Here
1131
	return super.WM_KILLFOCUS (wParam, lParam);
1142
	return super.WM_KILLFOCUS (wParam, lParam);
1132
}
1143
}
1133
1144
1145
LRESULT WM_LBUTTONDBLCLK(int wParam, int lParam) {
1146
	POINT point = new POINT ();
1147
	point.x = OS.GET_X_LPARAM (lParam);
1148
	point.y = OS.GET_Y_LPARAM (lParam);
1149
	int itemIndex = OS.SendMessage (handle, OS.TB_HITTEST, 0, point);
1150
	if (handlePushItemMenu (itemIndex)) {
1151
		return LRESULT.ZERO;
1152
	}
1153
	return super.WM_LBUTTONDBLCLK(wParam, lParam);
1154
}
1155
1134
LRESULT WM_LBUTTONDOWN (int wParam, int lParam) {
1156
LRESULT WM_LBUTTONDOWN (int wParam, int lParam) {
1157
	if (!showingPushItemMenu) {
1158
		POINT point = new POINT ();
1159
		point.x = OS.GET_X_LPARAM (lParam);
1160
		point.y = OS.GET_Y_LPARAM (lParam);
1161
		int itemIndex = OS.SendMessage (handle, OS.TB_HITTEST, 0, point);
1162
		if (handlePushItemMenu (itemIndex)) {
1163
			return LRESULT.ZERO;
1164
		}
1165
	} else {
1166
		showingPushItemMenu = false;
1167
		return LRESULT.ZERO;
1168
	}
1169
1135
	if (ignoreMouse) return null;
1170
	if (ignoreMouse) return null;
1171
1136
	return super.WM_LBUTTONDOWN (wParam, lParam);
1172
	return super.WM_LBUTTONDOWN (wParam, lParam);
1137
}
1173
}
1138
1174
Lines 1306-1312 Link Here
1306
				OS.SendMessage (handle, OS.TB_GETITEMRECT, index, rect);
1342
				OS.SendMessage (handle, OS.TB_GETITEMRECT, index, rect);
1307
				event.x = rect.left;
1343
				event.x = rect.left;
1308
				event.y = rect.bottom;
1344
				event.y = rect.bottom;
1309
				child.postEvent (SWT.Selection, event);
1345
1346
				if (sendItemMenuDetectEvent (child, rect, SWT.ARROW)) {
1347
					// Without this call, an lbuttondown event that triggers the menu
1348
					// will not be delivered to EventListeners until after the menu has been closed.
1349
					display.runDeferredEvents();
1350
					showItemMenu (child, rect);
1351
				} else {
1352
					child.postEvent (SWT.Selection, event);
1353
				}
1310
			}
1354
			}
1311
			break;
1355
			break;
1312
		case OS.NM_CUSTOMDRAW:
1356
		case OS.NM_CUSTOMDRAW:
Lines 1363-1366 Link Here
1363
	return super.wmNotifyChild (hdr, wParam, lParam);
1407
	return super.wmNotifyChild (hdr, wParam, lParam);
1364
}
1408
}
1365
1409
1410
private boolean handlePushItemMenu(int itemIndex) {
1411
	// Inspect non-separator item under the cursor
1412
	if (itemIndex >= 0) {
1413
		// Get item instance
1414
		TBBUTTON button = new TBBUTTON ();
1415
		OS.SendMessage (handle, OS.TB_GETBUTTON, itemIndex, button);
1416
		ToolItem child = items[button.idCommand];
1417
		// Only allow menu display for PUSH items
1418
		final int toolItemStyleMask = SWT.PUSH | SWT.CHECK | SWT.RADIO
1419
					| SWT.SEPARATOR | SWT.DROP_DOWN;
1420
		if ((child.style & toolItemStyleMask) == SWT.PUSH) {
1421
			// Get item state
1422
			int itemState = OS.SendMessage (handle, OS.TB_GETSTATE, button.idCommand, 0);
1423
			// Only attempt to show a menu if the item is enabled
1424
			if ((itemState & OS.TBSTATE_ENABLED) != 0) {
1425
				RECT rect = new RECT ();
1426
				OS.SendMessage (handle, OS.TB_GETITEMRECT, itemIndex, rect);
1427
				if (sendItemMenuDetectEvent (child, rect, 0)) {
1428
					// Press item
1429
					itemState |= OS.TBSTATE_PRESSED;
1430
					OS.SendMessage (handle, OS.TB_SETSTATE, button.idCommand, itemState);
1431
					// Show menu
1432
					showingPushItemMenu = true;
1433
					showItemMenu (child, rect);
1434
					// Unpress item - reload item state since it may have changed
1435
					itemState = OS.SendMessage (handle, OS.TB_GETSTATE, button.idCommand, 0);
1436
					itemState &= ~OS.TBSTATE_PRESSED;
1437
					OS.SendMessage (handle, OS.TB_SETSTATE, button.idCommand, itemState);
1438
					// Allow the mouse event that cancelled the menu to be eaten away
1439
					// since on reentrance to the method showingPushItemMenu will still be true.
1440
					// This allows the menu to be closed on a second click.
1441
					if (display != null && !display.isDisposed ()) {
1442
						display.readAndDispatch ();
1443
					}
1444
					showingPushItemMenu = false;
1445
					return true;
1446
				}
1447
			}
1448
		}
1449
	}
1450
	return false;
1451
}
1452
1453
private void showItemMenu (ToolItem child, RECT rect) {
1454
	Menu menu = child.menu;
1455
	OS.MapWindowPoints (handle, 0, rect, 2);
1456
	menu.setLocation (rect.left, rect.bottom);
1457
	menu._setVisible (true, rect, OS.TPM_VERTICAL);
1458
}
1459
1460
private boolean sendItemMenuDetectEvent (ToolItem child, RECT rect, int detail) {
1461
	Event event = new Event ();
1462
	event.detail = detail;
1463
	event.x = rect.left;
1464
	event.y = rect.bottom;
1465
	child.sendEvent (SWT.MenuDetect, event);
1466
	Menu menu = child.menu;
1467
	return event.doit && menu != null && !menu.isDisposed();
1468
}
1469
1366
}
1470
}
(-)Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java (-2 / +18 lines)
Lines 195-201 Link Here
195
	createWidget ();
195
	createWidget ();
196
}
196
}
197
197
198
void _setVisible (boolean visible) {
198
public void _setVisible (boolean visible) {
199
	_setVisible(visible, null, 0);
200
}
201
202
void _setVisible (boolean visible, RECT excludeRect, int extraFlags) {
199
	if ((style & (SWT.BAR | SWT.DROP_DOWN)) != 0) return;
203
	if ((style & (SWT.BAR | SWT.DROP_DOWN)) != 0) return;
200
	int hwndParent = parent.handle;
204
	int hwndParent = parent.handle;
201
	if (visible) {
205
	if (visible) {
Lines 206-211 Link Here
206
			flags &= ~OS.TPM_RIGHTALIGN;
210
			flags &= ~OS.TPM_RIGHTALIGN;
207
			if ((style & SWT.LEFT_TO_RIGHT) != 0) flags |= OS.TPM_RIGHTALIGN;
211
			if ((style & SWT.LEFT_TO_RIGHT) != 0) flags |= OS.TPM_RIGHTALIGN;
208
		}
212
		}
213
		flags |= extraFlags;
209
		int nX = x, nY = y;
214
		int nX = x, nY = y;
210
		if (!hasLocation) {
215
		if (!hasLocation) {
211
			int pos = OS.GetMessagePos ();
216
			int pos = OS.GetMessagePos ();
Lines 225-231 Link Here
225
		* the case when TrackPopupMenu() fails and the number of items in
230
		* the case when TrackPopupMenu() fails and the number of items in
226
		* the menu is zero and issue a fake WM_MENUSELECT.
231
		* the menu is zero and issue a fake WM_MENUSELECT.
227
		*/
232
		*/
228
		boolean success = OS.TrackPopupMenu (handle, flags, nX, nY, 0, hwndParent, null);
233
		boolean success;
234
		if (excludeRect == null) {
235
			success = OS.TrackPopupMenu (handle, flags, nX, nY, 0, hwndParent, null);
236
		} else {
237
			TPMPARAMS lptpm = new TPMPARAMS();
238
			lptpm.cbSize = TPMPARAMS.sizeof;
239
			lptpm.left = excludeRect.left;
240
			lptpm.top = excludeRect.top;
241
			lptpm.right = excludeRect.right;
242
			lptpm.bottom = excludeRect.bottom;
243
			success = OS.TrackPopupMenuEx (handle, flags, nX, nY, hwndParent, lptpm);
244
		}
229
		if (!success && GetMenuItemCount (handle) == 0) {
245
		if (!success && GetMenuItemCount (handle) == 0) {
230
			OS.SendMessage (hwndParent, OS.WM_MENUSELECT, OS.MAKEWPARAM (0, 0xFFFF), 0);
246
			OS.SendMessage (hwndParent, OS.WM_MENUSELECT, OS.MAKEWPARAM (0, 0xFFFF), 0);
231
		}
247
		}
(-)Eclipse SWT PI/win32/library/os_stats.c (-2 / +3 lines)
Lines 14-21 Link Here
14
14
15
#ifdef NATIVE_STATS
15
#ifdef NATIVE_STATS
16
16
17
int OS_nativeFunctionCount = 883;
17
int OS_nativeFunctionCount = 884;
18
int OS_nativeFunctionCallCount[883];
18
int OS_nativeFunctionCallCount[884];
19
char * OS_nativeFunctionNames[] = {
19
char * OS_nativeFunctionNames[] = {
20
	"ACCEL_1sizeof",
20
	"ACCEL_1sizeof",
21
	"ACTCTX_1sizeof",
21
	"ACTCTX_1sizeof",
Lines 867-872 Link Here
867
	"ToUnicode",
867
	"ToUnicode",
868
	"TrackMouseEvent",
868
	"TrackMouseEvent",
869
	"TrackPopupMenu",
869
	"TrackPopupMenu",
870
	"TrackPopupMenuEx",
870
	"TranslateAcceleratorA",
871
	"TranslateAcceleratorA",
871
	"TranslateAcceleratorW",
872
	"TranslateAcceleratorW",
872
	"TranslateCharsetInfo",
873
	"TranslateCharsetInfo",
(-)Eclipse SWT PI/win32/library/os_structs.h (+12 lines)
Lines 1427-1432 Link Here
1427
#define TOOLINFO_sizeof() 0
1427
#define TOOLINFO_sizeof() 0
1428
#endif
1428
#endif
1429
1429
1430
#ifndef NO_TPMPARAMS
1431
void cacheTPMPARAMSFields(JNIEnv *env, jobject lpObject);
1432
TPMPARAMS *getTPMPARAMSFields(JNIEnv *env, jobject lpObject, TPMPARAMS *lpStruct);
1433
void setTPMPARAMSFields(JNIEnv *env, jobject lpObject, TPMPARAMS *lpStruct);
1434
#define TPMPARAMS_sizeof() sizeof(TPMPARAMS)
1435
#else
1436
#define cacheTPMPARAMSFields(a,b)
1437
#define getTPMPARAMSFields(a,b,c) NULL
1438
#define setTPMPARAMSFields(a,b,c)
1439
#define TPMPARAMS_sizeof() 0
1440
#endif
1441
1430
#ifndef NO_TRACKMOUSEEVENT
1442
#ifndef NO_TRACKMOUSEEVENT
1431
void cacheTRACKMOUSEEVENTFields(JNIEnv *env, jobject lpObject);
1443
void cacheTRACKMOUSEEVENTFields(JNIEnv *env, jobject lpObject);
1432
TRACKMOUSEEVENT *getTRACKMOUSEEVENTFields(JNIEnv *env, jobject lpObject, TRACKMOUSEEVENT *lpStruct);
1444
TRACKMOUSEEVENT *getTRACKMOUSEEVENTFields(JNIEnv *env, jobject lpObject, TRACKMOUSEEVENT *lpStruct);
(-)Eclipse SWT PI/win32/library/os_stats.h (+1 lines)
Lines 875-880 Link Here
875
	ToUnicode_FUNC,
875
	ToUnicode_FUNC,
876
	TrackMouseEvent_FUNC,
876
	TrackMouseEvent_FUNC,
877
	TrackPopupMenu_FUNC,
877
	TrackPopupMenu_FUNC,
878
	TrackPopupMenuEx_FUNC,
878
	TranslateAcceleratorA_FUNC,
879
	TranslateAcceleratorA_FUNC,
879
	TranslateAcceleratorW_FUNC,
880
	TranslateAcceleratorW_FUNC,
880
	TranslateCharsetInfo_FUNC,
881
	TranslateCharsetInfo_FUNC,
(-)Eclipse SWT PI/win32/library/os_structs.c (+43 lines)
Lines 6523-6528 Link Here
6523
}
6523
}
6524
#endif
6524
#endif
6525
6525
6526
#ifndef NO_TPMPARAMS
6527
typedef struct TPMPARAMS_FID_CACHE {
6528
	int cached;
6529
	jclass clazz;
6530
	jfieldID cbSize, left, top, right, bottom;
6531
} TPMPARAMS_FID_CACHE;
6532
6533
TPMPARAMS_FID_CACHE TPMPARAMSFc;
6534
6535
void cacheTPMPARAMSFields(JNIEnv *env, jobject lpObject)
6536
{
6537
	if (TPMPARAMSFc.cached) return;
6538
	TPMPARAMSFc.clazz = (*env)->GetObjectClass(env, lpObject);
6539
	TPMPARAMSFc.cbSize = (*env)->GetFieldID(env, TPMPARAMSFc.clazz, "cbSize", "I");
6540
	TPMPARAMSFc.left = (*env)->GetFieldID(env, TPMPARAMSFc.clazz, "left", "I");
6541
	TPMPARAMSFc.top = (*env)->GetFieldID(env, TPMPARAMSFc.clazz, "top", "I");
6542
	TPMPARAMSFc.right = (*env)->GetFieldID(env, TPMPARAMSFc.clazz, "right", "I");
6543
	TPMPARAMSFc.bottom = (*env)->GetFieldID(env, TPMPARAMSFc.clazz, "bottom", "I");
6544
	TPMPARAMSFc.cached = 1;
6545
}
6546
6547
TPMPARAMS *getTPMPARAMSFields(JNIEnv *env, jobject lpObject, TPMPARAMS *lpStruct)
6548
{
6549
	if (!TPMPARAMSFc.cached) cacheTPMPARAMSFields(env, lpObject);
6550
	lpStruct->cbSize = (*env)->GetIntField(env, lpObject, TPMPARAMSFc.cbSize);
6551
	lpStruct->rcExclude.left = (*env)->GetIntField(env, lpObject, TPMPARAMSFc.left);
6552
	lpStruct->rcExclude.top = (*env)->GetIntField(env, lpObject, TPMPARAMSFc.top);
6553
	lpStruct->rcExclude.right = (*env)->GetIntField(env, lpObject, TPMPARAMSFc.right);
6554
	lpStruct->rcExclude.bottom = (*env)->GetIntField(env, lpObject, TPMPARAMSFc.bottom);
6555
	return lpStruct;
6556
}
6557
6558
void setTPMPARAMSFields(JNIEnv *env, jobject lpObject, TPMPARAMS *lpStruct)
6559
{
6560
	if (!TPMPARAMSFc.cached) cacheTPMPARAMSFields(env, lpObject);
6561
	(*env)->SetIntField(env, lpObject, TPMPARAMSFc.cbSize, (jint)lpStruct->cbSize);
6562
	(*env)->SetIntField(env, lpObject, TPMPARAMSFc.left, (jint)lpStruct->rcExclude.left);
6563
	(*env)->SetIntField(env, lpObject, TPMPARAMSFc.top, (jint)lpStruct->rcExclude.top);
6564
	(*env)->SetIntField(env, lpObject, TPMPARAMSFc.right, (jint)lpStruct->rcExclude.right);
6565
	(*env)->SetIntField(env, lpObject, TPMPARAMSFc.bottom, (jint)lpStruct->rcExclude.bottom);
6566
}
6567
#endif
6568
6526
#ifndef NO_TRACKMOUSEEVENT
6569
#ifndef NO_TRACKMOUSEEVENT
6527
typedef struct TRACKMOUSEEVENT_FID_CACHE {
6570
typedef struct TRACKMOUSEEVENT_FID_CACHE {
6528
	int cached;
6571
	int cached;
(-)Eclipse SWT PI/win32/library/os.c (+28 lines)
Lines 13506-13511 Link Here
13506
}
13506
}
13507
#endif
13507
#endif
13508
13508
13509
#ifndef NO_TPMPARAMS_1sizeof
13510
JNIEXPORT jint JNICALL OS_NATIVE(TPMPARAMS_1sizeof)
13511
	(JNIEnv *env, jclass that)
13512
{
13513
	jint rc = 0;
13514
	OS_NATIVE_ENTER(env, that, TPMPARAMS_1sizeof_FUNC);
13515
	rc = (jint)TPMPARAMS_sizeof();
13516
	OS_NATIVE_EXIT(env, that, TPMPARAMS_1sizeof_FUNC);
13517
	return rc;
13518
}
13519
#endif
13520
13509
#ifndef NO_TRACKMOUSEEVENT_1sizeof
13521
#ifndef NO_TRACKMOUSEEVENT_1sizeof
13510
JNIEXPORT jint JNICALL OS_NATIVE(TRACKMOUSEEVENT_1sizeof)
13522
JNIEXPORT jint JNICALL OS_NATIVE(TRACKMOUSEEVENT_1sizeof)
13511
	(JNIEnv *env, jclass that)
13523
	(JNIEnv *env, jclass that)
Lines 13660-13665 Link Here
13660
}
13672
}
13661
#endif
13673
#endif
13662
13674
13675
#ifndef NO_TrackPopupMenuEx
13676
JNIEXPORT jboolean JNICALL OS_NATIVE(TrackPopupMenuEx)
13677
	(JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jobject arg5)
13678
{
13679
	TPMPARAMS _arg5, *lparg5=NULL;
13680
	jboolean rc = 0;
13681
	OS_NATIVE_ENTER(env, that, TrackPopupMenuEx_FUNC);
13682
	if (arg5) if ((lparg5 = getTPMPARAMSFields(env, arg5, &_arg5)) == NULL) goto fail;
13683
	rc = (jboolean)TrackPopupMenuEx(arg0, arg1, arg2, arg3, arg4, lparg5);
13684
fail:
13685
	if (arg5 && lparg5) setTPMPARAMSFields(env, arg5, lparg5);
13686
	OS_NATIVE_EXIT(env, that, TrackPopupMenuEx_FUNC);
13687
	return rc;
13688
}
13689
#endif
13690
13663
#ifndef NO_TranslateAcceleratorA
13691
#ifndef NO_TranslateAcceleratorA
13664
JNIEXPORT jint JNICALL OS_NATIVE(TranslateAcceleratorA)
13692
JNIEXPORT jint JNICALL OS_NATIVE(TranslateAcceleratorA)
13665
	(JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2)
13693
	(JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2)
(-)Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java (+4 lines)
Lines 1548-1553 Link Here
1548
	public static final int TB_GETROWS = 0x428;
1548
	public static final int TB_GETROWS = 0x428;
1549
	public static final int TB_GETSTATE = 0x412;
1549
	public static final int TB_GETSTATE = 0x412;
1550
	public static final int TB_GETTOOLTIPS = 0x423;
1550
	public static final int TB_GETTOOLTIPS = 0x423;
1551
	public static final int TB_HITTEST = 0x445;
1551
	public static final int TB_INSERTBUTTON = IsUnicode ? 0x443 : 0x415;
1552
	public static final int TB_INSERTBUTTON = IsUnicode ? 0x443 : 0x415;
1552
	public static final int TB_LOADIMAGES = 0x432;
1553
	public static final int TB_LOADIMAGES = 0x432;
1553
	public static final int TB_MAPACCELERATOR = 0x0400 + (IsUnicode ? 90 : 78);
1554
	public static final int TB_MAPACCELERATOR = 0x0400 + (IsUnicode ? 90 : 78);
Lines 1618-1623 Link Here
1618
	public static final int TPM_LEFTBUTTON = 0x0;
1619
	public static final int TPM_LEFTBUTTON = 0x0;
1619
	public static final int TPM_RIGHTBUTTON = 0x2;
1620
	public static final int TPM_RIGHTBUTTON = 0x2;
1620
	public static final int TPM_RIGHTALIGN = 0x8;
1621
	public static final int TPM_RIGHTALIGN = 0x8;
1622
	public static final int TPM_VERTICAL = 0x40;
1621
	public static final String TRACKBAR_CLASS = "msctls_trackbar32"; //$NON-NLS-1$
1623
	public static final String TRACKBAR_CLASS = "msctls_trackbar32"; //$NON-NLS-1$
1622
	public static final int TRANSPARENT = 0x1;
1624
	public static final int TRANSPARENT = 0x1;
1623
	public static final int TREIS_DISABLED = 4;
1625
	public static final int TREIS_DISABLED = 4;
Lines 2138-2143 Link Here
2138
public static final native int TEXTMETRICA_sizeof ();
2140
public static final native int TEXTMETRICA_sizeof ();
2139
public static final native int TEXTMETRICW_sizeof ();
2141
public static final native int TEXTMETRICW_sizeof ();
2140
public static final native int TOOLINFO_sizeof ();
2142
public static final native int TOOLINFO_sizeof ();
2143
public static final native int TPMPARAMS_sizeof ();
2141
public static final native int TRACKMOUSEEVENT_sizeof ();
2144
public static final native int TRACKMOUSEEVENT_sizeof ();
2142
public static final native int TRIVERTEX_sizeof ();
2145
public static final native int TRIVERTEX_sizeof ();
2143
public static final native int TVHITTESTINFO_sizeof ();
2146
public static final native int TVHITTESTINFO_sizeof ();
Lines 3858-3863 Link Here
3858
public static final native boolean TreeView_GetItemRect (int /*long*/ hwndTV, int /*long*/ hitem, RECT prc, boolean fItemRect);
3861
public static final native boolean TreeView_GetItemRect (int /*long*/ hwndTV, int /*long*/ hitem, RECT prc, boolean fItemRect);
3859
public static final native boolean TrackMouseEvent (TRACKMOUSEEVENT lpEventTrack);
3862
public static final native boolean TrackMouseEvent (TRACKMOUSEEVENT lpEventTrack);
3860
public static final native boolean TrackPopupMenu (int /*long*/ hMenu, int uFlags, int x, int y, int nReserved, int /*long*/ hWnd, RECT prcRect);
3863
public static final native boolean TrackPopupMenu (int /*long*/ hMenu, int uFlags, int x, int y, int nReserved, int /*long*/ hWnd, RECT prcRect);
3864
public static final native boolean TrackPopupMenuEx (int /*long*/ hMenu, int uFlags, int x, int y, int /*long*/ hWnd, TPMPARAMS lptpm);
3861
public static final native int TranslateAcceleratorW (int /*long*/ hWnd, int /*long*/ hAccTable, MSG lpMsg);
3865
public static final native int TranslateAcceleratorW (int /*long*/ hWnd, int /*long*/ hAccTable, MSG lpMsg);
3862
public static final native int TranslateAcceleratorA (int /*long*/ hWnd, int /*long*/ hAccTable, MSG lpMsg);
3866
public static final native int TranslateAcceleratorA (int /*long*/ hWnd, int /*long*/ hAccTable, MSG lpMsg);
3863
public static final native boolean TranslateCharsetInfo (int /*long*/ lpSrc, int [] lpCs, int dwFlags);
3867
public static final native boolean TranslateCharsetInfo (int /*long*/ lpSrc, int [] lpCs, int dwFlags);
(-)Eclipse (+8 lines)
Added Link Here
1
package org.eclipse.swt.internal.win32;
2
3
public class TPMPARAMS {
4
	public int cbSize;
5
//	public RECT rcExclude;
6
	public int left, top, right, bottom;
7
	public static int sizeof =  OS.TPMPARAMS_sizeof ();
8
}

Return to bug 193318