Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiraj Modi2019-06-12 04:35:02 +0000
committerNiraj Modi2019-06-12 04:36:08 +0000
commit6434e727aafcb8d724a9bab0c65f18e15e6b596b (patch)
tree82f61b733df3136819eac0e0f716ff6396437f86
parentf7637e66ba1a0e60c7e4919d99cfaf4e62663d20 (diff)
downloadeclipse.platform.swt-6434e727aafcb8d724a9bab0c65f18e15e6b596b.tar.gz
eclipse.platform.swt-6434e727aafcb8d724a9bab0c65f18e15e6b596b.tar.xz
eclipse.platform.swt-6434e727aafcb8d724a9bab0c65f18e15e6b596b.zip
Revert "Bug 293230 - [Win32] Support SWT.ICON_SEARCH/CANCEL Text styles"
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/cancel.icobin16398 -> 0 bytes
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/search.icobin16398 -> 0 bytes
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt.rc4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scrollable.java20
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java166
10 files changed, 22 insertions, 226 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/cancel.ico b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/cancel.ico
deleted file mode 100644
index d113216165..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/cancel.ico
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c
index d02174121c..ed1dad625c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c
@@ -601,22 +601,6 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(CharUpper)
}
#endif
-#ifndef NO_ChildWindowFromPointEx
-JNIEXPORT jintLong JNICALL OS_NATIVE(ChildWindowFromPointEx)
- (JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jint arg2)
-{
- POINT _arg1, *lparg1=NULL;
- jintLong rc = 0;
- OS_NATIVE_ENTER(env, that, ChildWindowFromPointEx_FUNC);
- if (arg1) if ((lparg1 = getPOINTFields(env, arg1, &_arg1)) == NULL) goto fail;
- rc = (jintLong)ChildWindowFromPointEx((HWND)arg0, *lparg1, (UINT)arg2);
-fail:
- if (arg1 && lparg1) setPOINTFields(env, arg1, lparg1);
- OS_NATIVE_EXIT(env, that, ChildWindowFromPointEx_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO_ChooseColor
JNIEXPORT jboolean JNICALL OS_NATIVE(ChooseColor)
(JNIEnv *env, jclass that, jobject arg0)
@@ -5180,22 +5164,6 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(LoadIcon)
}
#endif
-#ifndef NO_LoadIconMetric
-JNIEXPORT jint JNICALL OS_NATIVE(LoadIconMetric)
- (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2, jintLongArray arg3)
-{
- jintLong *lparg3=NULL;
- jint rc = 0;
- OS_NATIVE_ENTER(env, that, LoadIconMetric_FUNC);
- if (arg3) if ((lparg3 = (*env)->GetIntLongArrayElements(env, arg3, NULL)) == NULL) goto fail;
- rc = (jint)LoadIconMetric((HINSTANCE)arg0, (PCWSTR)arg1, arg2, (HICON *)lparg3);
-fail:
- if (arg3 && lparg3) (*env)->ReleaseIntLongArrayElements(env, arg3, lparg3, 0);
- OS_NATIVE_EXIT(env, that, LoadIconMetric_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO_LoadImage
JNIEXPORT jintLong JNICALL OS_NATIVE(LoadImage)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2, jint arg3, jint arg4, jint arg5)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c
index 451f7bb9cc..94546b87c3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c
@@ -65,7 +65,6 @@ char * OS_nativeFunctionNames[] = {
"CertNameToStr",
"CharLower",
"CharUpper",
- "ChildWindowFromPointEx",
"ChooseColor",
"ChooseFont",
"ClientToScreen",
@@ -428,7 +427,6 @@ char * OS_nativeFunctionNames[] = {
"LoadBitmap",
"LoadCursor",
"LoadIcon",
- "LoadIconMetric",
"LoadImage",
"LocalFree",
"MAKELPARAM",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h
index 4f0ff7b2f9..c5df36e115 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h
@@ -75,7 +75,6 @@ typedef enum {
CertNameToStr_FUNC,
CharLower_FUNC,
CharUpper_FUNC,
- ChildWindowFromPointEx_FUNC,
ChooseColor_FUNC,
ChooseFont_FUNC,
ClientToScreen_FUNC,
@@ -438,7 +437,6 @@ typedef enum {
LoadBitmap_FUNC,
LoadCursor_FUNC,
LoadIcon_FUNC,
- LoadIconMetric_FUNC,
LoadImage_FUNC,
LocalFree_FUNC,
MAKELPARAM_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/search.ico b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/search.ico
deleted file mode 100644
index 5eaf35c21e..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/search.ico
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt.rc b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt.rc
index 3057b6dd33..651f8dc0cf 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt.rc
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt.rc
@@ -50,7 +50,3 @@ BEGIN
VALUE "Translation", 0x409, 1200
END
END
-
-/* Icons for Text widget */
-101 ICON "search.ico"
-102 ICON "cancel.ico"
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java
index 0a20afaeb7..19de3759b3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java
@@ -347,7 +347,6 @@ public class OS extends C {
public static final int CS_VREDRAW = 0x1;
public static final int CS_OWNDC = 0x20;
public static final int CW_USEDEFAULT = 0x80000000;
- public static final int CWP_SKIPINVISIBLE = 0x0001;
public static final String DATETIMEPICK_CLASS = "SysDateTimePick32"; //$NON-NLS-1$
public static final int DCX_CACHE = 0x2;
public static final int DCX_CLIPCHILDREN = 0x8;
@@ -771,7 +770,6 @@ public class OS extends C {
public static final int LGRPID_INSTALLED = 1;
public static final int LIF_ITEMINDEX = 0x1;
public static final int LIF_STATE = 0x2;
- public static final int LIM_SMALL = 0;
public static final int LIS_FOCUSED = 0x1;
public static final int LIS_ENABLED = 0x2;
public static final int LISS_HOT = 0x2;
@@ -2415,12 +2413,6 @@ public static final native int CertNameToStr (int dwCertEncodingType, CERT_NAME_
public static final native long /*int*/ CharLower (long /*int*/ ch);
/** @param ch cast=(LPWSTR) */
public static final native long /*int*/ CharUpper (long /*int*/ ch);
-/**
- * @param hWndParent cast=(HWND)
- * @param pt flags=struct
- * @param flags cast=(UINT)
- */
-public static final native long /*int*/ ChildWindowFromPointEx (long /*int*/ hWndParent, POINT pt, int flags);
/** @param lpcc cast=(LPCHOOSECOLORW) */
public static final native boolean ChooseColor (CHOOSECOLOR lpcc);
/** @param chooseFont cast=(LPCHOOSEFONTW) */
@@ -3299,12 +3291,6 @@ public static final native long /*int*/ LoadCursor (long /*int*/ hInstance, long
public static final native long /*int*/ LoadIcon (long /*int*/ hInstance, long /*int*/ lpIconName);
/**
* @param hinst cast=(HINSTANCE)
- * @param pszName cast=(PCWSTR)
- * @param phico cast=(HICON *)
- */
-public static final native int LoadIconMetric (long /*int*/ hinst, long /*int*/ pszName, int lims, long /*int*/ [] phico);
-/**
- * @param hinst cast=(HINSTANCE)
* @param lpszName cast=(LPWSTR)
*/
public static final native long /*int*/ LoadImage (long /*int*/ hinst, long /*int*/ lpszName, int uType, int cxDesired, int cyDesired, int fuLoad);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
index 0aad7e5b74..c19d155ddf 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
@@ -161,10 +161,6 @@ public class Display extends Device {
static final char [] TAB = new char [] {'T', 'A', 'B', 0};
static final char [] TREEVIEW = new char [] {'T', 'R', 'E', 'E', 'V', 'I', 'E', 'W', 0};
- /* Custom icons */
- long /*int*/ hIconSearch;
- long /*int*/ hIconCancel;
-
/* Focus */
int focusEvent;
Control focusControl;
@@ -3632,10 +3628,6 @@ void releaseDisplay () {
OS.PostMessage (embeddedHwnd, SWT_DESTROY, 0, 0);
}
- /* Free custom icons */
- if (hIconSearch != 0) OS.DestroyIcon (hIconSearch);
- if (hIconCancel != 0) OS.DestroyIcon (hIconCancel);
-
/* Release XP Themes */
if (hButtonTheme != 0) OS.CloseThemeData (hButtonTheme);
if (hEditTheme != 0) OS.CloseThemeData (hEditTheme);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scrollable.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scrollable.java
index 81a335f82d..aa3ccf42e5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scrollable.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scrollable.java
@@ -152,14 +152,8 @@ ScrollBar createScrollBar (int type) {
@Override
void createWidget () {
super.createWidget ();
- /*
- * NOTE: ICON_CANCEL and ICON_SEARCH have the same value as H_SCROLL and
- * V_SCROLL. The meaning is determined by whether SWT.SEARCH is set.
- */
- if ((style & SWT.SEARCH) == 0) {
- if ((style & SWT.H_SCROLL) != 0) horizontalBar = createScrollBar (SWT.H_SCROLL);
- if ((style & SWT.V_SCROLL) != 0) verticalBar = createScrollBar (SWT.V_SCROLL);
- }
+ if ((style & SWT.H_SCROLL) != 0) horizontalBar = createScrollBar (SWT.H_SCROLL);
+ if ((style & SWT.V_SCROLL) != 0) verticalBar = createScrollBar (SWT.V_SCROLL);
}
@Override
@@ -334,14 +328,8 @@ int widgetExtStyle () {
@Override
int widgetStyle () {
int bits = super.widgetStyle () | OS.WS_TABSTOP;
- /*
- * NOTE: ICON_CANCEL and ICON_SEARCH have the same value as H_SCROLL and
- * V_SCROLL. The meaning is determined by whether SWT.SEARCH is set.
- */
- if ((style & SWT.SEARCH) == 0) {
- if ((style & SWT.H_SCROLL) != 0) bits |= OS.WS_HSCROLL;
- if ((style & SWT.V_SCROLL) != 0) bits |= OS.WS_VSCROLL;
- }
+ if ((style & SWT.H_SCROLL) != 0) bits |= OS.WS_HSCROLL;
+ if ((style & SWT.V_SCROLL) != 0) bits |= OS.WS_VSCROLL;
return bits;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java
index 336ded9566..020f5bf972 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java
@@ -68,15 +68,10 @@ public class Text extends Scrollable {
String message;
int[] segments;
int clearSegmentsCount = 0;
- long /*int*/ hwndSearch, hwndCancel, hwndActive;
static final char LTR_MARK = '\u200e';
static final char RTL_MARK = '\u200f';
- /* Custom icons defined in swt.rc */
- static final int IDI_SEARCH = 101;
- static final int IDI_CANCEL = 102;
-
/**
* The maximum number of characters that can be entered
* into a text widget.
@@ -267,49 +262,6 @@ long /*int*/ callWindowProc (long /*int*/ hwnd, int msg, long /*int*/ wParam, lo
break;
}
}
- if ((style & SWT.SEARCH) != 0) {
- switch (msg) {
- case OS.WM_MOUSEMOVE: {
- POINT pt = new POINT ();
- OS.POINTSTOPOINT(pt, lParam);
- long /*int*/ prevActive = hwndActive;
- hwndActive = OS.ChildWindowFromPointEx (handle, pt, OS.CWP_SKIPINVISIBLE);
- if (hwndActive == handle) hwndActive = 0;
- if (prevActive != hwndActive) {
- if (prevActive != 0) OS.InvalidateRect (prevActive, null, false);
- if (hwndActive != 0) OS.InvalidateRect (hwndActive, null, false);
- }
- break;
- }
- case OS.WM_MOUSELEAVE:
- if (hwndActive != 0) {
- OS.InvalidateRect (hwndActive, null, false);
- hwndActive = 0;
- }
- break;
- case OS.WM_LBUTTONDOWN:
- if (hwndActive != 0) {
- OS.InvalidateRect (hwndActive, null, false);
- return 0; // prevent mouse selection
- }
- break;
- case OS.WM_LBUTTONUP: {
- if (hwndActive != 0) {
- Event e = new Event();
- if (hwndActive == hwndSearch) {
- e.detail = SWT.ICON_SEARCH;
- } else {
- e.detail = SWT.ICON_CANCEL;
- setText ("");
- }
- setFocus ();
- selectAll ();
- sendSelectionEvent (SWT.DefaultSelection, e, false);
- }
- break;
- }
- }
- }
long /*int*/ code = OS.CallWindowProc (EditProc, hwnd, msg, wParam, lParam);
switch (msg) {
case OS.WM_HSCROLL:
@@ -333,30 +285,6 @@ void createHandle () {
state |= THEME_BACKGROUND;
}
}
- if ((style & SWT.SEARCH) != 0) {
- if (display.hIconSearch == 0) {
- long /*int*/ [] phicon = new long /*int*/ [1];
- int hresult = OS.LoadIconMetric (OS.GetLibraryHandle (), IDI_SEARCH, OS.LIM_SMALL, phicon);
- if (hresult != OS.S_OK) error (SWT.ERROR_NO_HANDLES);
- display.hIconSearch = phicon [0];
- hresult = OS.LoadIconMetric (OS.GetLibraryHandle (), IDI_CANCEL, OS.LIM_SMALL, phicon);
- if (hresult != OS.S_OK) error (SWT.ERROR_NO_HANDLES);
- display.hIconCancel = phicon [0];
- }
- if ((style & SWT.ICON_SEARCH) != 0) {
- hwndSearch = OS.CreateWindowEx (0, Label.LabelClass, null,
- OS.WS_CHILD | OS.WS_VISIBLE | OS.WS_CLIPSIBLINGS | OS.SS_OWNERDRAW,
- 0, 0, 0, 0, handle, 0, OS.GetModuleHandle (null), null);
- if (hwndSearch == 0) error (SWT.ERROR_NO_HANDLES);
- }
- if ((style & SWT.ICON_CANCEL) != 0) {
- state |= TRACK_MOUSE;
- hwndCancel = OS.CreateWindowEx (0, Label.LabelClass, null,
- OS.WS_CHILD | OS.WS_CLIPSIBLINGS | OS.SS_OWNERDRAW,
- 0, 0, 0, 0, handle, 0, OS.GetModuleHandle (null), null);
- if (hwndCancel == 0) error (SWT.ERROR_NO_HANDLES);
- }
- }
}
@Override
@@ -631,20 +559,20 @@ void applySegments () {
}
static int checkStyle (int style) {
+ if ((style & SWT.SEARCH) != 0) {
+ style |= SWT.SINGLE | SWT.BORDER;
+ style &= ~SWT.PASSWORD;
+ /*
+ * NOTE: ICON_CANCEL has the same value as H_SCROLL and
+ * ICON_SEARCH has the same value as V_SCROLL so they are
+ * cleared because SWT.SINGLE is set.
+ */
+ }
if ((style & SWT.SINGLE) != 0 && (style & SWT.MULTI) != 0) {
style &= ~SWT.MULTI;
}
style = checkBits (style, SWT.LEFT, SWT.CENTER, SWT.RIGHT, 0, 0, 0);
- /*
- * NOTE: ICON_CANCEL and ICON_SEARCH have the same value as H_SCROLL and
- * V_SCROLL. The meaning is determined by whether SWT.SEARCH is set.
- */
- if ((style & SWT.SEARCH) != 0) {
- style |= SWT.SINGLE | SWT.BORDER;
- style &= ~(SWT.PASSWORD | SWT.WRAP);
- } else if ((style & SWT.SINGLE) != 0) {
- style &= ~(SWT.H_SCROLL | SWT.V_SCROLL | SWT.WRAP);
- }
+ if ((style & SWT.SINGLE) != 0) style &= ~(SWT.H_SCROLL | SWT.V_SCROLL | SWT.WRAP);
if ((style & SWT.WRAP) != 0) {
style |= SWT.MULTI;
style &= ~SWT.H_SCROLL;
@@ -823,10 +751,7 @@ public void cut () {
@Override
int defaultBackground () {
int bits = OS.GetWindowLong (handle, OS.GWL_STYLE);
- if ((bits & OS.ES_READONLY) != 0 || !OS.IsWindowEnabled (handle)) {
- return OS.GetSysColor (OS.COLOR_3DFACE);
- }
- return OS.GetSysColor (OS.COLOR_WINDOW);
+ return OS.GetSysColor ((bits & OS.ES_READONLY) != 0 ? OS.COLOR_3DFACE : OS.COLOR_WINDOW);
}
TCHAR deprocessText (TCHAR text, int start, int end, boolean terminate) {
@@ -1867,18 +1792,6 @@ boolean sendKeyEvent (int type, int msg, long /*int*/ wParam, long /*int*/ lPara
}
@Override
-void setBackgroundImage (long /*int*/ hBitmap) {
- int flags = OS.RDW_ERASE | OS.RDW_ALLCHILDREN | OS.RDW_INVALIDATE;
- OS.RedrawWindow (handle, null, 0, flags);
-}
-
-@Override
-void setBackgroundPixel (int pixel) {
- int flags = OS.RDW_ERASE | OS.RDW_ALLCHILDREN | OS.RDW_INVALIDATE;
- OS.RedrawWindow (handle, null, 0, flags);
-}
-
-@Override
void setBoundsInPixels (int x, int y, int width, int height, int flags) {
/*
* Feature in Windows. When the caret is moved,
@@ -2034,16 +1947,14 @@ public void setFont (Font font) {
}
void setMargins () {
+ /*
+ * Bug in Windows. When EM_SETCUEBANNER is used to set the
+ * banner text, the control does not take into account the
+ * margins, causing the first character to be clipped. The
+ * fix is to set the margins to zero.
+ */
if ((style & SWT.SEARCH) != 0) {
- int flags = 0;
- int fLeading = (style & SWT.LEFT_TO_RIGHT) != 0 ? OS.EC_LEFTMARGIN : OS.EC_RIGHTMARGIN;
- int fTrailing = (style & SWT.LEFT_TO_RIGHT) != 0 ? OS.EC_RIGHTMARGIN : OS.EC_LEFTMARGIN;
- if ((style & SWT.ICON_SEARCH) != 0) flags |= fLeading;
- if ((style & SWT.ICON_CANCEL) != 0) flags |= fTrailing;
- if (flags != 0) {
- int iconWidth = OS.GetSystemMetrics (OS.SM_CXSMICON);
- OS.SendMessage (handle, OS.EM_SETMARGINS, flags, OS.MAKELPARAM(iconWidth, iconWidth));
- }
+ OS.SendMessage (handle, OS.EM_SETMARGINS, OS.EC_LEFTMARGIN | OS.EC_RIGHTMARGIN, 0);
}
}
@@ -2517,7 +2428,6 @@ int widgetStyle () {
if ((style & SWT.CENTER) != 0) bits |= OS.ES_CENTER;
if ((style & SWT.RIGHT) != 0) bits |= OS.ES_RIGHT;
if ((style & SWT.READ_ONLY) != 0) bits |= OS.ES_READONLY;
- if ((style & SWT.SEARCH) != 0) bits |= OS.WS_CLIPCHILDREN;
if ((style & SWT.SINGLE) != 0) {
/*
* Feature in Windows. When a text control is read-only,
@@ -2704,25 +2614,6 @@ LRESULT WM_CUT (long /*int*/ wParam, long /*int*/ lParam) {
}
@Override
-LRESULT WM_DRAWITEM (long wParam, long lParam) {
- DRAWITEMSTRUCT struct = new DRAWITEMSTRUCT ();
- OS.MoveMemory (struct, lParam, DRAWITEMSTRUCT.sizeof);
- RECT rect = new RECT ();
- OS.SetRect (rect, struct.left, struct.top, struct.right, struct.bottom);
- POINT pt = new POINT ();
- OS.MapWindowPoints (struct.hwndItem, handle, pt, 1);
- drawBackground (struct.hDC, rect, -1, pt.x, pt.y);
- if (struct.hwndItem == hwndCancel && struct.hwndItem == hwndActive && OS.IsAppThemed()) {
- int state = OS.GetKeyState (OS.VK_LBUTTON) < 0 ? OS.PBS_PRESSED : OS.PBS_HOT;
- OS.DrawThemeBackground (display.hButtonTheme (), struct.hDC, OS.BP_PUSHBUTTON, state, rect, null);
- }
- long /*int*/ hIcon = (struct.hwndItem == hwndSearch) ? display.hIconSearch : display.hIconCancel;
- int y = (rect.bottom - rect.right) / 2;
- OS.DrawIconEx (struct.hDC, 0, y, hIcon, 0, 0, 0, 0, OS.DI_NORMAL);
- return LRESULT.ONE;
-}
-
-@Override
LRESULT WM_ERASEBKGND (long /*int*/ wParam, long /*int*/ lParam) {
LRESULT result = super.WM_ERASEBKGND (wParam, lParam);
if ((style & SWT.READ_ONLY) != 0) {
@@ -2866,24 +2757,6 @@ LRESULT WM_PASTE (long /*int*/ wParam, long /*int*/ lParam) {
}
@Override
-LRESULT WM_SIZE(long wParam, long lParam) {
- LRESULT result = super.WM_SIZE (wParam, lParam);
- if (isDisposed ()) return result;
- if ((style & SWT.SEARCH) != 0) {
- /* NOTE: EDIT controls don't support mirrored layout. */
- long /*int*/ hwndLeading = (style & SWT.LEFT_TO_RIGHT) != 0 ? hwndSearch : hwndCancel;
- long /*int*/ hwndTrailing = (style & SWT.LEFT_TO_RIGHT) != 0 ? hwndCancel : hwndSearch;
- int width = OS.LOWORD (lParam);
- int height = OS.HIWORD (lParam);
- int iconWidth = OS.GetSystemMetrics (OS.SM_CXSMICON);
- int flags = OS.SWP_NOZORDER | OS.SWP_NOACTIVATE | OS.SWP_NOCOPYBITS;
- if (hwndLeading != 0) OS.SetWindowPos (hwndLeading, 0, 0, 0, iconWidth, height, flags);
- if (hwndTrailing != 0) OS.SetWindowPos (hwndTrailing, 0, width - iconWidth, 0, iconWidth, height, flags);
- }
- return result;
-}
-
-@Override
LRESULT WM_UNDO (long /*int*/ wParam, long /*int*/ lParam) {
LRESULT result = super.WM_UNDO (wParam, lParam);
if (result != null) return result;
@@ -3000,9 +2873,6 @@ LRESULT wmCommandChild (long /*int*/ wParam, long /*int*/ lParam) {
if (findImageControl () != null) {
OS.InvalidateRect (handle, null, true);
}
- if ((style & SWT.SEARCH) != 0 && hwndCancel != 0) {
- OS.ShowWindow (hwndCancel, OS.GetWindowTextLength (handle) != 0 ? OS.SW_SHOW : OS.SW_HIDE);
- }
if (ignoreModify) break;
/*
* It is possible (but unlikely), that application

Back to the top