Correct the style patching of edit controls

Medland, Bill Bill.Medland at accpac.com
Tue Jul 10 18:05:03 CDT 2001


 <<diff.txt>> 
-------------- next part --------------
Bill Medland (medbi01 at accpac.com)
Correct the location of the style patching for the edit control.

Index: wine/windows/dialog.c
===================================================================
RCS file: /home/wine/wine/windows/dialog.c,v
retrieving revision 1.84
diff -u -r1.84 dialog.c
--- wine/windows/dialog.c	2001/07/02 19:59:50	1.84
+++ wine/windows/dialog.c	2001/07/10 22:37:14
@@ -479,6 +479,12 @@
         {
             template = (LPCSTR)DIALOG_GetControl32( (WORD *)template, &info,
                                                     dlgTemplate->dialogEx );
+            /* Is this it? */
+            if (info.style & WS_BORDER)
+            {
+                info.style &= ~WS_BORDER;
+                info.exStyle |= WS_EX_CLIENTEDGE;
+            }
             hwndCtrl = CreateWindowExW( info.exStyle | WS_EX_NOPARENTNOTIFY,
                                           (LPCWSTR)info.className,
                                           (LPCWSTR)info.windowName,
Index: wine/controls/edit.c
===================================================================
RCS file: /home/wine/wine/controls/edit.c,v
retrieving revision 1.83
diff -u -r1.83 edit.c
--- wine/controls/edit.c	2001/06/28 18:01:00	1.83
+++ wine/controls/edit.c	2001/07/10 22:37:29
@@ -4408,8 +4408,8 @@
 	EDITSTATE *es;
 	UINT alloc_size;
 
-	TRACE("Creating %s edit control, style = %08lx\n",
-		unicode ? "Unicode" : "ANSI", style);
+	TRACE("Creating %s edit control, style = %08lx %08lx\n",
+		unicode ? "Unicode" : "ANSI", style, wnd->dwExStyle);
 
 	if (!(es = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*es))))
 		return FALSE;
@@ -4429,16 +4429,15 @@
 	/*
 	 * In Win95 look and feel, the WS_BORDER style is replaced by the 
 	 * WS_EX_CLIENTEDGE style for the edit control. This gives the edit 
-	 * control a non client area.
+	 * control a non client area.  Not always.  This coordinates in some
+         * way with the window creation code in dialog.c  When making 
+         * modifications please ensure that the code still works for edit
+         * controls created directly with style 0x50800000, exStyle 0 (
+         * which should have a single pixel border)
 	 */
 	if (TWEAK_WineLook != WIN31_LOOK)
 	{
-	  if (es->style & WS_BORDER)
-	  {
-	    es->style      &= ~WS_BORDER;
-	    wnd->dwStyle   &= ~WS_BORDER;
-	    wnd->dwExStyle |= WS_EX_CLIENTEDGE;
-	  }
+	  es->style      &= ~WS_BORDER;
 	}
 	else
 	{


More information about the wine-patches mailing list