Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Winkler2014-12-20 16:26:52 +0000
committerLakshmi Shanmugam2017-07-24 13:03:53 +0000
commit8bf613179309ce1a679451549666cb79e319caf8 (patch)
treed134b47b0878a3621d18af2a304da83007767e48 /bundles/org.eclipse.swt/Eclipse SWT PI/cocoa
parent21b3dc3ba9e3010caebed19fc34b973849def633 (diff)
downloadeclipse.platform.swt-8bf613179309ce1a679451549666cb79e319caf8.tar.gz
eclipse.platform.swt-8bf613179309ce1a679451549666cb79e319caf8.tar.xz
eclipse.platform.swt-8bf613179309ce1a679451549666cb79e319caf8.zip
Bug 455854: Text field with SWT.SEARCH style ignores setBackground
Implemented custom SWTSearchFieldCell to handle non-default background color. Change-Id: I80db1fa0c42ca3ad194e8416ef1793aa6328f992 Signed-off-by: Stefan Winkler <stefan@winklerweb.net>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/cocoa')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBezierPath.java7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSearchFieldCell.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTSearchField.java1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTSearchFieldCell.java16
6 files changed, 53 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras
index 7869c289a6..9d196bf08e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras
@@ -283,6 +283,12 @@
<arg swt_gen="true"></arg>
<retval swt_gen="true"></retval>
</method>
+ <method class_method="true" selector="bezierPathWithRoundedRect:xRadius:yRadius:" swt_gen="true">
+ <arg swt_gen="true"></arg>
+ <arg swt_gen="true"></arg>
+ <arg swt_gen="true"></arg>
+ <retval swt_gen="true"></retval>
+ </method>
<method selector="bounds" swt_gen="true">
<retval swt_gen="true"></retval>
</method>
@@ -2946,9 +2952,17 @@
<method selector="cancelButtonCell" swt_gen="true">
<retval swt_gen="true"></retval>
</method>
+ <method selector="cancelButtonRectForBounds:" swt_gen="true">
+ <arg swt_gen="true"></arg>
+ <retval swt_gen="true"></retval>
+ </method>
<method selector="searchButtonCell" swt_gen="true">
<retval swt_gen="true"></retval>
</method>
+ <method selector="searchButtonRectForBounds:" swt_gen="true">
+ <arg swt_gen="true"></arg>
+ <retval swt_gen="true"></retval>
+ </method>
<method selector="searchTextRectForBounds:" swt_gen="true">
<arg swt_gen="true"></arg>
<retval swt_gen="true"></retval>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBezierPath.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBezierPath.java
index 5f81279e8b..b48bad7c88 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBezierPath.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBezierPath.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -71,6 +71,11 @@ public static NSBezierPath bezierPathWithRect(NSRect rect) {
return result != 0 ? new NSBezierPath(result) : null;
}
+public static NSBezierPath bezierPathWithRoundedRect(NSRect rect, double /*float*/ xRadius, double /*float*/ yRadius) {
+ long /*int*/ result = OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_bezierPathWithRoundedRect_xRadius_yRadius_, rect, xRadius, yRadius);
+ return result != 0 ? new NSBezierPath(result) : null;
+}
+
public NSRect bounds() {
NSRect result = new NSRect();
OS.objc_msgSend_stret(result, this.id, OS.sel_bounds);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSearchFieldCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSearchFieldCell.java
index bf3a4b9368..e3fd11cc7b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSearchFieldCell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSearchFieldCell.java
@@ -29,11 +29,23 @@ public NSButtonCell cancelButtonCell() {
return result != 0 ? new NSButtonCell(result) : null;
}
+public NSRect cancelButtonRectForBounds(NSRect rect) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_cancelButtonRectForBounds_, rect);
+ return result;
+}
+
public NSButtonCell searchButtonCell() {
long /*int*/ result = OS.objc_msgSend(this.id, OS.sel_searchButtonCell);
return result != 0 ? new NSButtonCell(result) : null;
}
+public NSRect searchButtonRectForBounds(NSRect rect) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_searchButtonRectForBounds_, rect);
+ return result;
+}
+
public NSRect searchTextRectForBounds(NSRect rect) {
NSRect result = new NSRect();
OS.objc_msgSend_stret(result, this.id, OS.sel_searchTextRectForBounds_, rect);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
index c32c57de3a..a44b3a8e1e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
@@ -1060,6 +1060,7 @@ public static final long /*int*/ sel_bestRepresentationForDevice_ = sel_register
public static final long /*int*/ sel_bezierPath = sel_registerName("bezierPath");
public static final long /*int*/ sel_bezierPathByFlatteningPath = sel_registerName("bezierPathByFlatteningPath");
public static final long /*int*/ sel_bezierPathWithRect_ = sel_registerName("bezierPathWithRect:");
+public static final long /*int*/ sel_bezierPathWithRoundedRect_xRadius_yRadius_ = sel_registerName("bezierPathWithRoundedRect:xRadius:yRadius:");
public static final long /*int*/ sel_bitmapData = sel_registerName("bitmapData");
public static final long /*int*/ sel_bitmapFormat = sel_registerName("bitmapFormat");
public static final long /*int*/ sel_bitmapImageRepForCachingDisplayInRect_ = sel_registerName("bitmapImageRepForCachingDisplayInRect:");
@@ -1095,6 +1096,7 @@ public static final long /*int*/ sel_canUndo = sel_registerName("canUndo");
public static final long /*int*/ sel_cancel = sel_registerName("cancel");
public static final long /*int*/ sel_cancelAuthenticationChallenge_ = sel_registerName("cancelAuthenticationChallenge:");
public static final long /*int*/ sel_cancelButtonCell = sel_registerName("cancelButtonCell");
+public static final long /*int*/ sel_cancelButtonRectForBounds_ = sel_registerName("cancelButtonRectForBounds:");
public static final long /*int*/ sel_cancelOperation_ = sel_registerName("cancelOperation:");
public static final long /*int*/ sel_cancelTracking = sel_registerName("cancelTracking");
public static final long /*int*/ sel_cascadeTopLeftFromPoint_ = sel_registerName("cascadeTopLeftFromPoint:");
@@ -1804,6 +1806,7 @@ public static final long /*int*/ sel_scrollWheel_ = sel_registerName("scrollWhee
public static final long /*int*/ sel_scrollerWidth = sel_registerName("scrollerWidth");
public static final long /*int*/ sel_scrollerWidthForControlSize_ = sel_registerName("scrollerWidthForControlSize:");
public static final long /*int*/ sel_searchButtonCell = sel_registerName("searchButtonCell");
+public static final long /*int*/ sel_searchButtonRectForBounds_ = sel_registerName("searchButtonRectForBounds:");
public static final long /*int*/ sel_searchTextRectForBounds_ = sel_registerName("searchTextRectForBounds:");
public static final long /*int*/ sel_secondOfMinute = sel_registerName("secondOfMinute");
public static final long /*int*/ sel_secondarySelectedControlColor = sel_registerName("secondarySelectedControlColor");
@@ -3349,7 +3352,7 @@ public static final native void CFRunLoopStop(long /*int*/ rl);
public static final native long /*int*/ CFStringCreateWithCharacters(long /*int*/ alloc, char[] chars, long /*int*/ numChars);
/**
* @param allocator cast=(CFAllocatorRef)
- * @param fsRef cast=(struct FSRef*)
+ * @param fsRef cast=(structFSRef*)
*/
public static final native long /*int*/ CFURLCreateFromFSRef(long /*int*/ allocator, byte[] fsRef);
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTSearchField.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTSearchField.java
index 58a79640b6..58693737c1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTSearchField.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTSearchField.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.swt.internal.cocoa;
+
public class SWTSearchField extends NSSearchField {
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTSearchFieldCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTSearchFieldCell.java
new file mode 100644
index 0000000000..741e91b9b9
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTSearchFieldCell.java
@@ -0,0 +1,16 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class SWTSearchFieldCell extends NSSearchFieldCell {
+
+ public SWTSearchFieldCell() {
+ super();
+ }
+
+ public SWTSearchFieldCell(id id) {
+ super(id);
+ }
+
+ public SWTSearchFieldCell(long id) {
+ super(id);
+ }
+}

Back to the top