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

Collapse All | Expand All

(-)Eclipse SWT/carbon/org/eclipse/swt/widgets/Text.java (+34 lines)
Lines 80-85 Link Here
80
		DELIMITER = "\r";
80
		DELIMITER = "\r";
81
	}
81
	}
82
82
83
	static final String [] AX_ATTRIBUTES = {
84
		OS.kAXTitleAttribute,
85
	};
86
83
/**
87
/**
84
 * Constructs a new instance of this class given its parent
88
 * Constructs a new instance of this class given its parent
85
 * and a style value describing its behavior and appearance.
89
 * and a style value describing its behavior and appearance.
Lines 681-686 Link Here
681
	return super.focusPart ();
685
	return super.focusPart ();
682
}
686
}
683
687
688
String [] getAxAttributes () {
689
	return AX_ATTRIBUTES;
690
}
691
684
public int getBorderWidth () {
692
public int getBorderWidth () {
685
	checkWidget();
693
	checkWidget();
686
	if (hasBorder ()) {
694
	if (hasBorder ()) {
Lines 1336-1341 Link Here
1336
	}
1344
	}
1337
}
1345
}
1338
1346
1347
int kEventAccessibleGetNamedAttribute (int nextHandler, int theEvent, int userData) {
1348
	/*
1349
	* Feature of the Macintosh.  For some reason, AXTextFields return their text contents
1350
	* when they are asked for their title.  Since they also return their text contents
1351
	* when they are asked for their value, this causes screen readers to speak the text
1352
	* twice.  The fix is to return nothing when asked for a title.
1353
	*/
1354
	int code = OS.eventNotHandledErr;
1355
	int [] stringRef = new int [1];
1356
	OS.GetEventParameter (theEvent, OS.kEventParamAccessibleAttributeName, OS.typeCFStringRef, null, 4, null, stringRef);
1357
	int length = 0;
1358
	if (stringRef [0] != 0) length = OS.CFStringGetLength (stringRef [0]);
1359
	char [] buffer = new char [length];
1360
	CFRange range = new CFRange ();
1361
	range.length = length;
1362
	OS.CFStringGetCharacters (stringRef [0], range, buffer);
1363
	String attributeName = new String(buffer);
1364
	if (attributeName.equals (OS.kAXTitleAttribute)) {
1365
		code = OS.noErr;
1366
	}
1367
	if (accessible != null) {
1368
		code = accessible.internal_kEventAccessibleGetNamedAttribute (nextHandler, theEvent, code);
1369
	}
1370
	return code;
1371
}
1372
1339
int kEventMouseDown (int nextHandler, int theEvent, int userData) {
1373
int kEventMouseDown (int nextHandler, int theEvent, int userData) {
1340
	int result = super.kEventMouseDown (nextHandler, theEvent, userData);
1374
	int result = super.kEventMouseDown (nextHandler, theEvent, userData);
1341
	if (result == OS.noErr) return result;
1375
	if (result == OS.noErr) return result;

Return to bug 232114