[ros-diffs] [jimtabor] 43089: - Wine sync up to 1.1.29 Edit controls.

jimtabor at svn.reactos.org jimtabor at svn.reactos.org
Sun Sep 20 01:31:18 CEST 2009


Author: jimtabor
Date: Sun Sep 20 01:31:17 2009
New Revision: 43089

URL: http://svn.reactos.org/svn/reactos?rev=43089&view=rev
Log:
- Wine sync up to 1.1.29 Edit controls.

Modified:
    trunk/reactos/dll/win32/user32/controls/edit.c
    trunk/reactos/media/doc/README.WINE

Modified: trunk/reactos/dll/win32/user32/controls/edit.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/edit.c?rev=43089&r1=43088&r2=43089&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/controls/edit.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/controls/edit.c [iso-8859-1] Sun Sep 20 01:31:17 2009
@@ -68,6 +68,8 @@
 #define EF_USE_SOFTBRK		0x0100	/* Enable soft breaks in text. */
 #define EF_APP_HAS_HANDLE       0x0200  /* Set when an app sends EM_[G|S]ETHANDLE.  We are in sole control of
                                            the text buffer if this is clear. */
+#define EF_DIALOGMODE           0x0400  /* Indicates that we are inside a dialog window */
+
 typedef enum
 {
 	END_0 = 0,			/* line ends with terminating '\0' character */
@@ -3201,29 +3203,7 @@
  */
 static BOOL EDIT_IsInsideDialog(EDITSTATE *es)
 {
-#ifdef __REACTOS__
-    if (es->hwndParent && es->hwndParent != GetDesktopWindow())
-    {
-        if (GetClassLongPtrW (es->hwndParent, GCW_ATOM) == (DWORD)MAKEINTATOM(32770))
-            return TRUE;
-    }
-    return FALSE;
-#else
-    WND *pParent;
-    BOOL r = FALSE;
-
-    if (es->hwndParent)
-    {
-        pParent = WIN_GetPtr(es->hwndParent);
-        if (pParent && pParent != WND_OTHER_PROCESS && pParent != WND_DESKTOP)
-        {
-            if (pParent->flags & WIN_ISDIALOG)
-                r = TRUE;
-            WIN_ReleasePtr(pParent);
-        }
-    }
-    return r;
-#endif
+    return (es->flags & EF_DIALOGMODE);
 }
 
 
@@ -3679,32 +3659,32 @@
 	    /* If the edit doesn't want the return send a message to the default object */
 	    if(!(es->style & ES_MULTILINE) || !(es->style & ES_WANTRETURN))
 	    {
-		HWND hwndParent;
 		DWORD dw;
 
-                if (!EDIT_IsInsideDialog(es)) return 1;
+                if (!EDIT_IsInsideDialog(es)) break;
                 if (control) break;
-                hwndParent = GetParent(es->hwndSelf);
-                dw = SendMessageW( hwndParent, DM_GETDEFID, 0, 0 );
-		if (HIWORD(dw) == DC_HASDEFID)
-		{
-		    SendMessageW( hwndParent, WM_COMMAND,
-				  MAKEWPARAM( LOWORD(dw), BN_CLICKED ),
- 			      (LPARAM)GetDlgItem( hwndParent, LOWORD(dw) ) );
-		}
-                else
-                    SendMessageW( hwndParent, WM_COMMAND, IDOK, (LPARAM)GetDlgItem( hwndParent, IDOK ) );
+                dw = SendMessageW( es->hwndParent, DM_GETDEFID, 0, 0 );
+                if (HIWORD(dw) == DC_HASDEFID)
+                {
+                    HWND hwDefCtrl = GetDlgItem(es->hwndParent, LOWORD(dw));
+                    if (hwDefCtrl)
+                    {
+                        SendMessageW(es->hwndParent, WM_NEXTDLGCTL, (WPARAM)hwDefCtrl, (LPARAM)TRUE);
+                        PostMessageW(hwDefCtrl, WM_KEYDOWN, VK_RETURN, 0);
+                    }
+                }
 	    }
 	    break;
         case VK_ESCAPE:
-	    if (!(es->style & ES_MULTILINE))
-                SendMessageW(GetParent(es->hwndSelf), WM_COMMAND, IDCANCEL, (LPARAM)GetDlgItem( GetParent(es->hwndSelf), IDCANCEL ) );
+	    if (!(es->style & ES_MULTILINE) && EDIT_IsInsideDialog(es))
+	        PostMessageW(es->hwndParent, WM_CLOSE, 0, 0);
             break;
         case VK_TAB:
-            SendMessageW(es->hwndParent, WM_NEXTDLGCTL, shift, 0);
+            if ((es->style & ES_MULTILINE) && EDIT_IsInsideDialog(es))
+                SendMessageW(es->hwndParent, WM_NEXTDLGCTL, shift, 0);
             break;
 	}
-	return 0;
+	return TRUE;
 }
 
 
@@ -5232,27 +5212,21 @@
 		if (es->style & ES_MULTILINE)
 		   result |= DLGC_WANTALLKEYS;
 
-		if (lParam && (((LPMSG)lParam)->message == WM_KEYDOWN))
-		{
-		   int vk = (int)((LPMSG)lParam)->wParam;
-
-                   if (es->hwndListBox)
-                   {
-                       if (vk == VK_RETURN || vk == VK_ESCAPE)
-                           if (SendMessageW(GetParent(hwnd), CB_GETDROPPEDSTATE, 0, 0))
-                               result |= DLGC_WANTMESSAGE;
-                   }
-                   else
-                   {
-                       switch (vk)
-                       {
-                           case VK_ESCAPE:
-                               SendMessageW(GetParent(hwnd), WM_CLOSE, 0, 0);
-                               break;
-                           default:
-                               break;
-                       }
-                   }
+                if (lParam)
+                {
+                    es->flags|=EF_DIALOGMODE;
+
+                    if (((LPMSG)lParam)->message == WM_KEYDOWN)
+                    {
+                        int vk = (int)((LPMSG)lParam)->wParam;
+
+                        if (es->hwndListBox)
+                        {
+                            if (vk == VK_RETURN || vk == VK_ESCAPE)
+                                if (SendMessageW(GetParent(hwnd), CB_GETDROPPEDSTATE, 0, 0))
+                                    result |= DLGC_WANTMESSAGE;
+                        }
+                  }
                 }
 		break;
 

Modified: trunk/reactos/media/doc/README.WINE
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=43089&r1=43088&r2=43089&view=diff
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Sep 20 01:31:17 2009
@@ -231,7 +231,7 @@
 User32 -
   reactos/dll/win32/user32/controls/button.c    # Synced to Wine-1_1_22
   reactos/dll/win32/user32/controls/combo.c     # Synced to Wine-1_1_22
-  reactos/dll/win32/user32/controls/edit.c      # Synced to Wine-1_1_22
+  reactos/dll/win32/user32/controls/edit.c      # Synced to Wine-1_1_29
   reactos/dll/win32/user32/controls/icontitle.c # Synced to Wine-1_1_13
   reactos/dll/win32/user32/controls/listbox.c   # Synced to Wine-1_1_22
   reactos/dll/win32/user32/controls/scrollbar.c # Forked




More information about the Ros-diffs mailing list