Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 159558 Details for
Bug 293230
Support SWT.ICON_SEARCH and SWT.ICON_CANCEL for native find/filter/search box for Windows 7 / Windows 10
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
hack patch for Text
PR293230.patch (text/plain), 9.54 KB, created by
Silenio Quarti
on 2010-02-19 09:58:59 EST
(
hide
)
Description:
hack patch for Text
Filename:
MIME Type:
Creator:
Silenio Quarti
Created:
2010-02-19 09:58:59 EST
Size:
9.54 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.swt >Index: Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java,v >retrieving revision 1.188 >diff -u -r1.188 Text.java >--- Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java 23 Oct 2009 19:24:37 -0000 1.188 >+++ Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java 19 Feb 2010 14:39:12 -0000 >@@ -55,6 +55,7 @@ > * @noextend This class is not intended to be subclassed by clients. > */ > public class Text extends Scrollable { >+ int /*long*/ toolbarHandle; > int tabs, oldStart, oldEnd; > boolean doubleClick, ignoreModify, ignoreVerify, ignoreCharacter; > String message; >@@ -90,6 +91,13 @@ > LIMIT = OS.IsWinNT ? 0x7FFFFFFF : 0x7FFF; > DELIMITER = "\r\n"; > } >+ static final int /*long*/ ToolBarProc; >+ static final TCHAR ToolBarClass = new TCHAR (0, OS.TOOLBARCLASSNAME, true); >+ static { >+ WNDCLASS lpWndClass = new WNDCLASS (); >+ OS.GetClassInfo (0, ToolBarClass, lpWndClass); >+ ToolBarProc = lpWndClass.lpfnWndProc; >+ } > > static final int /*long*/ EditProc; > static final TCHAR EditClass = new TCHAR (0, "EDIT", true); >@@ -158,6 +166,9 @@ > > int /*long*/ callWindowProc (int /*long*/ hwnd, int msg, int /*long*/ wParam, int /*long*/ lParam) { > if (handle == 0) return 0; >+ if (hwnd == toolbarHandle) { >+ return OS.CallWindowProc (ToolBarProc, hwnd, msg, wParam, lParam); >+ } > boolean redraw = false; > switch (msg) { > case OS.WM_ERASEBKGND: { >@@ -267,6 +278,81 @@ > } > > void createHandle () { >+ if ((style & SWT.SEARCH) != 0) { >+ int bits = OS.WS_CHILD | OS.WS_VISIBLE | OS.WS_CLIPSIBLINGS | OS.WS_CLIPCHILDREN; >+ bits |= OS.CCS_NODIVIDER | OS.CCS_NORESIZE;// | OS.TBSTYLE_LIST | OS.TBSTYLE_FLAT; >+// if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) bits |= OS.TBSTYLE_TRANSPARENT; >+ int /*long*/ hwndParent = parent.handle; >+ int exBits = OS.WS_EX_NOINHERITLAYOUT; >+ if ((style & SWT.RIGHT_TO_LEFT) != 0) exBits |= OS.WS_EX_LAYOUTRTL; >+ toolbarHandle = OS.CreateWindowEx ( >+ exBits, >+ ToolBarClass, >+ null, >+ bits, >+ OS.CW_USEDEFAULT, 0, OS.CW_USEDEFAULT, 0, >+ hwndParent, >+ 0, >+ OS.GetModuleHandle (null), >+ null); >+ if (toolbarHandle == 0) error (SWT.ERROR_NO_HANDLES); >+// Image cancelImage = new Image (display, "C:\\silenio\\workspace-clean\\org.eclipse.swt.snippets\\src\\org\\eclipse\\swt\\snippets\\eclipse.png"); >+// Image searchImage = new Image (display, "C:\\silenio\\workspace-clean\\org.eclipse.swt.snippets\\src\\org\\eclipse\\swt\\snippets\\eclipse.png"); >+ >+ /* Set the button struct, bitmap and button sizes */ >+// Rectangle bounds = searchImage.getBounds(); >+ OS.SendMessage (toolbarHandle, OS.TB_BUTTONSTRUCTSIZE, TBBUTTON.sizeof, 0); >+// OS.SendMessage (toolbarHandle, OS.TB_SETBITMAPSIZE, 0, 0); >+// OS.SendMessage (toolbarHandle, OS.TB_SETBUTTONSIZE, 0, 0); >+ >+ /* Set the extended style bits */ >+ bits = OS.TBSTYLE_EX_MIXEDBUTTONS; >+ if (OS.COMCTL32_MAJOR >= 6) bits |= OS.TBSTYLE_EX_DOUBLEBUFFER; >+ OS.SendMessage (toolbarHandle, OS.TB_SETEXTENDEDSTYLE, 0, bits); >+ >+ int /*long*/ imageList = OS.ImageList_Create (16, 16, OS.ILC_COLOR32, 2, 2); >+ OS.SendMessage (toolbarHandle, OS.TB_SETIMAGELIST, 0, imageList); >+ >+// OS.SendMessage (toolbarHandle, OS.TB_SETBUTTONSIZE, 16, 16); >+ >+ TBBUTTON lpButton = new TBBUTTON (); >+ lpButton.idCommand = 1; >+ lpButton.fsStyle = (byte) (OS.BTNS_BUTTON | OS.BTNS_AUTOSIZE); >+ lpButton.fsState = (byte) OS.TBSTATE_ENABLED; >+ lpButton.iBitmap = 5;//imageList.add(cancelImage); >+ OS.SendMessage (toolbarHandle, OS.TB_INSERTBUTTON, 0, lpButton); >+ lpButton.idCommand = 2; >+ lpButton.fsStyle = (byte) OS.BTNS_SEP; >+ OS.SendMessage (toolbarHandle, OS.TB_INSERTBUTTON, 0, lpButton); >+ lpButton.idCommand = 3; >+ lpButton.fsStyle = (byte) (OS.BTNS_BUTTON | OS.BTNS_AUTOSIZE); >+ lpButton.fsState = (byte) OS.TBSTATE_ENABLED;; >+ lpButton.iBitmap = 12;//imageList.add(searchImage); >+ OS.SendMessage (toolbarHandle, OS.TB_INSERTBUTTON, 0, lpButton); >+ >+ OS.SendMessage(toolbarHandle, OS.TB_LOADIMAGES, OS.IDB_STD_SMALL_COLOR, OS.HINST_COMMCTRL); >+// OS.SendMessage(toolbarHandle, OS.WM_USER + 87, 0, 0); >+ >+// OS.SendMessage (toolbarHandle, OS.TB_SETBUTTONSIZE, 20, 20); >+ >+ >+// TBBUTTONINFO info = new TBBUTTONINFO (); >+// info.cbSize = TBBUTTONINFO.sizeof; >+// info.dwMask = OS.TBIF_STYLE; >+// info.fsStyle = (byte) (OS.BTNS_AUTOSIZE); >+// OS.SendMessage (toolbarHandle, OS.TB_SETBUTTONINFO, 1, info); >+// OS.SendMessage (toolbarHandle, OS.TB_SETBUTTONINFO, 3, info); >+ >+ bits = OS.GetWindowLong (toolbarHandle, OS.GWL_STYLE); >+ if ((bits & OS.WS_CHILD) != 0) { >+ OS.SetWindowLongPtr (toolbarHandle, OS.GWLP_ID, toolbarHandle); >+ } >+ if (OS.IsDBLocale && hwndParent != 0) { >+ int /*long*/ hIMC = OS.ImmGetContext (hwndParent); >+ OS.ImmAssociateContext (toolbarHandle, hIMC); >+ OS.ImmReleaseContext (hwndParent, hIMC); >+ } >+ } > super.createHandle (); > OS.SendMessage (handle, OS.EM_LIMITTEXT, 0, 0); > if ((style & SWT.READ_ONLY) != 0) { >@@ -574,6 +660,11 @@ > return OS.GetSysColor ((bits & OS.ES_READONLY) != 0 ? OS.COLOR_3DFACE : OS.COLOR_WINDOW); > } > >+void deregister () { >+ super.deregister (); >+ if (toolbarHandle != 0) display.removeControl (toolbarHandle); >+} >+ > boolean dragDetect (int /*long*/ hwnd, int x, int y, boolean filter, boolean [] detect, boolean [] consume) { > if (filter) { > int [] start = new int [1], end = new int [1]; >@@ -1332,6 +1423,11 @@ > OS.SendMessage (handle, OS.WM_PASTE, 0, 0); > } > >+void register () { >+ super.register(); >+ if (toolbarHandle != 0) display.addControl (toolbarHandle, this); >+} >+ > void releaseWidget () { > super.releaseWidget (); > message = null; >@@ -2042,6 +2138,30 @@ > OS.SendMessage (handle, OS.EM_SCROLLCARET, 0, 0); > } > >+void subclass () { >+ super.subclass(); >+ if (toolbarHandle != 0) { >+ int /*long*/ oldProc = ToolBarProc; >+ int /*long*/ newProc = display.windowProc; >+ if (oldProc == newProc) return; >+ OS.SetWindowLongPtr (toolbarHandle, OS.GWLP_WNDPROC, newProc); >+ } >+} >+ >+int /*long*/ topHandle () { >+ return toolbarHandle != 0 ? toolbarHandle : handle; >+} >+ >+void unsubclass () { >+ if (toolbarHandle != 0) { >+ int /*long*/ newProc = ToolBarProc; >+ int /*long*/ oldProc = display.windowProc; >+ if (oldProc == newProc) return; >+ OS.SetWindowLongPtr (toolbarHandle, OS.GWLP_WNDPROC, newProc); >+ } >+ super.unsubclass(); >+} >+ > String verifyText (String string, int start, int end, Event keyEvent) { > if (ignoreVerify) return string; > Event event = new Event (); >@@ -2115,6 +2235,11 @@ > return mbcsTotal; > } > >+int /*long*/ widgetParent () { >+ if (toolbarHandle != 0) return toolbarHandle; >+ return super.widgetParent (); >+} >+ > int widgetStyle () { > int bits = super.widgetStyle () | OS.ES_AUTOHSCROLL; > if ((style & SWT.PASSWORD) != 0) bits |= OS.ES_PASSWORD; >@@ -2154,6 +2279,63 @@ > } > > int /*long*/ windowProc (int /*long*/ hwnd, int msg, int /*long*/ wParam, int /*long*/ lParam) { >+ if (toolbarHandle != 0 && hwnd == toolbarHandle) { >+ switch (msg) { >+// case OS.WM_ERASEBKGND: >+// drawBackground (wParam); >+// return 1; >+ case OS.WM_MOVE: { >+ sendEvent (SWT.Move); >+ return 0; >+ } >+ case OS.WM_SIZE: { >+ int /*long*/ code = callWindowProc (hwnd, OS.WM_SIZE, wParam, lParam); >+ sendEvent (SWT.Resize); >+ if (isDisposed ()) return 0; >+ RECT rect = new RECT (); >+ OS.GetClientRect (hwnd, rect); >+ int flags = OS.SWP_NOZORDER | OS.SWP_DRAWFRAME | OS.SWP_NOACTIVATE; >+ >+ int width = rect.right - rect.left; >+ RECT itemRect = new RECT (); >+ int index = (int)/*64*/OS.SendMessage (hwnd, OS.TB_COMMANDTOINDEX, 1, 0); >+ OS.SendMessage (hwnd, OS.TB_GETITEMRECT, index, itemRect); >+ System.out.println((itemRect.right - itemRect.left) + " " + (itemRect.bottom - itemRect.top)); >+ >+ width -= (itemRect.right - itemRect.left); >+ int x = itemRect.right - itemRect.left; >+ index = (int)/*64*/OS.SendMessage (hwnd, OS.TB_COMMANDTOINDEX, 3, 0); >+ OS.SendMessage (hwnd, OS.TB_GETITEMRECT, index, itemRect); >+ width -= (itemRect.right - itemRect.left); >+ SetWindowPos (handle, 0, x, 0, width, rect.bottom - rect.top, flags); >+ >+ TBBUTTONINFO info = new TBBUTTONINFO (); >+ info.cbSize = TBBUTTONINFO.sizeof; >+ info.dwMask = OS.TBIF_SIZE; >+ info.cx = (short)width; >+ OS.SendMessage (hwnd, OS.TB_SETBUTTONINFO, 2, info); >+// OS.SendMessage (hwnd, OS.TB_AUTOSIZE, 0, 0); >+ return code; >+ } >+ case OS.WM_NCPAINT: { >+ LRESULT result = wmNCPaint (hwnd, wParam, lParam); >+ if (result != null) return result.value; >+ break; >+ } >+ case OS.WM_PRINT: { >+ LRESULT result = wmPrint (hwnd, wParam, lParam); >+ if (result != null) return result.value; >+ break; >+ } >+// case OS.WM_COMMAND: >+// case OS.WM_NOTIFY: >+// case OS.WM_SYSCOLORCHANGE: { >+// return OS.SendMessage (handle, msg, wParam, lParam); >+// } >+ } >+ return callWindowProc (hwnd, msg, wParam, lParam); >+ } >+ > if (msg == OS.EM_UNDO) { > int bits = OS.GetWindowLong (handle, OS.GWL_STYLE); > if ((bits & OS.ES_MULTILINE) == 0) { >@@ -2401,6 +2583,11 @@ > return wmClipboard (OS.WM_PASTE, wParam, lParam); > } > >+LRESULT WM_SIZE (int /*long*/ wParam, int /*long*/ lParam) { >+ >+ return super.WM_SIZE(wParam, lParam); >+} >+ > LRESULT WM_UNDO (int /*long*/ wParam, int /*long*/ lParam) { > LRESULT result = super.WM_UNDO (wParam, lParam); > if (result != null) return result;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 293230
:
150430
|
157852
|
158941
| 159558